File: var.proc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (295 lines) | stat: -rw-r--r-- 9,060 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
!!@#language independant
!read adm/language lang/names.phtml

!read tabletheme
!!!for the moment no language version, because only one example module
!set example_dir=lang/example.fr
wims_prefix=class user tmp
!if robot isin $session
  !exit
!endif

!readproc auth
!if $wims_developer=$empty
  !exit
!endif
 sesdir=!translate internal _ to $ $ in $wims_sesdir
 sesdir=!word 1 of $sesdir
!default author=!words2items $wims_name
author=!nonempty items $author
!default email=$wims_devemail
!if $cmd iswordof reply new resume renew
  error=
  dossier=type
  !if $example=0 or $example=
    !if $debut=1
      !reset mtype N M source
       compute=no
    !else
      !for a in title,author,email,file,source
        !if $($a)=$empty
          error= $error $a
        !endif
      !next
      compute=yes
    !endif
  !else
    !for a in type_exo,title,author,email,file,N,MAX1,M,try,\
        instruction,instruction2,answer_given,alea,choice,format,format0,\
        percent,pos_rep,common,second_step,first_step,\
        file, reading_file, audio_file,image_file,video_file,size,source,\
        style_question,style_reponse,style_oef,style_css,\
        reading_tag,image_tag,video_tag,qcm_prompt1,qcm_prompt2,\
        sens,aucune,raw,partialscore,paste,specialhelp1,specialhelp2,\
        specialhelp3,specialhelp4,helpprompt,reaccent,packs,player,player_option,\
        good_answer_text,bad_answer_text,incomplete_answer_text,\

      $(a) =!getdef $a in $example_dir/$TYPE/$example
    !next
    !if $type_exo iswordof CORRESP
      taille_corr=$size
    !endif
    !if $type_exo iswordof ORDONNE \
        or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill))
      taille_drag=$size
    !endif
    !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case
      taille_case=$size
    !endif
    !if $type_exo iswordof COMPOSE
      taille_compose=$size
    !endif

    !if $type_exo iswordof TRUEFALSE
      choice_tf=$choice
    !endif
    !if $type_exo iswordof GAP
      choice_gap=$choice
    !endif
    !if $type_exo iswordof QUIFAITQUOI
      choice_qq=$choice
    !endif
    !if $type_exo iswordof QCMIII
      choice_fd=$choice
    !endif

    !for a in reading,audio,image,video
      !if $($(a)_file) notsametext no and $($(a)_file)!=$empty
        $(a)_file0=$($(a)_file)
        $(a)_file1=yes
      !else
        $(a)_file1=no
      !endif
    !next
    compute=no
    example=

  !endif example
  !readproc values
  !if $N issametext all
    N=\cnt_question
  !endif
  !if $MAX1 issametext all or $MAX1=
    MAX = \cnt_question
  !else
    MAX=$MAX1
  !endif
  !if $type_exo iswordof CORRESP
    size=$taille_corr
  !endif
  !if $type_exo iswordof ORDONNE \
      or ($type_exo iswordof SELECTWORD SELECTWORDA GAP and ($format iswordof dragfill clickfill))
    size=$taille_drag
  !endif
  !if $type_exo iswordof SELECTWORD SELECTWORDA GAP and $format=case
    size=$taille_case
  !endif
  !if $type_exo iswordof COMPOSE
    size=$taille_compose
  !endif

  !if $type_exo iswordof TRUEFALSE
    choice=$choice_tf
  !endif
  !if $type_exo iswordof GAP
      choice=$choice_gap
  !endif
  !if $type_exo iswordof QUIFAITQUOI
    choice=$taille_qq
  !endif
  !if $type_exo iswordof QCMIII
    choice=$choice_fd
  !endif

  liste =
  !for a in reading, audio, image, video
    !if $($(a)_file1)=no
      $(a)_file=no
    !else
      $(a)_file=!trim $($(a)_file0)
    !endif
    !next
    Type_exo = $type_exo
    !for a in file,source,reading_file,audio_file,image_file,video_file
      $a=!nospace $($a)
      $a=!deaccent $($a)
    !next
    modele=!record 0 of $dossier/COMMUN
    date=!date '+%c'
    modele= $name_warning\
%% $date\
\
$modele

    !for a in $Type_exo
      mod=!record 0 of $dossier/$a
      modele =$modele\
      $mod
    !next

    modele=!replace internal IMAGES by $image_tag in $modele
    modele=!replace internal VIDEO by $video_tag in $modele
    modele=!replace internal READING by $reading_tag in $modele
    modele=!replace internal _image_dir by \imagedir in $modele

    !for a in title,email,author
      b=!trim $($a)
      modele=!replace internal \$a{} by \$a{$b} in $modele
    !next
    !setdef quick_title=$title in wimshome/$sesdir/var.stat
    !setdef quick_source=$source in wimshome/$sesdir/var.stat
    !for a in file, reading_file, audio_file, image_file, video_file,N, M, MAX,try,alea,\
        instruction,instruction2,\
        choice,answer_given,format,format0,common,second_step,first_step,pos_rep,percent,\
        size,qcm_prompt1,qcm_prompt2,sens,aucune,partialscore,paste,\
        specialhelp1,specialhelp2,specialhelp3,specialhelp4,helpprompt,reaccent,packs,player,\
      good_answer_text,bad_answer_text,incomplete_answer_text
      b=!trim $($a)
      !setdef quick_$a=$b in wimshome/$sesdir/var.stat
      modele=!replace internal \text{$a=} by \text{$a=$b} in $modele
    !next
    !for a in style_question,style_reponse,style_oef,style_css
      b=!replace internal $\
$ by 	 in $($a)
      b=!trim $b
      !setdef quick_$a=$b in wimshome/$sesdir/var.stat
      modele=!replace internal _$a by $b in $modele
    !next
    modele=!replace internal \text{player_option=} by \text{player_option=$player_option} in $modele
    modele=!replace internal \text{instruction=asis()} by \text{instruction=asis($instruction)} in $modele
    modele=!replace internal \text{instruction2=asis()} by \text{instruction2=asis($instruction2)} in $modele
    modele=!replace internal \text{file=randitem()} by \text{file=randitem($($file))} in $modele
    !if yes iswordof $reading_file1 $image_file1
      help = !record 0 of $dossier/HELP
      !if $raw=1
        help=!replace internal RAW(reading) by \special{expandlines \reading} in  $help
      !else
        help=!replace internal RAW(reading) by \reading in $help
      !endif
    !endif
    modele = $modele $help
    exo=$modele
    exo1 = !replace internal & by & in $exo

    example=
    !if $wims_developer!=$empty
      list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer
      list_mod=!words2items $list_mod
      list_module=
      !for a in $list_mod
        category = !module category devel/$wims_developer/$a
        !if oef isin $category
          list_module=!append item $a to $list_module
        !endif
      !next
      !if $list_module=$empty and $transfert=yes
        error = $error oefempty
      !endif
      !if $target issametext $name_choice
        target=$empty
      !endif
    !endif

    !if $transfert=yes and $target!=$empty
      !if / isin $target or .. isin $target
        error=$error nom_fichier
      !exit
    !endif
    !if / isin $source or .. isin $source
      error=$error nom_fichier
      !exit
    !endif
    dir=$wims_home/public_html/modules/devel/$wims_developer/$target
    !setdef common_images=yes\
    class_importation=no in wimshome/public_html/modules/devel/$wims_developer/$target/var.proc
    !filewrite getfile/$source.oef $modele
    !sh rm $dir/src/.oef\
      find $dir -name .DS_Store -exec rm {} \; \
      cp $wims_home/$wims_sesdir/getfile/$source.oef $dir/src\
      cd $dir\
      src2def

    !readproc listefile
    !if  / isin $wims_deposit or .. isin $wims_deposit
      !exit
    !endif
    !if $type_fichier > 0
      !if $wims_deposit!=noname.file and $wims_deposit!=$empty \
         and $wims_deposit!=.oef and $type_fichier > 0
        !if $type_fichier=1
          file_transfert=$file
        !endif
        !if $type_fichier=2
          file_transfert=$reading_file
        !endif
        !if $type_fichier=3
          file_transfert=images/$image_file
        !endif
        !if $type_fichier=4
          file_transfert=images/$audio_file
        !endif
        !if $type_fichier=5
        !sh cd $wims_home/$wims_sesdir\
          mv user-deposit getfile/$wims_deposit\
          cp getfile/$wims_deposit $dir/images/$wims_deposit
        !else
          !if $type_fichier<=2
            !sh cd $wims_home/$wims_sesdir\
             mv user-deposit getfile/$wims_deposit\
             cd getfile\
             dos2unix -o $wims_deposit\
             cd ..\
             cp getfile/$wims_deposit $dir/$file_transfert
          !else
           !sh cd $wims_home/$wims_sesdir\
             mv user-deposit getfile/$wims_deposit\
             cp getfile/$wims_deposit $dir/$file_transfert
          !endif
        !endif
        !reset type_fichier
        dir=$wims_home/public_html/modules/devel/$wims_developer/$target
        !readproc listefile

      !endif
      !reset file_transfert
    !endif
  !endif transfert
!endif
!set wims_ariane=!append line modtool,1,module=adm/modtool\
to $wims_ariane
!if $type_exo!=$empty
  !set wims_ariane=!append line quicktool,1,module=$module\
to $wims_ariane
!else
  !set wims_ariane=!append line quicktool,8, to $wims_ariane
!endif
!set wims_ariane_self=no

!if $wims_theme=default
  !set wims_menu_items=!append line $wims_ariane to $wims_menu_items
  !reset wims_ariane
!endif

class_importation=no

wims_module_log= $cmd $Type_exo