On Thursday, July 21, 2016 at 6:58:39 AM UTC-7, Carlos Caimi wrote:
>
> I'm try to make a simple avaliation ("evaluation" ???) form using a macro
> to create radios for awnser ("ANSWER") and <$reveal> to show the correct
> awnser for the student. But dont work.
>
In your code, you write:
<$radio field="$:/state/q/$quest$" value="a">A</$radio>
However, to specify the target of a radio button, you must specify the
*tiddler* and *field* separately. Something like this will work:
<$radio tiddler="$:/state/q/$quest$" field="text" value="a">A</$radio>
(note: the *field* name will default to "text" if not provided)
You will also need to change your debugging output from
{{!!$:/state/q/$quest$}}
to
{{$:/state/q/$quest$}}
Then, the rest of your script will work as you intend:
\define q(quest: "q1" answer: "b")
"""
<$radio tiddler="$:/state/q/$quest$" value="a">A</$radio>
<$radio tiddler="$:/state/q/$quest$" value="b">B</$radio>
<$radio tiddler="$:/state/q/$quest$" value="c">C</$radio>
<$radio tiddler="$:/state/q/$quest$" value="d">D</$radio>
<$radio tiddler="$:/state/q/$quest$" value="e">E</$radio>
"""
debug: quest: ''$quest$''; correctAnswer: ''$answer$''; answer: ''{{$:
/state/q/$quest$}}''
<$reveal type="match" state="$:/state/q/$quest$" text="$answer$">
CORRECT!!
</$reveal>
<$reveal type="nomatch" state="$:/state/q/$quest$" text="$answer$">
WRONG!!
</$reveal>
\end
<<q "q1" "c">>
(note: I corrected your spelling of "answer")
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals
--
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 [email protected].
To post to this group, send email to [email protected].
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/876d9e37-fe3a-48af-8dc5-694c575eabfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.