Rev 3996 | Rev 6628 | Go to most recent revision | 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 | |||
38 | !read scripts/check.exo |
||
39 | |||
40 | data1=!nonempty lines $data1 |
||
41 | n1=!linecnt $data1 |
||
42 | !for i=1 to $n1 |
||
43 | l=!line $i of $data1 |
||
44 | l=!translate = to $\ |
||
45 | $ in $l |
||
46 | !distribute lines $l into n_,v_ |
||
47 | exo_$n_=$v_ |
||
48 | !next i |
||
49 | |||
50 | ############################## |
||
51 | #FORMAT of an EXO in an EXAM : |
||
52 | #:WEIGHT |
||
53 | #IDSCHEET.IDEXO,IDSCHEET.IDEXO |
||
54 | #TITLE_EXO |
||
55 | #DEPENDENCES |
||
56 | #autogen |
||
57 | |||
58 | # par defaut, exo_weight est pioche dans la feuille |
||
59 | exo_id=$qsheet.$qexo |
||
60 | # par defaut, exo_title est pioche dans la feuille |
||
61 | !default exo_dependences=$empty |
||
62 | !default exo_autogen=$empty |
||
63 | |||
64 | |||
65 | !appendfile wimshome/log/classes/$qclass/exams/.exam$qexam \ |
||
66 | :$exo_weight\ |
||
67 | $exo_id\ |
||
68 | $exo_title\ |
||
69 | $exo_dependences\ |
||
70 | $exo_autogen\ |
||
3996 | obado | 71 | |
72 | |||
73 | exocnt=!recordcnt wimshome/log/classes/$qclass/exams/.exam$qexam |