Rev 9963 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4561 | obado | 1 | # LinkSheet |
2 | # Ajoute tous les exercices de la feuille qsheet a l'examen qexam de la classe qclass |
||
3 | |||
14384 | obado | 4 | # Pour commencer, on verifie la classe |
4561 | obado | 5 | !read scripts/check.class |
6 | !if $error!=$empty |
||
14384 | obado | 7 | !exit |
4561 | obado | 8 | !endif |
9 | |||
14384 | obado | 10 | # Ensuite, on verifie que la feuille $qsheet existe. |
4561 | obado | 11 | type=sheets |
12 | !read scripts/check.proc |
||
13 | !if $error!=$empty |
||
14384 | obado | 14 | !exit |
4561 | obado | 15 | !endif |
16 | |||
14384 | obado | 17 | # On verifie que la feuille n'est pas "EN PREPARATION" |
4561 | obado | 18 | sheet_status=!line 1 of $qproperties |
19 | !ifval $sheet_status <1 |
||
14384 | obado | 20 | error=sheet $qsheet must be active |
21 | !exit |
||
4561 | obado | 22 | !endif |
23 | |||
14384 | obado | 24 | # On enregistre le nombre d'exercices qu'elle contient. |
4561 | obado | 25 | exocnt=!recordcnt $qfile |
26 | |||
14384 | obado | 27 | # Ensuite, on verifie que l'examen $qexam existe. |
4561 | obado | 28 | type=exams |
29 | !read scripts/check.proc |
||
30 | !if $error!=$empty |
||
14384 | obado | 31 | !exit |
4561 | obado | 32 | !endif |
33 | |||
14384 | obado | 34 | # On verifie que l'examen n'est pas "Actif" |
4561 | obado | 35 | exam_status=!line 1 of $qproperties |
36 | !ifval $exam_status >0 |
||
14384 | obado | 37 | error=exam $qexam mustn't be active |
38 | !exit |
||
4561 | obado | 39 | !endif |
40 | |||
41 | !default exo_dependences=$empty |
||
42 | !default exo_autogen=$empty |
||
43 | |||
9963 | obado | 44 | exocnt = $[min($exocnt,$MAX_EXOS)] |
6628 | obado | 45 | |
4561 | obado | 46 | !for qexo=1 to $exocnt |
14384 | obado | 47 | # On boucle sur chaque exercice de la feuille |
4561 | obado | 48 | !read scripts/check.exo |
49 | exo_id=$qsheet.$qexo |
||
50 | !appendfile wimshome/log/classes/$qclass/exams/.exam$qexam \ |
||
51 | :$exo_weight\ |
||
52 | $exo_id\ |
||
53 | $exo_title\ |
||
54 | $exo_dependences\ |
||
55 | $exo_autogen\ |
||
56 | |||
57 | !next qexo |
||
58 | |||
59 | qexo=ALL |
||
14384 | obado | 60 | exocnt=!recordcnt wimshome/log/classes/$qclass/exams/.exam$qexam |