Subversion Repositories wimsdev

Rev

Rev 14972 | Rev 17347 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14972 Rev 15209
Line 152... Line 152...
152
use <span class="tt">#</span> as a character comment.
152
use <span class="tt">#</span> as a character comment.
153
</div>
153
</div>
154
 
154
 
155
 
155
 
156
<h3>Exercise environment</h3>
156
<h3>Exercise environment</h3>
-
 
157
<h4>Debug variable</h4>
157
A special variable <span class="tt wims_code_variable">\oefenv</span> can be used to test the environment of
158
A special variable <span class="tt wims_code_variable">\oefenv</span> can be used to test the environment of
158
an exercise (if it is not redefined within the exercise).
159
an exercise (if it is not redefined within the exercise).
159
<p>
160
<p>
160
For the time being, the only testable content of the variable is the word
161
For the time being, the only testable content of the variable is the word
161
``debug''. This word appears within <span class="tt wims_code_variable">\oefenv</span> in the following
162
<span class="tt wims_code_variable">debug</span>. This word appears within <span class="tt wims_code_variable">\oefenv</span> in the following
162
situations:
163
situations:
163
</p><ol>
164
</p><ol>
164
<li>When it is executed within Createxo.</li>
165
<li>When it is executed within Createxo.</li>
165
<li>When it is under test in Modtool, by the developer himself.</li>
166
<li>When it is under test in Modtool, by the developer himself.</li>
166
<li>When it is a class exercise and is executed by the supervisor.</li>
167
<li>When it is a class exercise and is executed by the supervisor.</li>
Line 174... Line 175...
174
<pre>
175
<pre>
175
\if{debug iswordof \oefenv}{debugging informations to add into}
176
\if{debug iswordof \oefenv}{debugging informations to add into}
176
</pre>
177
</pre>
177
These debugging informations will be automatically shown when the exercise
178
These debugging informations will be automatically shown when the exercise
178
is under test, and automatically hidden when students work on it.
179
is under test, and automatically hidden when students work on it.
-
 
180
 
-
 
181
<h4>Autres variables</h4>
-
 
182
Deux autres variables d'environnement sont prédéfinies :
-
 
183
<span class="tt wims_code_variable">lang</span>
-
 
184
et <span class="tt wims_code_variable">presentgood</span>.
-
 
185
On peut récupérer leur valeur à l'aide de la slib <span class="tt wims_code"> oef/env</span>.
-
 
186
<p>
-
 
187
La variable <span class="tt wims_code_variable">lang</span> peut être utilisée
-
 
188
pour l'internationalisation des modules.
-
 
189
</p><div>
-
 
190
La variable  <span class="tt wims_code_variable">presentgood</span>  permet de tenir compte,
-
 
191
dans la présentation des textes d'un exercice, de la valeur que l'utilisateur choisira
-
 
192
pour le paramétrage "Afficher la bonne réponse" proposé dans l'introduction d'un module oef.
-
 
193
Cette variable vaut 0 lorsque la bonne réponse ne doit pas être affichée et 1 sinon.
-
 
194
 
-
 
195
Pour l'utiliser, écrire avant le <span class="tt wims_code_variable">\statement</span>
-
 
196
<pre>
-
 
197
\text{presentgood=}
-
 
198
</pre>
-
 
199
et après le <span class="tt wims_code_variable">\statement</span>
-
 
200
<pre>
-
 
201
\text{presentgood=slib(oef/env presentgood)}
-
 
202
</pre>
-
 
203
Il est alors possible de tester la valeur de cette variable
-
 
204
et d'afficher des textes différents selon sa valeur.
-
 
205
Attention, sa valeur est vide lors de l'affichage du premier "écran" de l'exercice,
-
 
206
puisqu'elle n'est utile que pour l'affichage de textes analysant la réponse
-
 
207
de l'élève.
-
 
208
</div>
-
 
209