Rev 12520 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10176 | bpr | 1 | !!@#language independant |
5181 | guerimand | 2 | !read adm/language lang/names.phtml |
3697 | bpr | 3 | |
2544 | bpr | 4 | !read tabletheme |
2740 | bpr | 5 | !!!for the moment no language version, because only one example module |
6 | !set example_dir=lang/example.fr |
||
2544 | bpr | 7 | wims_prefix=class user tmp |
8 | !if robot isin $session |
||
9 | !exit |
||
10 | !endif |
||
11 | |||
12 | !readproc auth |
||
14218 | bpr | 13 | !if $wims_developer=$empty |
14 | !exit |
||
15 | !endif |
||
2544 | bpr | 16 | sesdir=!translate internal _ to $ $ in $wims_sesdir |
17 | sesdir=!word 1 of $sesdir |
||
4318 | bpr | 18 | !default author=!words2items $wims_name |
4686 | bpr | 19 | author=!nonempty items $author |
10432 | bpr | 20 | !default email=$wims_devemail |
2544 | bpr | 21 | !if $cmd iswordof reply new resume renew |
14218 | bpr | 22 | error= |
23 | dossier=type |
||
24 | !if $example=0 or $example= |
||
25 | !if $debut=1 |
||
26 | !reset mtype N M source |
||
27 | compute=no |
||
28 | !else |
||
29 | !for a in title,author,email,file,source |
||
30 | !if $($a)=$empty |
||
31 | error= $error $a |
||
32 | !endif |
||
33 | !next |
||
34 | compute=yes |
||
35 | !endif |
||
36 | !else |
||
37 | !for a in type_exo,title,author,email,file,N,MAX1,M,try,\ |
||
3776 | bpr | 38 | instruction,instruction2,answer_given,alea,choice,format,format0,\ |
2544 | bpr | 39 | percent,pos_rep,common,second_step,first_step,\ |
40 | file, reading_file, audio_file,image_file,video_file,size,source,\ |
||
41 | style_question,style_reponse,style_oef,style_css,\ |
||
42 | reading_tag,image_tag,video_tag,qcm_prompt1,qcm_prompt2,\ |
||
43 | sens,aucune,raw,partialscore,paste,specialhelp1,specialhelp2,\ |
||
3693 | bpr | 44 | specialhelp3,specialhelp4,helpprompt,reaccent,packs,player,player_option,\ |
2544 | bpr | 45 | good_answer_text,bad_answer_text,incomplete_answer_text,\ |
10176 | bpr | 46 | |
14218 | bpr | 47 | $(a) =!getdef $a in $example_dir/$TYPE/$example |
48 | !next |
||
12520 | bpr | 49 | !if $type_exo iswordof CORRESP |
14218 | bpr | 50 | taille_corr=$size |
12520 | bpr | 51 | !endif |
52 | !if $type_exo iswordof ORDONNE \ |
||
14218 | bpr | 53 | or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill)) |
54 | taille_drag=$size |
||
12520 | bpr | 55 | !endif |
56 | !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case |
||
14218 | bpr | 57 | taille_case=$size |
12520 | bpr | 58 | !endif |
59 | !if $type_exo iswordof COMPOSE |
||
14218 | bpr | 60 | taille_compose=$size |
12520 | bpr | 61 | !endif |
2544 | bpr | 62 | |
12520 | bpr | 63 | !if $type_exo iswordof TRUEFALSE |
14218 | bpr | 64 | choice_tf=$choice |
12520 | bpr | 65 | !endif |
66 | !if $type_exo iswordof GAP |
||
14218 | bpr | 67 | choice_gap=$choice |
12520 | bpr | 68 | !endif |
69 | !if $type_exo iswordof QUIFAITQUOI |
||
14218 | bpr | 70 | choice_qq=$choice |
12520 | bpr | 71 | !endif |
72 | !if $type_exo iswordof QCMIII |
||
14218 | bpr | 73 | choice_fd=$choice |
12520 | bpr | 74 | !endif |
2544 | bpr | 75 | |
14218 | bpr | 76 | !for a in reading,audio,image,video |
77 | !if $($(a)_file) notsametext no and $($(a)_file)!=$empty |
||
78 | $(a)_file0=$($(a)_file) |
||
79 | $(a)_file1=yes |
||
10176 | bpr | 80 | !else |
14218 | bpr | 81 | $(a)_file1=no |
2544 | bpr | 82 | !endif |
12520 | bpr | 83 | !next |
14218 | bpr | 84 | compute=no |
85 | example= |
||
86 | |||
87 | !endif example |
||
88 | !readproc values |
||
89 | !if $N issametext all |
||
90 | N=\cnt_question |
||
91 | !endif |
||
92 | !if $MAX1 issametext all or $MAX1= |
||
93 | MAX = \cnt_question |
||
94 | !else |
||
95 | MAX=$MAX1 |
||
96 | !endif |
||
97 | !if $type_exo iswordof CORRESP |
||
98 | size=$taille_corr |
||
99 | !endif |
||
100 | !if $type_exo iswordof ORDONNE \ |
||
101 | or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill)) |
||
102 | size=$taille_drag |
||
103 | !endif |
||
104 | !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case |
||
105 | size=$taille_case |
||
106 | !endif |
||
107 | !if $type_exo iswordof COMPOSE |
||
108 | size=$taille_compose |
||
109 | !endif |
||
110 | |||
111 | !if $type_exo iswordof TRUEFALSE |
||
112 | choice=$choice_tf |
||
113 | !endif |
||
114 | !if $type_exo iswordof GAP |
||
115 | choice=$choice_gap |
||
116 | !endif |
||
117 | !if $type_exo iswordof QUIFAITQUOI |
||
118 | choice=$taille_qq |
||
119 | !endif |
||
120 | !if $type_exo iswordof QCMIII |
||
121 | choice=$choice_fd |
||
122 | !endif |
||
123 | |||
124 | liste = |
||
125 | !for a in reading, audio, image, video |
||
126 | !if $($(a)_file1)=no |
||
127 | $(a)_file=no |
||
128 | !else |
||
129 | $(a)_file=!trim $($(a)_file0) |
||
130 | !endif |
||
131 | !next |
||
12520 | bpr | 132 | Type_exo = $type_exo |
133 | !for a in file,source,reading_file,audio_file,image_file,video_file |
||
2544 | bpr | 134 | $a=!nospace $($a) |
135 | $a=!deaccent $($a) |
||
12520 | bpr | 136 | !next |
2544 | bpr | 137 | modele=!record 0 of $dossier/COMMUN |
12520 | bpr | 138 | date=!date '+%c' |
14218 | bpr | 139 | modele= $name_warning\ |
2544 | bpr | 140 | %% $date\ |
141 | \ |
||
142 | $modele |
||
143 | |||
14218 | bpr | 144 | !for a in $Type_exo |
145 | mod=!record 0 of $dossier/$a |
||
146 | modele =$modele\ |
||
147 | $mod |
||
148 | !next |
||
10176 | bpr | 149 | |
14218 | bpr | 150 | modele=!replace internal IMAGES by $image_tag in $modele |
151 | modele=!replace internal VIDEO by $video_tag in $modele |
||
152 | modele=!replace internal READING by $reading_tag in $modele |
||
153 | modele=!replace internal _image_dir by \imagedir in $modele |
||
10176 | bpr | 154 | |
14218 | bpr | 155 | !for a in title,email,author |
156 | b=!trim $($a) |
||
157 | modele=!replace internal \$a{} by \$a{$b} in $modele |
||
158 | !next |
||
159 | !setdef quick_title=$title in wimshome/$sesdir/var.stat |
||
160 | !setdef quick_source=$source in wimshome/$sesdir/var.stat |
||
161 | !for a in file, reading_file, audio_file, image_file, video_file,N, M, MAX,try,alea,\ |
||
162 | instruction,instruction2,\ |
||
163 | choice,answer_given,format,format0,common,second_step,first_step,pos_rep,percent,\ |
||
164 | size,qcm_prompt1,qcm_prompt2,sens,aucune,partialscore,paste,\ |
||
165 | specialhelp1,specialhelp2,specialhelp3,specialhelp4,helpprompt,reaccent,packs,player,\ |
||
166 | good_answer_text,bad_answer_text,incomplete_answer_text |
||
167 | b=!trim $($a) |
||
168 | !setdef quick_$a=$b in wimshome/$sesdir/var.stat |
||
169 | modele=!replace internal \text{$a=} by \text{$a=$b} in $modele |
||
170 | !next |
||
171 | !for a in style_question,style_reponse,style_oef,style_css |
||
172 | b=!replace internal $\ |
||
3546 | bpr | 173 | $ by in $($a) |
14218 | bpr | 174 | b=!trim $b |
175 | !setdef quick_$a=$b in wimshome/$sesdir/var.stat |
||
176 | modele=!replace internal _$a by $b in $modele |
||
177 | !next |
||
178 | modele=!replace internal \text{player_option=} by \text{player_option=$player_option} in $modele |
||
179 | modele=!replace internal \text{instruction=asis()} by \text{instruction=asis($instruction)} in $modele |
||
180 | modele=!replace internal \text{instruction2=asis()} by \text{instruction2=asis($instruction2)} in $modele |
||
181 | modele=!replace internal \text{file=randitem()} by \text{file=randitem($($file))} in $modele |
||
182 | !if yes iswordof $reading_file1 $image_file1 |
||
183 | help = !record 0 of $dossier/HELP |
||
184 | !if $raw=1 |
||
185 | help=!replace internal RAW(reading) by \special{expandlines \reading} in $help |
||
186 | !else |
||
187 | help=!replace internal RAW(reading) by \reading in $help |
||
188 | !endif |
||
12520 | bpr | 189 | !endif |
14218 | bpr | 190 | modele = $modele $help |
191 | exo=$modele |
||
192 | exo1 = !replace internal & by & in $exo |
||
10176 | bpr | 193 | |
14218 | bpr | 194 | example= |
195 | !if $wims_developer!=$empty |
||
196 | list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer |
||
197 | list_mod=!words2items $list_mod |
||
198 | list_module= |
||
199 | !for a in $list_mod |
||
200 | category = !module category devel/$wims_developer/$a |
||
201 | !if oef isin $category |
||
202 | list_module=!append item $a to $list_module |
||
203 | !endif |
||
204 | !next |
||
205 | !if $list_module=$empty and $transfert=yes |
||
206 | error = $error oefempty |
||
2544 | bpr | 207 | !endif |
14218 | bpr | 208 | !if $target issametext $name_choice |
209 | target=$empty |
||
210 | !endif |
||
12520 | bpr | 211 | !endif |
14218 | bpr | 212 | |
213 | !if $transfert=yes and $target!=$empty |
||
214 | !if / isin $target or .. isin $target |
||
215 | error=$error nom_fichier |
||
216 | !exit |
||
12520 | bpr | 217 | !endif |
14218 | bpr | 218 | !if / isin $source or .. isin $source |
12520 | bpr | 219 | error=$error nom_fichier |
14218 | bpr | 220 | !exit |
221 | !endif |
||
222 | dir=$wims_home/public_html/modules/devel/$wims_developer/$target |
||
223 | !setdef common_images=yes\ |
||
224 | class_importation=no in wimshome/public_html/modules/devel/$wims_developer/$target/var.proc |
||
225 | !filewrite getfile/$source.oef $modele |
||
226 | !sh rm $dir/src/.oef\ |
||
227 | find $dir -name .DS_Store -exec rm {} \; \ |
||
228 | cp $wims_home/$wims_sesdir/getfile/$source.oef $dir/src\ |
||
229 | cd $dir\ |
||
230 | src2def |
||
12520 | bpr | 231 | |
14218 | bpr | 232 | !readproc listefile |
12520 | bpr | 233 | !if / isin $wims_deposit or .. isin $wims_deposit |
234 | !exit |
||
235 | !endif |
||
236 | !if $type_fichier > 0 |
||
2544 | bpr | 237 | !if $wims_deposit!=noname.file and $wims_deposit!=$empty \ |
238 | and $wims_deposit!=.oef and $type_fichier > 0 |
||
239 | !if $type_fichier=1 |
||
240 | file_transfert=$file |
||
241 | !endif |
||
242 | !if $type_fichier=2 |
||
243 | file_transfert=$reading_file |
||
244 | !endif |
||
245 | !if $type_fichier=3 |
||
10176 | bpr | 246 | file_transfert=images/$image_file |
2544 | bpr | 247 | !endif |
248 | !if $type_fichier=4 |
||
249 | file_transfert=images/$audio_file |
||
250 | !endif |
||
251 | !if $type_fichier=5 |
||
252 | !sh cd $wims_home/$wims_sesdir\ |
||
12520 | bpr | 253 | mv user-deposit getfile/$wims_deposit\ |
254 | cp getfile/$wims_deposit $dir/images/$wims_deposit |
||
2544 | bpr | 255 | !else |
256 | !if $type_fichier<=2 |
||
12520 | bpr | 257 | !sh cd $wims_home/$wims_sesdir\ |
2544 | bpr | 258 | mv user-deposit getfile/$wims_deposit\ |
259 | cd getfile\ |
||
260 | dos2unix -o $wims_deposit\ |
||
261 | cd ..\ |
||
262 | cp getfile/$wims_deposit $dir/$file_transfert |
||
263 | !else |
||
264 | !sh cd $wims_home/$wims_sesdir\ |
||
265 | mv user-deposit getfile/$wims_deposit\ |
||
266 | cp getfile/$wims_deposit $dir/$file_transfert |
||
10176 | bpr | 267 | !endif |
268 | !endif |
||
12520 | bpr | 269 | !reset type_fichier |
270 | dir=$wims_home/public_html/modules/devel/$wims_developer/$target |
||
271 | !readproc listefile |
||
10176 | bpr | 272 | |
2544 | bpr | 273 | !endif |
12520 | bpr | 274 | !reset file_transfert |
275 | !endif |
||
276 | !endif transfert |
||
2544 | bpr | 277 | !endif |
10176 | bpr | 278 | !set wims_ariane=!append line modtool,1,module=adm/modtool\ |
279 | to $wims_ariane |
||
280 | !if $type_exo!=$empty |
||
12520 | bpr | 281 | !set wims_ariane=!append line quicktool,1,module=$module\ |
10176 | bpr | 282 | to $wims_ariane |
283 | !else |
||
12520 | bpr | 284 | !set wims_ariane=!append line quicktool,8, to $wims_ariane |
10176 | bpr | 285 | !endif |
286 | !set wims_ariane_self=no |
||
2544 | bpr | 287 | |
10176 | bpr | 288 | !if $wims_theme=default |
289 | !set wims_menu_items=!append line $wims_ariane to $wims_menu_items |
||
290 | !reset wims_ariane |
||
291 | !endif |
||
2544 | bpr | 292 | |
293 | class_importation=no |
||
294 | |||
295 | wims_module_log= $cmd $Type_exo |