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