Subversion Repositories wimsdev

Rev

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

Rev 15179 Rev 17142
Line 258... Line 258...
258
\integer{cnt_question=items(\data_q)}
258
\integer{cnt_question=items(\data_q)}
259
 
259
 
260
\text{nopaste=\paste issametext no ? slib(utilities/nopaste )}
260
\text{nopaste=\paste issametext no ? slib(utilities/nopaste )}
261
 
261
 
262
\text{style = <style>
262
\text{style = <style>
263
 .enonce{margin-bottom:0}
263
  .enonce{margin-bottom:0}
264
 .qcm_prompt2{margin-top:.5em}
264
  .qcm_prompt2{margin-top:.5em}
265
 img{vertical-align:middle;}
265
  img{vertical-align:middle;}
266
 .q_num, .panel .wims_title{
266
  .q_num, .panel .wims_title{
267
 font-size:120%;font-family:Impact, Charcoal, sans-serif;
267
    font-size:120%;font-family:Impact, Charcoal, sans-serif;
268
 color:#777;
268
    color:#717171;
269
 }
269
  }
270
 .feedback{border:1px dashed grey;padding:.5em;margin-top:.5em;}
270
  .feedback{border:1px dashed grey;padding:.5em;margin-top:.5em;}
271
 .reponse {
271
  .reponse {
272
   margin: 0 1em;
272
    margin: 0 1em;
273
   padding: .5em;
273
    padding: .5em;
274
   border-radius:5px;
274
    border-radius:5px;
275
   \style_reponse
275
    \style_reponse
276
 }
276
  }
277
 .panel{
277
  .panel{
278
    padding:.5em 1em .5em 1em;
278
    padding:.5em 1em .5em 1em;
279
    margin:.5em 0;
279
    margin:.5em 0;
280
    border:1px solid #d8d8d8;
280
    border:1px solid #d8d8d8;
281
    border-radius:5px;
281
    border-radius:5px;
282
    background-color: #f2f2f2;
282
    background-color: #f2f2f2;
283
 }
283
  }
284
 .panel.callout{
284
  .panel.callout{
285
    border-color:#c5e5f3;
285
    border-color:#c5e5f3;
286
    border-width:2px;
286
    border-width:2px;
287
    \style_question
287
    \style_question
288
 }
288
  }
289
 .callout .q_num, .callout .wims_title{color:black;}
289
  .callout .q_num, .callout .wims_title{color:black;}
290
 
290
 
291
 .panel .wims_title, .panel .wimscenter{margin-top:-1.2em;}
291
  .panel .wims_title, .panel .wimscenter{margin-top:-1.2em;}
292
 ol li{margin-bottom: .5em;list-style:upper-alpha;}
292
  ol li{margin-bottom: .5em;list-style:upper-alpha;}
293
 input[type='checkbox'] { font-size:120%; }
293
  input[type='checkbox'] { font-size:120%; }
294
 .strike{text-decoration:line-through;}
294
  .strike{text-decoration:line-through;}
295
 .oef_indpartial{color:navy;}
295
  .oef_indpartial{color:navy;}
296
 </style>
296
</style>
297
}
297
}
298
 
298
 
299
\integer{N = min(\cnt_question,\N)}
299
\integer{N = min(\cnt_question,\N)}
300
\integer{MAX=min(\N*\MAX,\cnt_question)}
300
\integer{MAX=min(\N*\MAX,\cnt_question)}
301
\text{battage=\alea issametext sí ? shuffle(\data_q,,) :\data_q}
301
\text{battage=\alea issametext sí ? shuffle(\data_q,,) :\data_q}
Line 324... Line 324...
324
 \text{preliminaire_test=\QUEST}
324
 \text{preliminaire_test=\QUEST}
325
 \text{preliminaire_test=row(1,\preliminaire_test)}
325
 \text{preliminaire_test=row(1,\preliminaire_test)}
326
 \text{inst_audio=wims(getopt Qaudio in \preliminaire_test)}
326
 \text{inst_audio=wims(getopt Qaudio in \preliminaire_test)}
327
 \text{inst_image=wims(getopt Qimage in \preliminaire_test)}
327
 \text{inst_image=wims(getopt Qimage in \preliminaire_test)}
328
 \text{inst_title=wims(getopt Qtitle in \preliminaire_test)}
328
 \text{inst_title=wims(getopt Qtitle in \preliminaire_test)}
329
 
329
 
330
 \text{rab_inst=}
330
 \text{rab_inst=}
331
 \text{rab_inst=\inst_title notsametext ?\rab_inst <h2 class="wims_title">\inst_title</h2>}
331
 \text{rab_inst=\inst_title notsametext ?\rab_inst <h2 class="wims_title">\inst_title</h2>}
332
 \text{rab_inst=\inst_image notsametext ?\rab_inst <div class="wimscenter"><img src="\imagedir/\inst_image" alt="" /></div>}
332
 \text{rab_inst=\inst_image notsametext ?\rab_inst <div class="wimscenter"><img src="\imagedir/\inst_image" alt="" /></div>}
333
 \if{\inst_audio notsametext }{
333
  \if{\inst_audio notsametext }{
334
     \text{rab_inst1= . isin \inst_audio ?
334
    \text{rab_inst1= . isin \inst_audio ?
335
       <audio controls>
335
      <audio controls>
336
        <source src="\imagedir/\inst_audio" type="audio/mpeg">
336
        <source src="\imagedir/\inst_audio" type="audio/mpeg">
337
        Désolé, votre navigateur est incompatible avec la lecture de fichiers audio.
337
        Désolé, votre navigateur est incompatible avec la lecture de fichiers audio.
338
       </audio>}
338
      </audio>}
339
     \text{rab_inst=\rab_inst <div class="wimscenter audio">\rab_inst1[1;1]</div>}
339
    \text{rab_inst=\rab_inst <div class="wimscenter audio">\rab_inst1[1;1]</div>}
340
 }
340
  }
341
 
341
 
342
 \integer{test_inst=\inst_audio\inst_image\inst_title notsametext ? 1 : 0}
342
 \integer{test_inst=\inst_audio\inst_image\inst_title notsametext ? 1 : 0}
343
 \text{preliminaire=\test_inst=1 ? \rab_inst:&nbsp;}
343
 \text{preliminaire=\test_inst=1 ? \rab_inst:&nbsp;}
344
 \matrix{QUEST=\test_inst=1 ? \QUEST[2..-1;]}
344
 \matrix{QUEST=\test_inst=1 ? \QUEST[2..-1;]}
345
 \matrix{QUEST=\accolade issametext si ?wims(embraced randitem \QUEST):\QUEST}
345
 \matrix{QUEST=\accolade issametext si ?wims(embraced randitem \QUEST):\QUEST}
Line 349... Line 349...
349
\preliminaire}
349
\preliminaire}
350
 
350
 
351
 \text{expl=\QUEST[2;]}
351
 \text{expl=\QUEST[2;]}
352
 \text{ligne=wims(upper \expl)}
352
 \text{ligne=wims(upper \expl)}
353
 \text{ligne=wims(text select ABCDEFGHIJKLMNOPQRSTUVWXYZ in \ligne)}
353
 \text{ligne=wims(text select ABCDEFGHIJKLMNOPQRSTUVWXYZ in \ligne)}
354
 \if{\ligne issametext and \expl notsametext }{
354
  \if{\ligne issametext and \expl notsametext }{
355
  \matrix{explication = \explication;}
355
    \matrix{explication = \explication;}
356
  \integer{debut = 2}
356
    \integer{debut = 2}
357
 }
357
  }
358
 \if{\ligne issametext and \expl issametext }{
358
  \if{\ligne issametext and \expl issametext }{
359
  \matrix{explication = \explication;}
359
    \matrix{explication = \explication;}
360
  \integer{debut = 3}
360
    \integer{debut = 3}
361
  }
361
  }
362
  \if{\ligne notsametext}{
362
  \if{\ligne notsametext}{
363
     \matrix{explication = \explication;\expl}
363
    \matrix{explication = \explication;\expl}
364
  \integer{debut = 3}
364
    \integer{debut = 3}
365
 }
365
  }
366
  \integer{cnt_choix=rows(\QUEST)-\debut}
366
  \integer{cnt_choix=rows(\QUEST)-\debut}
367
  \text{CNT_choix=\CNT_choix,\cnt_choix}
367
  \text{CNT_choix=\CNT_choix,\cnt_choix}
368
   \text{Choix=}
368
  \text{Choix=}
369
   \text{mix=shuffle(\cnt_choix)}
369
  \text{mix=shuffle(\cnt_choix)}
370
   \for{j=\debut+1 to \cnt_choix + \debut+1}{
370
  \for{j=\debut+1 to \cnt_choix + \debut+1}{
371
     \text{choix= \QUEST[\j;]}
371
    \text{choix= \QUEST[\j;]}
372
     \text{choix=wims(replace internal , by  &#44; in \choix)}
372
    \text{choix=wims(replace internal , by  &#44; in \choix)}
373
     \matrix{Choix = \Choix, \choix[1;]}
373
    \matrix{Choix = \Choix, \choix[1;]}
374
   }
374
  }
375
   \text{Choix=wims(nonempty items \Choix)}
375
  \text{Choix=wims(nonempty items \Choix)}
376
   \text{Choix= \Choix[\mix]}
376
  \text{Choix= \Choix[\mix]}
377
   \matrix{CHOIX=\CHOIX
377
  \matrix{CHOIX=\CHOIX
378
     \Choix}
378
     \Choix}
379
   \text{H = wims(nospace \QUEST[\debut;])}
379
  \text{H = wims(nospace \QUEST[\debut;])}
380
   \text{cnt_c=items(\H)}
380
  \text{cnt_c=items(\H)}
381
   \text{Rep = }
381
  \text{Rep = }
382
   \for{ k = 1 to \cnt_c}{
382
  \for{ k = 1 to \cnt_c}{
383
     \text{Rep = \Rep, position(\H[\k],\mix)}
383
    \text{Rep = \Rep, position(\H[\k],\mix)}
384
   }
384
  }
385
   \text{Rep = wims(sort items wims(nonempty items \Rep))}
385
  \text{Rep = wims(sort items wims(nonempty items \Rep))}
386
   \matrix{rep = \rep
386
  \matrix{rep = \rep
387
    \Rep}
387
    \Rep}
388
}
388
}
389
 
389
 
390
\text{CNT_choix=wims(nonempty items \CNT_choix)}
390
\text{CNT_choix=wims(nonempty items \CNT_choix)}
391
 
391
 
Line 393... Line 393...
393
\integer{cnt_step = \U[1] + 1}
393
\integer{cnt_step = \U[1] + 1}
394
\matrix{STEPS = }
394
\matrix{STEPS = }
395
\matrix{CNT = }
395
\matrix{CNT = }
396
\text{CONDSTEP=}
396
\text{CONDSTEP=}
397
\for{ u = 1 to \cnt_step -1}{
397
\for{ u = 1 to \cnt_step -1}{
398
   \matrix{STEPS =\STEPS
398
  \matrix{STEPS =\STEPS
399
wims(makelist r x for x = \N*\u -\N+1 to \N*\u)}
399
wims(makelist r x for x = \N*\u -\N+1 to \N*\u)}
400
   \matrix{CNT =\CNT
400
  \matrix{CNT =\CNT
401
wims(makelist x for x = \N*\u -\N+1 to \N*\u)}
401
wims(makelist x for x = \N*\u -\N+1 to \N*\u)}
402
   \text{condstep= wims(values \u+1 for x = (\u-1)*\N +1 to \u*\N)}
402
  \text{condstep= wims(values \u+1 for x = (\u-1)*\N +1 to \u*\N)}
403
   \text{CONDSTEP= wims(append item \condstep to \CONDSTEP)}
403
  \text{CONDSTEP= wims(append item \condstep to \CONDSTEP)}
404
}
404
}
405
 \matrix{STEPS = \STEPS
405
\matrix{STEPS = \STEPS
406
 wims(makelist r x for x = \N*\cnt_step-\N+1 to \MAX)
406
 wims(makelist r x for x = \N*\cnt_step-\N+1 to \MAX)
407
}
407
}
408
\matrix{CNT = \CNT
408
\matrix{CNT = \CNT
409
 wims(makelist x for x = \N*\cnt_step-\N+1 to \MAX)
409
 wims(makelist x for x = \N*\cnt_step-\N+1 to \MAX)
410
}
410
}
Line 447... Line 447...
447
 
447
 
448
  \for{h=1 to \etape[\step]}{
448
  \for{h=1 to \etape[\step]}{
449
 
449
 
450
    \if{\question[\h;] notsametext }{
450
    \if{\question[\h;] notsametext }{
451
      \if{\h <= \etape[\step] - \N}
451
      \if{\h <= \etape[\step] - \N}
452
        {<div class="panel">}
452
        {<fieldset class="panel">}
453
        {\if{r \h isitemof \nstep}{<div class="panel callout">}}
453
        {\if{r \h isitemof \nstep}{<fieldset class="panel callout">}}
454
      }
454
      }
455
 
455
 
456
   \if{(\h <= \etape[\step] - \N or r \h isitemof \nstep) and \question[\h;] notsametext }{
456
   \if{(\h <= \etape[\step] - \N or r \h isitemof \nstep) and \question[\h;] notsametext }{
457
     <div class="enonce">
457
     <div class="enonce">
458
       \if{\cnt_step > 1 and \MAX > 1}{<span class="q_num">\h. </span>}
458
       \if{\cnt_step > 1 and \MAX > 1}{<span class="q_num">\h. </span>}
Line 502... Line 502...
502
        </ol>
502
        </ol>
503
      </div>
503
      </div>
504
      }
504
      }
505
   }
505
   }
506
   \if{\question[\h;] notsametext
506
   \if{\question[\h;] notsametext
507
    and (\h <= \etape[\step] - \N or r \h isitemof \nstep)}{</div>}
507
    and (\h <= \etape[\step] - \N or r \h isitemof \nstep)}{</fieldset>}
508
  }
508
  }
509
 }
509
 }
510
\answer{}{\REP1;\CHOIX[1;]}{type=\format}{option=\option}
510
\answer{}{\REP1;\CHOIX[1;]}{type=\format}{option=\option}
511
\answer{}{\REP2;\CHOIX[2;]}{type=\format}{option=\option}
511
\answer{}{\REP2;\CHOIX[2;]}{type=\format}{option=\option}
512
\answer{}{\REP3;\CHOIX[3;]}{type=\format}{option=\option}
512
\answer{}{\REP3;\CHOIX[3;]}{type=\format}{option=\option}