Rev 14334 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8817 | guerimand | 1 | !if $step=$empty |
2 | step=1 |
||
3 | !endif |
||
4 | |||
5 | max_exos=!defof MAX_EXOS in wimshome/public_html/bases/sys/define.conf |
||
6 | max_sheets=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf |
||
7 | title_limit=50 |
||
8 | desc_limit=255 |
||
9 | |||
10 | !if $scoring=yes |
||
12315 | bpr | 11 | !default require=10 |
12 | !default weight=1 |
||
8817 | guerimand | 13 | !else |
12315 | bpr | 14 | require=0 |
15 | weight=0 |
||
8817 | guerimand | 16 | !endif |
17 | |||
18 | !if $step=1 |
||
12315 | bpr | 19 | sheets= |
20 | !for i=1 to $sheettot |
||
21 | sh=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets |
||
22 | !distribute lines $sh into a_,t_,title |
||
23 | !if $a_<1 |
||
24 | sheets=!append line $i,$title to $sheets |
||
25 | !endif |
||
26 | !next i |
||
27 | sheetcnt=!linecnt $sheets |
||
28 | !ifval $sheetcnt=0 |
||
29 | error=no_sheet |
||
30 | !exit |
||
8817 | guerimand | 31 | !endif |
12315 | bpr | 32 | special_parm2=expert |
33 | smodule=$dir |
||
34 | !distribute line $wims_oefdefault_qnum\ |
||
8817 | guerimand | 35 | $wims_oefdefault_qcmlevel\ |
36 | $wims_oefdefault_scoredelay\ |
||
37 | $wims_oefdefault_qcmpresent\ |
||
13082 | bpr | 38 | $wims_oefdefault_sol\ |
9108 | bpr | 39 | $wims_oefdefault_check\ |
13082 | bpr | 40 | $wims_oefdefault_expow\ |
41 | $wims_oefdefault_sepow\ |
||
42 | $wims_oefdefault_precw\ |
||
43 | $wims_oefdefault_feed\ |
||
44 | $wims_oefdefault_good\ |
||
45 | $wims_oefdefault_hint\ |
||
46 | into qnum,qcmlevel,scoredelay,intro_qcmpresent,intro_sol,intro_check,\ |
||
47 | intro_expow,intro_sepow,intro_precw,intro_feed,intro_good,intro_hint |
||
8817 | guerimand | 48 | !endif |
49 | |||
9436 | bpr | 50 | !! calcul du nombre d'exercices |
9174 | guerimand | 51 | !if /////classes/ isin /////$smodule |
52 | !! adresse du module d'exo d'une classe |
||
12315 | bpr | 53 | dir_header=wimshome/log/classes/$wims_class |
9174 | guerimand | 54 | !else |
55 | !! adresse d'un module public ou modtool |
||
12315 | bpr | 56 | dir_header=wimshome/public_html/modules/$smodule |
9174 | guerimand | 57 | !endif |
58 | exolist=!defof exolist in $dir_header/Exindex |
||
8817 | guerimand | 59 | exolist=!char 17 to -2 of $exolist |
18630 | czzmrn | 60 | exotitle=!defof titlelist_$lang in $dir_header/Exindex |
61 | !default exotitle=!defof titlelist in $dir_header/Exindex |
||
8817 | guerimand | 62 | exotitle=!char 17 to -2 of $exotitle |
63 | exocnt=!itemcnt $exolist |
||
64 | |||
65 | !if $step=2 |
||
9106 | bpr | 66 | !! vérification des données de feuille. |
12315 | bpr | 67 | !if $picksheet=$empty |
68 | error=no_pick |
||
69 | !exit |
||
8817 | guerimand | 70 | !endif |
12315 | bpr | 71 | picksheet=$[floor($picksheet)] |
72 | !if $picksheet=NaN or $picksheet<1 or $picksheet>min($max_sheets,$sheettot) |
||
73 | error=bad_sheet |
||
74 | !exit |
||
8817 | guerimand | 75 | !endif |
12315 | bpr | 76 | sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets |
77 | a=!line 1 of $sh |
||
78 | !if $a>0 |
||
79 | error=bad_sheet |
||
80 | !exit |
||
81 | !endif |
||
82 | shexocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
83 | !if $exocnt+$shexocnt>$max_exos |
||
84 | error=too_many_exos |
||
85 | !exit |
||
86 | !endif |
||
87 | !if $scoring=yes |
||
88 | require=$[$require] |
||
89 | weight=$[$weight] |
||
90 | !if NaN isin $require |
||
91 | require=0 |
||
92 | !endif |
||
93 | !if NaN isin $weight |
||
94 | weight=0 |
||
95 | !endif |
||
96 | !bound require between 0 and $[10*$require_limit] default 0 |
||
97 | !bound weight between 0 and 10 default 0 |
||
98 | !endif |
||
9108 | bpr | 99 | !! vérification des donnees d'execution du module d'exo |
12315 | bpr | 100 | test_transl=!module translation_language $dir |
101 | !if $lang iswordof $test_transl |
||
102 | tr_lang=yes |
||
103 | title=!module title_$lang $dir |
||
104 | desc=!module description_$lang $dir |
||
105 | !endif |
||
106 | !default title=!module title $dir |
||
107 | !default desc=!module description $dir |
||
108 | desc_module=$desc |
||
109 | cat=!module category $dir |
||
110 | !if exercise notin $cat and oef notin $cat |
||
111 | error=not_exo |
||
112 | !exit |
||
113 | !endif |
||
114 | !bound qnum between integer 1 and 9 default $wims_oefdefault_qnum |
||
115 | !bound qcmlevel between integer 1 and 9 default $wims_oefdefault_qcmlevel |
||
116 | !bound intro_qcmpresent between integer 2 and 8 default $wims_oefdefault_qcmpresent |
||
117 | !bound intro_presentsol between integer 0 and 2 default $wims_oefdefault_presentsol |
||
118 | !bound intro_expow between 1 and 6 default $wims_oefdefault_expow |
||
119 | !bound intro_sepow between 1 and 6 default $wims_oefdefault_sepow |
||
120 | !bound intro_precw between 0 and 1 default $wims_oefdefault_precw |
||
9108 | bpr | 121 | |
13082 | bpr | 122 | intro_check=!listintersect $intro_check and 1,2 |
12315 | bpr | 123 | !bound random within 0,1 default 0 |
124 | !if $scoredelay!=$empty and $scoredelay!=0 |
||
125 | d_=!items2words $scoredelay |
||
126 | !distribute words $d_ into delay1,delay2 |
||
127 | !bound delay1 between integer 0 and 2000 default 0 |
||
128 | !bound delay2 between integer $delay1 and 2000 |
||
129 | scoredelay=$delay1,$delay2 |
||
9108 | bpr | 130 | !endif |
13082 | bpr | 131 | |
12315 | bpr | 132 | iniparm=$empty |
133 | !if $expert_=yes |
||
134 | !if $intro_check!=$empty |
||
14334 | bpr | 135 | !for k in $intro_check |
136 | iniparm=$(iniparm)&intro_check=$k |
||
12315 | bpr | 137 | !next k |
138 | !endif |
||
13082 | bpr | 139 | !for c in expow,sepow,precw,sol,hint,good,feed,qcmpresent |
140 | iniparm=$(iniparm)&intro_$c=$(intro_$c) |
||
141 | !next |
||
12315 | bpr | 142 | !endif |
13082 | bpr | 143 | iniparm=qnum=$qnum&qcmlevel=$qcmlevel&scoredelay=$scoredelay&seedrepeat=$seedrepeat$iniparm |
144 | |||
12489 | bpr | 145 | !! ------ write data in the sheet file. |
146 | !! analyse series already in the sheet |
||
12315 | bpr | 147 | listmod=$empty |
148 | listiniparm=$empty |
||
149 | !for i=1 to $shexocnt |
||
150 | e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
151 | !distribute lines $e into wdi,win |
||
14334 | bpr | 152 | listmod=!append line $wdi to $listmod |
12315 | bpr | 153 | listiniparm=!append line $win to $listiniparm |
154 | !next i |
||
155 | !! Ecriture |
||
156 | writedon=$empty |
||
157 | listalready=$empty |
||
158 | !for j=1 to $exocnt |
||
159 | ex=!item $j of $exolist |
||
160 | lerror=0 |
||
161 | exoiniparm=exo=$ex&$iniparm |
||
162 | !for i=1 to $shexocnt |
||
14334 | bpr | 163 | wdi=!line $i of $listmod |
164 | win=!line $i of $listiniparm |
||
165 | !if $smodule=$wdi and $exoiniparm=$win |
||
166 | lerror=1 |
||
167 | !endif |
||
168 | !next i |
||
12315 | bpr | 169 | !if $lerror=1 |
14334 | bpr | 170 | listalready=!append item $ex to $listalready |
12315 | bpr | 171 | !else |
172 | !reset desc |
||
18630 | czzmrn | 173 | !! Descindex is only available in the main language of the module |
12315 | bpr | 174 | desc_=!lookup $ex in wimshome/public_html/modules/$smodule/Descindex |
175 | !if $desc_!=$empty |
||
176 | desc=$desc_ |
||
177 | !endif |
||
178 | !default desc=$desc_module |
||
179 | obs_=!lookup $ex in wimshome/public_html/modules/$smodule/Obsindex |
||
14334 | bpr | 180 | writedon=!append line :$smodule\ |
8817 | guerimand | 181 | $exoiniparm\ |
182 | $require\ |
||
183 | $weight\ |
||
184 | $(exotitle[$j])\ |
||
185 | $desc\ |
||
9436 | bpr | 186 | \ |
187 | $obs_\ |
||
8817 | guerimand | 188 | to $writedon |
12315 | bpr | 189 | !endif |
190 | !next j |
||
191 | !if $writedon!=$empty |
||
192 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$picksheet $writedon |
||
193 | !endif |
||
194 | last=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
195 | notadd=!itemcnt $listalready |
||
196 | addexo=$[$exocnt-$notadd] |
||
197 | wims_module_log=class $class: add No$[$last-$addexo+1] to No$last to worksheet $picksheet |
||
198 | sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets |
||
199 | title=!line 3 of $sh |
||
8817 | guerimand | 200 | !endif |