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