Subversion Repositories wimsdev

Rev

Rev 12208 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=question first
textarea="datatrue datafalse explain"
iEdit="explain"
asis="datatrue datafalse explain"

:A multiple choice exercise with random permutation.

A standard multiple choice exercise; The answers as well as their order may be randomized.
<p>Author of the model: Gang Xiao <qualite@wimsedu.info></p>

:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%

Remove the above header if you destroy the model tags i.e. the lines starting
with a ':'. Otherwise the exercise might not be recognised by Createxo.

:%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%%

:\title{Multiple choice}
:\author{XIAO, Gang}
:\email{qualite@wimsedu.info}
:\credits{}

:Maximum 10 possible answers will be shown to the learner at a time.
It is recommended that you provide a large number of possible answers for the exercise ,
otherwise the exercise will only show
what is available.
\integer{tot=5}

:The number of correct answers in each exercise must not exceed the total.
\integer{givetrue=2}

:Number of "mandatory" wrong answers.
For example if this number is 2, the first two wrong answers in the list will
always be presented in the generated exercise.
<p> If doubtful, put 0.</p>
\integer{minfalse=0}

:Text that explains what should be done.
$embraced_randitem
\text{explain=<p>Here is a model of multiple choice exercise. The answers are presented in random order.
Change the text here below to make your own multiple choice exercise.</p>
Select the correct answer.
When there are several correct answers, you can select any of them.
}

:The correct answers - write one per line.
You can write several here (one per line) for random pickup.
Avoid very long sentences! No semi-colons are allowed in the sentence.
$embraced_randitem
\matrix{datatrue=
First correct answer.
Second correct answer.
Third correct answer.
Fourth correct answer.
}

:The wrong answers -write one per line.
You can write several here (one per line) for random pickup.
Avoid very long sentences! No semi-colons are allowed in the sentence.
$embraced_randitem
\matrix{datafalse=
First wrong answer.
Second wrong answer.
Third wrong answer.
Fourth wrong answer.
Fifth wrong answer.
Sixth wrong answer.
Seventh wrong answer.
Eighth wrong answer.
}

:Optional words: "checkbox", "split".
Add the word "checkbox" if there are several correct answers and if the student
must seelct all of them (instead of just any one). If you authorise a partial score
for when only part of the correct answers have been selected, enter the word 'split'.

\text{option=}

:General feedback
This text will be displayed after the learner response, whether it's right or wrong.
\text{feedback_general=}

:Feedback for a good answer
This text will be displayed after the learner response, only if it's right.
\text{feedback_good=}

:Feedback for a bad answer
This text will be displayed after the learner response, only if it's wrong.
\text{feedback_bad=}

:Hint
A text that can give tips to leaners on how to find the answer
\text{exo_hint=}

:Embraced random items
$embraced_randitem
\text{accolade=item(1,1 yes,
2 no)}

:%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%%
\text{accolade=wims(word 1 of \accolade)}

\text{empty=}
\if{\feedback_general != \empty}{
  \text{feedback_general=<p class="feedback">\feedback_general</p>}
}
\if{\feedback_good != \empty}{
  \text{feedback_good=<p class="feedback good_answer">\feedback_good</p>}
}
\if{\feedback_bad != \empty}{
  \text{feedback_bad=<p class="feedback bad_answer">\feedback_bad</p>}
}
\if{\exo_hint != \empty}{
  \hint{\exo_hint}
}

\text{datatrue=wims(nonempty rows \datatrue)}
\text{datafalse=wims(nonempty rows \datafalse)}
\integer{truecnt=rows(\datatrue)}
\integer{falsecnt=rows(\datafalse)}
\integer{givetrue=\givetrue<1?1}
\integer{givetrue=\givetrue>\truecnt?\truecnt}
\integer{tot=\tot > \falsecnt+\givetrue?\falsecnt+\givetrue}
\integer{givetrue=\givetrue>\tot-1?\tot-1}
\integer{minfalse=\minfalse>\tot-\givetrue?\tot-\givetrue}
\text{tsh=shuffle(\truecnt)}
\text{true=row(\tsh,\datatrue)}
\if{\minfalse>0}{
 \text{false1=row(1..\minfalse,\datafalse);}
 \text{false2=row(\minfalse+1..\falsecnt,\datafalse)}
}{
 \integer{minfalse=0}
 \text{false1=}
 \text{false2=\datafalse}
}
\text{fsh=shuffle(\falsecnt)}
\text{false2=row(\fsh,\false2)}
\text{pick=row(1..\givetrue,\true);\false1 row(1..\tot-\givetrue-\minfalse,\false2)}
\text{ind=wims(makelist 1 for x=1 to \givetrue),wims(makelist 0 for x=1 to \tot-\givetrue)}

\text{sh=shuffle(\tot)}
\text{ind=item(\sh,\ind)}
\text{pick=row(\sh,\pick)}
\text{pick=\accolade=1 ? wims(embraced randitem \pick)}
\text{explain=\accolade=1 ? wims(embraced randitem \explain)}
\text{ans=positionof(1,\ind)}
\text{list=item(1..\tot,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)}
\text{anstype=checkbox iswordof \option?checkbox:radio}

:%%%%%%%%%%%%% Now the statement in HTML. %%%%%%%%%%%%%%%%%%%%

::You don't need to modify this in general.

\statement{
  <div class="oef_explain">\explain</div>
  \for{i=1 to \tot}
  {<div class="oefreply">\embed{reply 1,\i, \list[\i] : \pick[\i;]}</div>}
}

:%%%%%%%%%%%%% Nothing to modify after. %%%%%%%%%%%%%%%%%5

\answer{The reply}{\ans;\list}{type=\anstype}{option=\option}

\feedback{1=1}{\feedback_general}
\feedback{\reply1 isitemof \list[\ans]}{\feedback_good}
\feedback{\reply1 notitemof \list[\ans]}{\feedback_bad}