[tw] Re: Insert text depending on field value

2016-07-30 Thread Ste Wilson
Sorry for the late reply. Cheers for that. It got me going on the right lines. 

Have got a toddler working here: 
stephenteacher.tiddlyspot.com/#worked%20eg%20test

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/24979718-128b-4151-9d34-53e7fe7a5617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Insert text depending on field value

2016-07-22 Thread 'c pa' via TiddlyWiki
Try building a tiddler something like this (correctanswer ans sentence are 
fields you need to add)

title: "Question1"
correctanswer: "five"
sentence: "I have <> fingers"
text="""

\define Get_Answer_Text(question)
<$view tiddler="$:/state/answers/$question$" />
\end
\define Edit_Answer_Text(question)
<$edit-text tag="input" tiddler="$:/state/answers/$question$" />
\end
\define findanswer()
<$macrocall $name="Get_Answer_Text" question=<> />
\end
The sentence is: ''{{!!sentence}}''

How many fingers do you have?
<$macrocall $name="Edit_Answer_Text" question=<> />

<$reveal type="match" state="$:/state/answers/Question1" 
text={{!!correctanswer}}>
That is correct!


<$reveal type="nomatch" state="$:/state/answers/Question1" 
text={{!!correctanswer}}>
That's good but its not right. If your answer was {{!!correctanswer}} then 
the text might read


"""

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fa25c6c1-b1be-44eb-a4d8-e8a53c8d023b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.