Subversion Repositories wimsdev

Rev

Rev 3546 | Rev 3697 | 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,\
3693 bpr 45
        specialhelp3,specialhelp4,helpprompt,reaccent,packs,player,player_option,\
2544 bpr 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,\
3693 bpr 166
      specialhelp1,specialhelp2,specialhelp3,specialhelp4,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
3693 bpr 201
          category = !module category devel/$wims_developer/$a  
2544 bpr 202
         !if oef isin $category
203
            list_module=!append item $a to $list_module
3693 bpr 204
         !endif
2544 bpr 205
       !next
3149 bpr 206
       !if $list_module=$empty and $transfert=yes
2544 bpr 207
         error = $error oefempty
208
       !endif
3693 bpr 209
       !if $target issametext $name_choice
2544 bpr 210
         target=$empty
211
       !endif
212
   !endif
213
 
214
   !if $transfert=yes and $target!=$empty
215
      !if / isin $target or .. isin $target
216
        error=$error nom_fichier     
217
       !exit
218
      !endif
219
      !if / isin $source or .. isin $source
220
        error=$error nom_fichier
221
        !exit
222
      !endif
223
      dir=$wims_home/public_html/modules/devel/$wims_developer/$target
224
      !setdef common_images=yes\
225
      class_importation=no in wimshome/public_html/modules/devel/$wims_developer/$target/var.proc
226
     !! !debug $modele
227
      !filewrite getfile/$source.oef $modele
228
      !sh rm $dir/src/.oef\
229
       find $dir -name .DS_Store -exec rm {} \; \
230
       cp $wims_home/$wims_sesdir/getfile/$source.oef $dir/src\
231
       cd $dir\
232
       src2def
233
 
234
      !readproc listefile
235
      !if  / isin $wims_deposit or .. isin $wims_deposit
236
        !exit
237
      !endif
238
     !if $type_fichier > 0
239
      !if $wims_deposit!=noname.file and $wims_deposit!=$empty \
240
         and $wims_deposit!=.oef and $type_fichier > 0
241
        !if $type_fichier=1
242
          file_transfert=$file
243
        !endif
244
        !if $type_fichier=2
245
          file_transfert=$reading_file
246
        !endif
247
        !if $type_fichier=3
248
          file_transfert=images/$image_file 
249
        !endif
250
        !if $type_fichier=4
251
          file_transfert=images/$audio_file
252
        !endif
253
        !if $type_fichier=5
254
        !sh cd $wims_home/$wims_sesdir\
255
             mv user-deposit getfile/$wims_deposit\
256
             cp getfile/$wims_deposit $dir/images/$wims_deposit
257
        !else
258
          !if $type_fichier<=2
259
           !sh cd $wims_home/$wims_sesdir\
260
             mv user-deposit getfile/$wims_deposit\
261
             cd getfile\
262
             dos2unix -o $wims_deposit\
263
             cd ..\
264
             cp getfile/$wims_deposit $dir/$file_transfert
265
          !else
266
           !sh cd $wims_home/$wims_sesdir\
267
             mv user-deposit getfile/$wims_deposit\
268
             cp getfile/$wims_deposit $dir/$file_transfert
269
          !endif                     
270
        !endif      
271
       !reset type_fichier
272
            dir=$wims_home/public_html/modules/devel/$wims_developer/$target
273
  !readproc listefile
274
 
275
      !endif
276
    !reset file_transfert
277
   !endif
278
   !endif transfert
279
!endif
280
 
281
 
282
class_importation=no
283
 
284
wims_module_log= $cmd $Type_exo
285
 
286