Subversion Repositories wimsdev

Rev

Rev 3177 | Rev 3693 | 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 
2
!read adm/language names.phtml
3
!read tabletheme
2740 bpr 4
!!!for the moment no language version, because only one example module
5
!set example_dir=lang/example.fr
2544 bpr 6
wims_prefix=class user tmp
7
!if robot isin $session
8
  !exit
9
!endif
10
 
11
!readproc auth
12
   !if $wims_developer=$empty
13
    !exit
14
   !endif
15
 sesdir=!translate internal _ to $ $ in $wims_sesdir
16
 sesdir=!word 1 of $sesdir
17
!default author=$wims_name
18
!default email=$wims_email
19
!if $cmd iswordof reply new resume renew
20
   error=
21
   dossier=type
22
   !if $example=0 or $example=
23
      !if $debut=1
24
         !reset mtype
25
         !reset N
26
         !reset M
27
         !reset source
28
          compute=no
29
      !else
30
          !for a in title,author,email,file,source
31
              !if $($a)=$empty
32
                 error= $error $a
33
              !endif
34
          !next
35
           compute=yes
36
      !endif       
37
   !else
38
      !for a in type_exo,title,author,email,file,N,MAX1,M,try,\
39
        instruction,instruction2,answer_given,alea,choice,format,\
40
        percent,pos_rep,common,second_step,first_step,\
41
        file, reading_file, audio_file,image_file,video_file,size,source,\
42
        style_question,style_reponse,style_oef,style_css,\
43
        reading_tag,image_tag,video_tag,qcm_prompt1,qcm_prompt2,\
44
        sens,aucune,raw,partialscore,paste,specialhelp1,specialhelp2,\
45
        specialhelp3,helpprompt,reaccent,packs,player,player_option,\
46
        good_answer_text,bad_answer_text,incomplete_answer_text,\
47
 
48
        $(a) =!getdef $a in $example_dir/$TYPE/$example
49
      !next
50
      !if $type_exo iswordof CORRESP
51
        taille_corr=$size
52
      !endif
53
      !if $type_exo iswordof ORDONNE \
54
         or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill)) 
55
         taille_drag=$size
56
      !endif
57
      !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case
58
         taille_case=$size
59
      !endif
60
      !if $type_exo iswordof COMPOSE
61
         taille_compose=$size
62
      !endif
63
 
64
      !if $type_exo iswordof TRUEFALSE
65
         choice_tf=$choice
66
      !endif
67
      !if $type_exo iswordof GAP
68
         choice_gap=$choice
69
      !endif
70
      !if $type_exo iswordof QUIFAITQUOI
71
        choice_qq=$choice
72
      !endif
73
      !if $type_exo iswordof QCMIII
74
         choice_fd=$choice
75
      !endif
76
 
77
      !for a in reading,audio,image,video
78
        !if $($(a)_file) notsametext no and $($(a)_file)!=$empty
79
          $(a)_file0=$($(a)_file)
80
          $(a)_file1=yes
81
        !else
82
          $(a)_file1=no
83
         !endif
84
      !next
85
      compute=no
86
     example=
87
 
88
   !endif example
89
   !readproc values
90
   !if $N issametext all
91
      N=\cnt_question
92
   !endif
93
   !if $MAX1 issametext all or $MAX1=
94
      MAX = \cnt_question
95
   !else
96
      MAX=$MAX1
97
   !endif
98
   !if $type_exo iswordof CORRESP  
99
      size=$taille_corr
100
   !endif
101
   !if $type_exo iswordof ORDONNE \
102
     or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill))
103
      size=$taille_drag
104
   !endif
105
   !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case
106
      size=$taille_case
107
   !endif
108
   !if $type_exo iswordof COMPOSE
109
      size=$taille_compose
110
   !endif
111
 
112
   !if $type_exo iswordof TRUEFALSE
113
     choice=$choice_tf
114
   !endif
115
   !if $type_exo iswordof GAP
116
     choice=$choice_gap
117
   !endif
118
   !if $type_exo iswordof QUIFAITQUOI
119
     choice=$taille_qq
120
   !endif
121
   !if $type_exo iswordof QCMIII
122
      choice=$choice_fd
123
   !endif
124
 
125
   liste = 
126
   !for a in reading, audio, image, video
127
      !if $($(a)_file1)=no
128
        $(a)_file=no
129
      !else 
130
        $(a)_file=!trim $($(a)_file0)
131
      !endif
132
   !next
133
   Type_exo = $type_exo
134
   !for a in file,source,reading_file,audio_file,image_file,video_file
135
      $a=!nospace $($a)
136
      $a=!deaccent $($a)
137
   !next
138
    modele=!record 0 of $dossier/COMMUN
139
date=!date '+%c'
140
   modele= $name_warning\
141
%% $date\
142
\
143
$modele
144
 
145
   !for a in $Type_exo
146
     mod=!record 0 of $dossier/$a
147
     modele =$modele\
148
     $mod   
149
   !next
150
 
151
   modele=!replace internal IMAGES by $image_tag in  $modele
152
   modele=!replace internal VIDEO by $video_tag in  $modele
153
   modele=!replace internal READING by $reading_tag in  $modele
154
   modele=!replace internal _image_dir by \imagedir in  $modele
155
 
156
   !for a in title,email,author
157
     b=!trim $($a)
158
     modele=!replace internal \$a{} by \$a{$b} in  $modele
159
   !next
160
  !setdef quick_title=$title in wimshome/$sesdir/var.stat
161
  !setdef quick_source=$source in wimshome/$sesdir/var.stat
3546 bpr 162
  !for a in file, reading_file, audio_file, image_file, video_file,N, M, MAX,try,alea,\
163
      instruction,instruction2,\
2544 bpr 164
      choice,answer_given,format,common,second_step,first_step,pos_rep,percent,\
165
      size,qcm_prompt1,qcm_prompt2,sens,aucune,partialscore,paste,\
3177 bpr 166
      specialhelp1,specialhelp2,specialhelp3,helpprompt,reaccent,packs,player,\
2544 bpr 167
        good_answer_text,bad_answer_text,incomplete_answer_text
168
     b=!trim $($a)
169
     !setdef quick_$a=$b in wimshome/$sesdir/var.stat
170
     modele=!replace internal \text{$a=} by \text{$a=$b} in  $modele
171
   !next
3546 bpr 172
   !for a in style_question,style_reponse,style_oef,style_css
173
     b=!replace internal $\
174
$ by 	 in $($a)
175
     b=!trim $b
176
     !setdef quick_$a=$b in wimshome/$sesdir/var.stat
177
     modele=!replace internal _$a by $b in $modele
178
   !next
3177 bpr 179
   modele=!replace internal \text{player_option=} by \text{player_option=$player_option autostart="false" loop="false"} in $modele
180
   modele=!replace internal \text{instruction=asis()} by \text{instruction=asis($instruction)} in $modele
181
   modele=!replace internal \text{instruction2=asis()} by \text{instruction2=asis($instruction2)} in $modele
182
   modele=!replace internal \text{file=randitem()} by \text{file=randitem($($file))} in $modele
2544 bpr 183
   !if yes iswordof $reading_file1 $image_file1
184
     help = !record 0 of $dossier/HELP
185
     !if $raw=1
186
       help=!replace internal RAW(reading) by \special{expandlines \reading} in  $help
187
     !else
188
       help=!replace internal RAW(reading) by \reading in  $help
189
     !endif
190
   !endif
191
   modele = $modele $help 
192
   exo=$modele
193
   exo1 = !replace internal & by & in $exo
194
 
195
   example=
196
   !if $wims_developer!=$empty
197
       list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer
198
       list_mod=!words2items $list_mod
199
       list_module=
200
       !for a in $list_mod
201
        !!  category = !defof category in wimshome/public_html/modules/devel/$wims_developer/$a/INDEX
202
          category = !module category devel/$wims_developer/$a
203
 
204
         !if oef isin $category
205
            list_module=!append item $a to $list_module
206
          !endif
207
       !next
3149 bpr 208
       !if $list_module=$empty and $transfert=yes
2544 bpr 209
         error = $error oefempty
210
       !endif
211
       !if $target issametext choisissez
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