-
Hello, I've written a little widget that schedules tiddlers to be reviewed in a "Spaced Repetition" manner. Rather than show the whole tiddler on review i'd like to show a section of it that I can mark as a question, then you can click show anwser or something and have it show the whole tiddler. e.g. And in the case where i render the tiddler normally in the story river (or transcluded in another tiddler), just have it display without the question marked section. Is there some tiddlwyiki like way i can achieve this? in my current w3idget i could manually scan for the <$question> block and display that, but that wouldn't solve the general case where i don't want to to show the question section normally - in that case do i just write a widget that simply hides it's contents for the scheduling widget to pick up? Thanks for any suggestions, |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Wrapping your question in a list widget along the lines of the following should hide it when displayed directly in the story river:
Alternatively have CSS that hides the questions by default, and then your scheduling widget adds a class that makes them visible. |
Beta Was this translation helpful? Give feedback.
-
would this work in the case where transcluded the article in another one? e.g. outside of the scheduling widget.. |
Beta Was this translation helpful? Give feedback.
-
I went with a widget that exists alongside my scheduling one as I proposed above. However i'm stumped on how to get the contents of a widget to render as thought hey were wiki text. the output it just plain text : It seems that this is an issue even with the default widget render function. Is there a way to get this to render like wiki text?
|
Beta Was this translation helpful? Give feedback.
-
Can you please post the code for your widget? |
Beta Was this translation helpful? Give feedback.
-
sure
in the example posted i'm just using the default widget render function |
Beta Was this translation helpful? Give feedback.
-
code here: https://github.com/welford/twsr I went with a second tiddler that exists in the same space as my "reveal answer"/scheduling plugin. The scheduling plugin has a couple of globals (g_showAnswer, g_questionElm) that when set can be filled by the barebones Question plugin (see code below) and rendered by the scheduling plugin.
Thank you for all the help @saqimtiaz ! |
Beta Was this translation helpful? Give feedback.
code here: https://github.com/welford/twsr
example here: http://welford.github.io/kanji.html
I went with a second tiddler that exists in the same space as my "reveal answer"/scheduling plugin. The scheduling plugin has a couple of globals (g_showAnswer, g_questionElm) that when set can be filled by the barebones Question plugin (see code below) and rendered by the scheduling plugin.