Subversion Repositories wimsdev

Rev

Rev 11640 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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