Rev 6628 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4561 | obado | 1 | # LinkExo |
2 | # Ajoute l'exercice qexo de la feuille qsheet a l'examen qexam de la classe qclass |
||
3261 | obado | 3 | |
4561 | obado | 4 | #Pour commencer, on verifie la classe |
5 | !read scripts/check.class |
||
6 | !if $error!=$empty |
||
7 | !exit |
||
8 | !endif |
||
9 | |||
10 | #ensuite, on verifie que la feuille $qsheet existe. |
||
3261 | obado | 11 | type=sheets |
12 | !read scripts/check.proc |
||
13 | !if $error!=$empty |
||
14 | !exit |
||
15 | !endif |
||
16 | |||
17 | #On verifie que la feuille n'est pas "EN PREPARATION" |
||
18 | sheet_status=!line 1 of $qproperties |
||
19 | !ifval $sheet_status <1 |
||
20 | error=sheet $qsheet must be active |
||
21 | !exit |
||
22 | !endif |
||
23 | |||
24 | #Ensuite, on verifie que l'examen $qexam existe. |
||
25 | type=exams |
||
26 | !read scripts/check.proc |
||
27 | !if $error!=$empty |
||
28 | !exit |
||
29 | !endif |
||
30 | |||
31 | #On verifie que l'examen n'est pas "Actif" |
||
32 | exam_status=!line 1 of $qproperties |
||
33 | !ifval $exam_status >0 |
||
34 | error=exam $qexam mustn't be active |
||
35 | !exit |
||
36 | !endif |
||
37 | |||
6628 | obado | 38 | exocnt=!recordcnt wimshome/log/classes/$qclass/exams/.exam$qexam |
9963 | obado | 39 | !if $exocnt >= $MAX_EXOS |
40 | error=Sorry, an exam is limited to $MAX_EXOS exercises. |
||
6628 | obado | 41 | !exit |
42 | !endif |
||
43 | |||
3261 | obado | 44 | !read scripts/check.exo |
45 | |||
46 | data1=!nonempty lines $data1 |
||
47 | n1=!linecnt $data1 |
||
48 | !for i=1 to $n1 |
||
49 | l=!line $i of $data1 |
||
50 | l=!translate = to $\ |
||
51 | $ in $l |
||
52 | !distribute lines $l into n_,v_ |
||
53 | exo_$n_=$v_ |
||
54 | !next i |
||
55 | |||
56 | ############################## |
||
57 | #FORMAT of an EXO in an EXAM : |
||
58 | #:WEIGHT |
||
59 | #IDSCHEET.IDEXO,IDSCHEET.IDEXO |
||
60 | #TITLE_EXO |
||
61 | #DEPENDENCES |
||
62 | #autogen |
||
63 | |||
64 | # par defaut, exo_weight est pioche dans la feuille |
||
65 | exo_id=$qsheet.$qexo |
||
66 | # par defaut, exo_title est pioche dans la feuille |
||
67 | !default exo_dependences=$empty |
||
68 | !default exo_autogen=$empty |
||
69 | |||
70 | |||
71 | !appendfile wimshome/log/classes/$qclass/exams/.exam$qexam \ |
||
72 | :$exo_weight\ |
||
73 | $exo_id\ |
||
74 | $exo_title\ |
||
75 | $exo_dependences\ |
||
76 | $exo_autogen\ |
||
3996 | obado | 77 | |
78 | |||
79 | exocnt=!recordcnt wimshome/log/classes/$qclass/exams/.exam$qexam |