Subversion Repositories wimsdev

Rev

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