[Hard] Tiddler displaying parts of other tiddlers

88 views
Skip to first unread message

Chems

unread,
Jun 6, 2019, 9:41:32 AM6/6/19
to TiddlyWiki
Okay this is hard, especially for me as a new Tiddlywikkier (or how do you call yourself ?), so bear with me.

I have approx. 30 tiddlers under a specific tag. 
My tiddlers are build as followed:
     Title: generic title
     Text of Tittler: First Line "Most important information" (3-10 words).
                            then some more text, pictrues etc etc.

Now I want to create a new Tiddler, with a complex function.
I want this tiddler to show randomly the title of a random tiddler,
then four  "Most important information" from 3 different tiddlers and the "Most important information" of the tiddler which title was choosen. These 4 Informations should appear in a random order.

The user should now be able to click on the one "Most important information", which he thinks is the one from the title. 
The correct answer will be displayed and the next question will start like before.

As I said, I am pretty new to Tiddlywiki and to programming at all, but am kinda motivated.
Has anybody a idea how to takle this task?
Does anybody know a similar question with solution?
Which tutorials would you recommend for me to study, so that I could be able to handle this?

For me, this whole tasks sounds pretty though and I am not even sure if it is in the scope of tiddlywiki.

I am greateful for every help!

Thank you in advanced!

Mat

unread,
Jun 6, 2019, 3:20:55 PM6/6/19
to TiddlyWiki
I saw another thread just a day ago or so with someone asking for how to extract the first line of the text in a tiddler. You might want to search and see if/how that was answered.

I don't think there is a "randomizer" ni TW but I think I've seen some a long time ago. If you search for random or randomizer you might find more info. I think the ideal would be if it was a filter operator so that you could create a filter something like

[tag[Question]!tag[AlreadyAsked]randomize[]limit[4]]

You may also want to do a search for "Quiz".

<:-)

Mat

unread,
Jun 6, 2019, 3:23:34 PM6/6/19
to TiddlyWiki
Chems wrote:
Okay this is hard, especially for me as a new Tiddlywikkier (or how do you call yourself ?),

BTW, it's "Tiddleur". Don't let anybody trick you into joining their split out sub group in this community.  

<:-)

Mark S.

unread,
Jun 6, 2019, 5:35:21 PM6/6/19
to TiddlyWiki
Rather than splitting out the line, put it in its own field. Then inside your tiddler, you can reference it like:

{{!!most-important-things}}

It's usually better to work the way TW does, than to try to do things the way you would in some other technology.

To do random numbers you will either need a math library or write your own in a javascript macro.

Or, make your own pseudo-random dictionary:

0: 2 9 1 3
1: 3 5 2 7
...
9: 8 7 1 2

Then select which set you're using based on the time stamp, like:

<$set name="lev1" filter="[<now>splitbefore[:]]">
<$set name="lev1b" filter="[<now>removeprefix<lev1>]">
<$set name="lev2" filter="[enlist<lev1b>splitbefore[]]">
<$set name="lev2b" filter="[enlist<lev1b>removeprefix<lev2>]">
<$set name="lev3" filter="[enlist<lev2b>splitbefore[]]">
<<lev3>>
</$set></$set></$set></$set></$set>

(that gives a number between 0 and 9 depending on the minutes in the hour).

Overall, it would be a challenging task. I'm not sure I've seen a complete quiz project, though there's some partially-started.

TonyM

unread,
Jun 6, 2019, 6:19:34 PM6/6/19
to TiddlyWiki
There is a plugin for selecting random titles which I will locate and share if no one beats me to it. It may be related to quizzes.

Regards
Tony

Mohammad

unread,
Jun 7, 2019, 2:18:50 AM6/7/19
to TiddlyWiki
Hi,
 If you add the macro by Mark and the Find macro then you can extract part of tiddler text not only tiddler fields.
You can also use the random macro by Tobias Beer.

Good luck
Mohammad

PMario

unread,
Jun 7, 2019, 3:42:55 AM6/7/19
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages