Subversion Repositories wimsdev

Rev

Rev 11375 | Rev 11544 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11375 bpr 1
type=question first
23 reyssat 2
textarea="datatrue datafalse explain"
8515 obado 3
asis="datatrue datafalse explain"
23 reyssat 4
 
4135 bpr 5
:A multiple choice exercise with random permutation.
23 reyssat 6
 
4135 bpr 7
A standard multiple choice exercise; The answers as well as their order may be randomized.
8515 obado 8
<p>Author of the model: Gang Xiao <qualite@wimsedu.info></p>
23 reyssat 9
 
10
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
11
 
4135 bpr 12
Remove the above header if you destroy the model tags i.e. the lines starting
13
with a ':'. Otherwise the exercise might not be recognised by Createxo.
23 reyssat 14
 
15
:%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%%
16
 
17
:\title{Multiple choice}
5147 bpr 18
:\author{XIAO, Gang}
8002 bpr 19
:\email{qualite@wimsedu.info}
5724 bpr 20
:\credits{}
23 reyssat 21
 
4135 bpr 22
:Maximum 10 possible answers will be shown to the learner at a time.
23
It is recommended that you provide a large number of possible answers for the exercise ,
24
otherwise the exercise will only show
23 reyssat 25
what is available.
26
\integer{tot=5}
27
 
4135 bpr 28
:The number of correct answers in each exercise must not exceed the total.
23 reyssat 29
\integer{givetrue=2}
30
 
4135 bpr 31
:Number of "mandatory" wrong answers.
32
For example if this number is 2, the first two wrong answers in the list will
23 reyssat 33
always be presented in the generated exercise.
34
<p> If doubtful, put 0.
35
\integer{minfalse=0}
36
 
37
:Text that explains what should be done.
38
$embraced_randitem
8515 obado 39
\text{explain=<p>Here is a model of multiple choice exercise. The answers are presented in random order.
40
Change the text here below to make your own multiple choice exercise.</p>
4135 bpr 41
Select the correct answer.
42
When there are several correct answers, you can select any of them.
23 reyssat 43
}
44
 
4135 bpr 45
:The correct answers - write one per line.
46
You can write several here (one per line) for random pickup.
47
Avoid very long sentences! No semi-colons are allowed in the sentence.
23 reyssat 48
$embraced_randitem
49
\matrix{datatrue=
4135 bpr 50
First correct answer.
51
Second correct answer.
52
Third correct answer.
53
Fourth correct answer.
23 reyssat 54
}
55
 
4135 bpr 56
:The  wrong answers -write one per line.
57
You can write several here (one per line) for random pickup.
58
Avoid very long sentences! No semi-colons are allowed in the sentence.
23 reyssat 59
$embraced_randitem
60
\matrix{datafalse=
4135 bpr 61
First wrong answer.
62
Second wrong answer.
63
Third wrong answer.
64
Fourth wrong answer.
65
Fifth wrong answer.
66
Sixth wrong answer.
67
Seventh wrong answer.
68
Eighth wrong answer.
23 reyssat 69
}
70
 
4135 bpr 71
:Optional words: "checkbox", "split".
72
Add the word "checkbox" if there are several correct answers and if the student
73
must seelct all of them (instead of just any one). If you authorise a partial score
74
for when only part of the correct answers have been selected, enter the word 'split'.
75
 
23 reyssat 76
\text{option=}
77
 
8512 bpr 78
:Feedback Général
79
Ce texte s'affichera après la réponse de l'apprenant, qu'elle soit juste ou fausse.
80
\text{feedback_general=}
23 reyssat 81
 
8512 bpr 82
:Feedback en cas de bonne réponse
83
Ce texte s'affichera après la réponse de l'apprenant, en cas de bonne reponse ou de reponse partielle.
84
\text{feedback_bon=}
85
 
86
:Feedback en cas de mauvaise réponse
87
Ce texte s'affichera après la réponse de l'apprenant, s'il a coché au moins une mauvaise réponse.
88
\text{feedback_mauvais=}
89
 
90
:Mise en aléatoire par des accolades emboitables
91
$embraced_randitem
92
\text{accolade=item(1,1 oui,
93
2 non)}
94
 
95
 
9980 obado 96
:%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%%
8512 bpr 97
\text{accolade=wims(word 1 of \accolade)}
98
 
99
\text{empty=}
100
\if{\feedback_general != \empty}{
101
  \text{feedback_general=<p class="feedback">\feedback_general</p>}
102
}
103
\if{\feedback_bon != \empty}{
104
  \text{feedback_bon=<p class="feedback good_answer">\feedback_bon</p>}
105
}
106
\if{\feedback_mauvais != \empty}{
107
  \text{feedback_mauvais=<p class="feedback bad_answer">\feedback_mauvais</p>}
108
}
109
 
23 reyssat 110
\text{datatrue=wims(nonempty rows \datatrue)}
111
\text{datafalse=wims(nonempty rows \datafalse)}
112
\integer{truecnt=rows(\datatrue)}
113
\integer{falsecnt=rows(\datafalse)}
114
\integer{givetrue=\givetrue<1?1}
115
\integer{givetrue=\givetrue>\truecnt?\truecnt}
116
\integer{tot=\tot > \falsecnt+\givetrue?\falsecnt+\givetrue}
117
\integer{givetrue=\givetrue>\tot-1?\tot-1}
118
\integer{minfalse=\minfalse>\tot-\givetrue?\tot-\givetrue}
119
\text{tsh=shuffle(\truecnt)}
120
\text{true=row(\tsh,\datatrue)}
121
\if{\minfalse>0}{
122
 \text{false1=row(1..\minfalse,\datafalse);}
123
 \text{false2=row(\minfalse+1..\falsecnt,\datafalse)}
124
}{
125
 \integer{minfalse=0}
126
 \text{false1=}
127
 \text{false2=\datafalse}
128
}
129
\text{fsh=shuffle(\falsecnt)}
130
\text{false2=row(\fsh,\false2)}
131
\text{pick=row(1..\givetrue,\true);\false1 row(1..\tot-\givetrue-\minfalse,\false2)}
132
\text{ind=wims(makelist 1 for x=1 to \givetrue),wims(makelist 0 for x=1 to \tot-\givetrue)}
133
 
134
\text{sh=shuffle(\tot)}
135
\text{ind=item(\sh,\ind)}
136
\text{pick=row(\sh,\pick)}
8512 bpr 137
\text{pick=\accolade=1 ? wims(embraced randitem \pick)}
138
\text{explain=\accolade=1 ? wims(embraced randitem \explain)}
23 reyssat 139
\text{ans=positionof(1,\ind)}
140
\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)}
141
\text{anstype=checkbox iswordof \option?checkbox:radio}
142
 
143
:%%%%%%%%%%%%% Now the statement in html. %%%%%%%%%%%%%%%%%%%%
144
 
145
::You don't need to modify this in general.
146
 
1362 obado 147
\statement{
9924 obado 148
  <div class="oef_explain">\explain</div>
149
  \for{i=1 to \tot}
11491 bpr 150
  {<p class="oefreply">\embed{reply 1,\i, \list[\i] : \pick[\i;]}</p>}
23 reyssat 151
}
152
 
11491 bpr 153
:%%%%%%%%%%%%% Rien à modifier ci-après. %%%%%%%%%%%%%%%%%5
23 reyssat 154
 
155
\answer{The reply}{\ans;\list}{type=\anstype}{option=\option}
156
 
8512 bpr 157
\feedback{1=1}{\feedback_general}
158
\feedback{\reply1 isitemof \list[\ans]}{\feedback_bon}
159
\feedback{\reply1 notitemof \list[\ans]}{\feedback_mauvais}