Subversion Repositories wimsdev

Rev

Rev 3149 | Rev 3546 | 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
162
   !for a in file, reading_file, audio_file, image_file, video_file,N, M, MAX,try,alea,style_question,\
163
      style_reponse,style_oef,style_css,instruction,instruction2,\
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
3177 bpr 172
   modele=!replace internal \text{player_option=} by \text{player_option=$player_option autostart="false" loop="false"} in $modele
173
   modele=!replace internal \text{instruction=asis()} by \text{instruction=asis($instruction)} in $modele
174
   modele=!replace internal \text{instruction2=asis()} by \text{instruction2=asis($instruction2)} in $modele
175
   modele=!replace internal \text{file=randitem()} by \text{file=randitem($($file))} in $modele
2544 bpr 176
   !if yes iswordof $reading_file1 $image_file1
177
     help = !record 0 of $dossier/HELP
178
     !if $raw=1
179
       help=!replace internal RAW(reading) by \special{expandlines \reading} in  $help
180
     !else
181
       help=!replace internal RAW(reading) by \reading in  $help
182
     !endif
183
   !endif
184
   modele = $modele $help 
185
   exo=$modele
186
   exo1 = !replace internal & by & in $exo
187
 
188
   example=
189
   !if $wims_developer!=$empty
190
       list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer
191
       list_mod=!words2items $list_mod
192
       list_module=
193
       !for a in $list_mod
194
        !!  category = !defof category in wimshome/public_html/modules/devel/$wims_developer/$a/INDEX
195
          category = !module category devel/$wims_developer/$a
196
 
197
         !if oef isin $category
198
            list_module=!append item $a to $list_module
199
          !endif
200
       !next
3149 bpr 201
       !if $list_module=$empty and $transfert=yes
2544 bpr 202
         error = $error oefempty
203
       !endif
204
       !if $target issametext choisissez
205
         target=$empty
206
       !endif
207
   !endif
208
 
209
   !if $transfert=yes and $target!=$empty
210
      !if / isin $target or .. isin $target
211
        error=$error nom_fichier     
212
       !exit
213
      !endif
214
      !if / isin $source or .. isin $source
215
        error=$error nom_fichier
216
        !exit
217
      !endif
218
      dir=$wims_home/public_html/modules/devel/$wims_developer/$target
219
      !setdef common_images=yes\
220
      class_importation=no in wimshome/public_html/modules/devel/$wims_developer/$target/var.proc
221
     !! !debug $modele
222
      !filewrite getfile/$source.oef $modele
223
      !sh rm $dir/src/.oef\
224
       find $dir -name .DS_Store -exec rm {} \; \
225
       cp $wims_home/$wims_sesdir/getfile/$source.oef $dir/src\
226
       cd $dir\
227
       src2def
228
 
229
      !readproc listefile
230
      !if  / isin $wims_deposit or .. isin $wims_deposit
231
        !exit
232
      !endif
233
     !if $type_fichier > 0
234
      !if $wims_deposit!=noname.file and $wims_deposit!=$empty \
235
         and $wims_deposit!=.oef and $type_fichier > 0
236
        !if $type_fichier=1
237
          file_transfert=$file
238
        !endif
239
        !if $type_fichier=2
240
          file_transfert=$reading_file
241
        !endif
242
        !if $type_fichier=3
243
          file_transfert=images/$image_file 
244
        !endif
245
        !if $type_fichier=4
246
          file_transfert=images/$audio_file
247
        !endif
248
        !if $type_fichier=5
249
        !sh cd $wims_home/$wims_sesdir\
250
             mv user-deposit getfile/$wims_deposit\
251
             cp getfile/$wims_deposit $dir/images/$wims_deposit
252
        !else
253
          !if $type_fichier<=2
254
           !sh cd $wims_home/$wims_sesdir\
255
             mv user-deposit getfile/$wims_deposit\
256
             cd getfile\
257
             dos2unix -o $wims_deposit\
258
             cd ..\
259
             cp getfile/$wims_deposit $dir/$file_transfert
260
          !else
261
           !sh cd $wims_home/$wims_sesdir\
262
             mv user-deposit getfile/$wims_deposit\
263
             cp getfile/$wims_deposit $dir/$file_transfert
264
          !endif                     
265
        !endif      
266
       !reset type_fichier
267
            dir=$wims_home/public_html/modules/devel/$wims_developer/$target
268
  !readproc listefile
269
 
270
      !endif
271
    !reset file_transfert
272
   !endif
273
   !endif transfert
274
!endif
275
 
276
 
277
class_importation=no
278
 
279
wims_module_log= $cmd $Type_exo
280
 
281