Subversion Repositories wimsdev

Rev

Rev 15179 | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=gapfill first
textarea="explain data"
iEdit="explain"
asis="explain"

:Multiple choice questions embedded in a non variable text.

This exercise presents a text where multiple-choice fields are inserted.
<p>
To build an exercise with this model, just enter the texts.
An easy syntax allows to incorporate the fields of choice in the texts.
</p>
<p class="wims_credits">Author of the model: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a></p>

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

Remove the above header if you destroy the model tags! (The lines starting
with a ':'.) Otherwise the exercise might not be taken back by Createxo.

:%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%%

:\title{Drop-down menus in a text}
:\author{XIAO, Gang}
:\email{qualite@wimsedu.info}
:\credits{}
:Consigne pour les apprenants

\text{explain=Fill in:}

:Main data.
Questions to ask should be between a pair of double-question marks "??":
the different choices are separated by commas,
the correct answer being first.
You can ask up to 20 questions in one sentence.
<p>The text here is fixed.
  To vary the texts, choose the <strong>Choices in Texts</strong> template instead.</p>
$embraced_randitem
\text{data=
Linux was created in ??1991,1995,1998,1986,1989,2001?? by Linus Torvalds,
who was a ??Finnish, Swedish, American, English, Nordic?? student
at the time working on the ??Minix,Unix,Solaris?? system on
??Intel 386,Sun,Macintosh,Bull,Microsoft?? architecture machines.<br>
He posted on a newsgroup the first version of his system,
 which was version ??0.02,0.00,0.01,0.12,1.00??.</p>
}

: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{data=wims(singlespace \data)}
\text{data=\accolade=1 ? wims(embraced randitem \data)}
\text{data=slib(text/cutchoice2 \data)}
\integer{qs=min(20,floor(rows(\data)/2))}

\text{good=}
\text{field=}
\for{i=1 to \qs}{
 \text{f=\data[2*\i;]}
 \text{g=\f[1]}
 \text{f=wims(sort items \f)}
 \text{g=positionof(\g,\f)}
 \text{good=\good\g,}
 \text{field=\field\f;}
}

\text{pre=\accolade=1 ? wims(embraced randitem \pre)}
\text{post=\accolade=1 ? wims(embraced randitem \post)}
\text{qlist=wims(makelist reply x for x=1 to \qs)}
\steps{\qlist}

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

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

\statement{<div>\explain</div>
  \data[1;]
  \for{k=1 to \qs}{
    \embed{r \k} \data[2*\k+1;]
  }
}

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

\answer{Field 1}{\good[1];\field[1;]}{type=menu}
\answer{Field 2}{\good[2];\field[2;]}{type=menu}
\answer{Field 3}{\good[3];\field[3;]}{type=menu}
\answer{Field 4}{\good[4];\field[4;]}{type=menu}
\answer{Field 5}{\good[5];\field[5;]}{type=menu}
\answer{Field 6}{\good[6];\field[6;]}{type=menu}
\answer{Field 7}{\good[7];\field[7;]}{type=menu}
\answer{Field 8}{\good[8];\field[8;]}{type=menu}
\answer{Field 9}{\good[9];\field[9;]}{type=menu}
\answer{Field 10}{\good[10];\field[10;]}{type=menu}
\answer{Field 11}{\good[11];\field[11;]}{type=menu}
\answer{Field 12}{\good[12];\field[12;]}{type=menu}
\answer{Field 13}{\good[13];\field[13;]}{type=menu}
\answer{Field 14}{\good[14];\field[14;]}{type=menu}
\answer{Field 15}{\good[15];\field[15;]}{type=menu}
\answer{Field 16}{\good[16];\field[16;]}{type=menu}
\answer{Field 17}{\good[17];\field[17;]}{type=menu}
\answer{Field 18}{\good[18];\field[18;]}{type=menu}
\answer{Field 19}{\good[19];\field[19;]}{type=menu}
\answer{Field 20}{\good[20];\field[20;]}{type=menu}