Subversion Repositories wimsdev

Rev

Rev 13248 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13248 Rev 14050
Line 24... Line 24...
24
!endif
24
!endif
25
!default javaoption=circle
25
!default javaoption=circle
26
javaoutput=!getopt free in $(javaoutput)
26
javaoutput=!getopt free in $(javaoutput)
27
 
27
 
28
!if $end=1
28
!if $end=1
29
 !goto end
29
  !goto end
30
!endif
30
!endif
31
!if $step <=1
31
!if $step <=1
32
 !set wims_form_method=file
32
  !set wims_form_method=file
33
 !set already=!sh mkdir -p $wims_home/$wims_sesdir/$sesdir; ls $wims_home/$wims_sesdir/$sesdir
33
  !set already=!sh mkdir -p $wims_home/$wims_sesdir/$sesdir; ls $wims_home/$wims_sesdir/$sesdir
34
 !set already=!words2items $already
34
  !set already=!words2items $already
35
 !set already=!nospace $already
35
  !set already=!nospace $already
36
!endif
36
!endif
37
!if $step>$limit
37
!if $step>$limit
38
  test=limit
38
  test=limit
39
  !exit
39
  !exit
40
!endif
40
!endif
41
# how to detect the need to compute?
41
# how to detect the need to compute?
42
 
42
 
43
!if $cmd=reply
43
!if $cmd=reply
44
 error=
44
  error=
45
 compute=
45
  compute=
46
 !if $wims_deposit_old=0
46
  !if $wims_deposit_old=0
47
   !reset wims_deposit_old
47
    !reset wims_deposit_old
48
 !endif
48
  !endif
49
 !default wims_deposit=$wims_deposit_old
49
  !default wims_deposit=$wims_deposit_old
50
 f_wims_deposit=!replace internal . by , in $wims_deposit
50
  f_wims_deposit=!replace internal . by , in $wims_deposit
51
 f_wims_deposit=!item 1 of $f_wims_deposit
51
  f_wims_deposit=!item 1 of $f_wims_deposit
52
 !if $data=
52
  !if $data=
53
   !if noname.file isin $wims_deposit or $wims_deposit=$empty
53
    !if noname.file isin $wims_deposit or $wims_deposit=$empty
54
     wims_deposit=$wims_deposit_old
54
      wims_deposit=$wims_deposit_old
55
   !else
55
    !else
56
     !reset wims_deposit_old
56
      !reset wims_deposit_old
57
   !endif
57
    !endif
58
 !endif
58
  !endif
59
 !if $wims_deposit_old!=
59
  !if $wims_deposit_old!=
60
    begin=1
60
    begin=1
61
    f_wims_deposit=!replace internal . by , in $wims_deposit_old
61
    f_wims_deposit=!replace internal . by , in $wims_deposit_old
62
    f_wims_deposit=!item 1 of $f_wims_deposit
62
    f_wims_deposit=!item 1 of $f_wims_deposit
63
    data=!sh cat $wims_home/$wims_sesdir/data_$f_wims_deposit
63
    data=!sh cat $wims_home/$wims_sesdir/data_$f_wims_deposit
64
    !reset  wims_deposit_old
64
    !reset  wims_deposit_old
Line 81... Line 81...
81
      c_=!line $l_ of $data
81
      c_=!line $l_ of $data
82
      !if $type=1
82
      !if $type=1
83
        dessin=!append line arrow $(c_[2..5]),5,black to $dessin
83
        dessin=!append line arrow $(c_[2..5]),5,black to $dessin
84
      !endif
84
      !endif
85
      !if $type iswordof 0 2
85
      !if $type iswordof 0 2
86
       dessin=!append line fcircle $(c_[2..3]),10,black to $dessin
86
        dessin=!append line fcircle $(c_[2..3]),10,black to $dessin
87
      !endif
87
      !endif
88
      !if $type iswordof 3
88
      !if $type iswordof 3
89
       dessin=!append line polyline black,$(c_[2..3]) to $dessin
89
        dessin=!append line polyline black,$(c_[2..3]) to $dessin
90
      !endif
90
      !endif
91
      XXXXX
91
      XXXXX
92
    !next
92
    !next
93
    !increase step
93
    !increase step
94
    !!exit
94
    !!exit
95
  !endif wims_deposit_old
95
  !endif wims_deposit_old
96
 
96
 
97
:1
97
  :1
98
 !if $step=1
98
  !if $step=1
99
   !if  / isin $wims_deposit or .. isin $wims_deposit or noname.file isin $wims_deposit or $wims_deposit=$empty
99
    !if  / isin $wims_deposit or .. isin $wims_deposit or noname.file isin $wims_deposit or $wims_deposit=$empty
100
     !if $wims_deposit_old!=
100
      !if $wims_deposit_old!=
101
       wims_deposit=$wims_deposit_old
101
        wims_deposit=$wims_deposit_old
102
     !else
102
      !else
103
       test=noimage
103
        test=noimage
104
       !exit
104
        !exit
105
     !endif
105
      !endif
106
   !endif / isin
106
    !endif / isin
107
   test_wims_deposit=!replace internal . by , in $wims_deposit
107
    test_wims_deposit=!replace internal . by , in $wims_deposit
108
   test_wims_deposit=!item -1 of $test_wims_deposit
108
    test_wims_deposit=!item -1 of $test_wims_deposit
109
   test_wims_deposit=!lowercase $test_wims_deposit
109
    test_wims_deposit=!lowercase $test_wims_deposit
110
   !if $test_wims_deposit notwordof jpg png jpeg gif
110
    !if $test_wims_deposit notwordof jpg png jpeg gif
111
       test=bad_image
111
      test=bad_image
112
       !exit
112
      !exit
113
   !endif
113
    !endif
114
   !if $wims_deposit_old=
114
    !if $wims_deposit_old=
115
    !sh cd $wims_home/$wims_sesdir\
115
      !sh cd $wims_home/$wims_sesdir\
116
     mkdir -p getfile\
116
       mkdir -p getfile\
117
     mkdir -p $sesdir\
117
       mkdir -p $sesdir\
118
     mv user-deposit $sesdir/$wims_deposit
118
       mv user-deposit $sesdir/$wims_deposit
119
   !endif
119
    !endif
120
   !increase step
120
    !increase step
121
 !endif step=1
121
  !endif step=1
122
:2
122
  :2
123
 !if $step>=2
123
  !if $step>=2
124
  !if $erase=yes
124
    !if $erase=yes
125
   !if $type iswordof 0 2 3
125
      !if $type iswordof 0 2 3
126
    dessin=!line 1 to -2 of $dessin
126
        dessin=!line 1 to -2 of $dessin
127
   !else
127
      !else
128
    dessin=!line 1 to -3 of $dessin
128
        dessin=!line 1 to -3 of $dessin
129
   !endif type
129
      !endif type
130
   data=!line 1 to -2 of $data
130
      data=!line 1 to -2 of $data
131
   !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
131
      !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
132
   step=$[max($[$step-1],2)]
132
      step=$[max($[$step-1],2)]
-
 
133
      !if $step=2
-
 
134
        !reset data
-
 
135
        !!!writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
-
 
136
      !endif step=2
-
 
137
      !reset legend test erase
-
 
138
      !!!!
-
 
139
      !exit
-
 
140
    !endif erase=yes
-
 
141
  !endif step>=2
-
 
142
  !reset wims_form_method
-
 
143
  !default imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$wims_deposit
-
 
144
  click_x=$[$click_x]
-
 
145
  click_y=$[$click_y]
-
 
146
 
133
   !if $step=2
147
  !if $step=2
134
    !reset data
148
    !reset data
135
     !!!writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
-
 
136
   !endif step=2
-
 
137
   !reset legend test erase
-
 
138
   !!!!
-
 
139
    !exit
-
 
140
  !endif erase=yes
-
 
141
 !endif step>=2
-
 
142
 !reset wims_form_method
-
 
143
 !default imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$wims_deposit
-
 
144
 click_x=$[$click_x]
-
 
145
 click_y=$[$click_y]
-
 
146
 
-
 
147
 !if $step=2
-
 
148
  !reset data
-
 
149
   !if $click_x != 0 and $click_y != 0
149
    !if $click_x != 0 and $click_y != 0
150
     data=!append line $click_x,$click_y to $data
150
      data=!append line $click_x,$click_y to $data
151
     !increase step
151
      !increase step
152
     insdraw_size=$click_x,$click_y
152
      insdraw_size=$click_x,$click_y
153
    !else
153
    !else
154
     !if $type!=3
154
      !if $type!=3
155
      test=nosize
155
        test=nosize
156
     !endif
156
      !endif
157
   !endif click!=0 ..
157
    !endif click!=0 ..
158
 !else
158
  !else
159
  !if $type iswordof 2 3
159
    !if $type iswordof 2 3
160
   !if $ext=2
160
      !if $ext=2
161
     data=!append item $javaoption,$(javaoutput) to $data
161
        data=!append item $javaoption,$(javaoutput) to $data
162
     data=!replace internal ; by , in $data
162
        data=!replace internal ; by , in $data
163
     !if $javaoption=circle
163
        !if $javaoption=circle
164
       javaout2=$(javaoutput[1]),$(javaoutput[2]),$(javaoutput[3])*2,black
164
          javaout2=$(javaoutput[1]),$(javaoutput[2]),$(javaoutput[3])*2,black
165
     !endif
165
        !endif
166
     !if $javaoption=rectangle
166
        !if $javaoption=rectangle
167
       javaout2=$(javaoutput),black
167
          javaout2=$(javaoutput),black
168
     !endif
168
        !endif
169
     !if $javaoption=polygon
169
        !if $javaoption=polygon
170
       javaout2=!replace internal ; by , in black,$(javaoutput)
170
          javaout2=!replace internal ; by , in black,$(javaoutput)
171
     !endif
171
        !endif
172
     !if $javaoption=brokenline
172
        !if $javaoption=brokenline
173
        javaout2=$(javaoutput)
173
          javaout2=$(javaoutput)
174
     !endif
174
        !endif
175
     dessin=!append line $javaoption $javaout2 to $dessin
175
        dessin=!append line $javaoption $javaout2 to $dessin
176
     !increase step
176
        !increase step
177
     ext=1
177
        ext=1
178
     begin=1
178
        begin=1
179
     !reset legend begin test
179
        !reset legend begin test
180
   !endif
180
      !endif
181
  !endif type=2
181
    !endif type=2
182
 
182
 
183
  !if ($legend!=$empty and ($click_x!=0 or $click_y!=0 or $type iswordof 3))
183
    !if ($legend!=$empty and ($click_x!=0 or $click_y!=0 or $type iswordof 3))
184
    !if $ext<=1
184
      !if $ext<=1
185
     !if $type=3
185
        !if $type=3
186
        data=!append line $legend to $data
186
          data=!append line $legend to $data
187
     !else
187
        !else
188
        data=!append line $legend,$click_x,$click_y to $data
188
          data=!append line $legend,$click_x,$click_y to $data
189
     !endif
189
        !endif
190
     !if $type=1
190
        !if $type=1
191
       dessin=!append line fcircle $click_x,$click_y,5,black to $dessin
191
          dessin=!append line fcircle $click_x,$click_y,5,black to $dessin
192
     !endif
192
        !endif
193
     !increase step
193
        !increase step
194
     !if $type iswordof 0
194
        !if $type iswordof 0
195
       !reset legend
195
          !reset legend
196
dessin=!append line fcircle $click_x,$click_y,10,black to $dessin
196
          dessin=!append line fcircle $click_x,$click_y,10,black to $dessin
197
     !endif
197
        !endif
198
     !if $type=1
198
        !if $type=1
199
dessin=!append line arrow $click_x,$click_y to $dessin
199
          dessin=!append line arrow $click_x,$click_y to $dessin
200
     !endif
200
        !endif
201
     !if $type iswordof 1 2 3
201
        !if $type iswordof 1 2 3
202
      !increase ext
202
          !increase ext
203
        !if $type iswordof 2
203
            !if $type iswordof 2
204
    dessin_p=!append line circle $click_x,$click_y,5,red to $dessin_p
204
              dessin_p=!append line circle $click_x,$click_y,5,red to $dessin_p
205
       !endif
205
            !endif
206
       !if $type iswordof 2 3
206
            !if $type iswordof 2 3
207
    !set insdraw_filebase=!append item $wims_home/sessions/$wims_session/$sesdir to $insdraw_filebase
207
              !set insdraw_filebase=!append item $wims_home/sessions/$wims_session/$sesdir to $insdraw_filebase
208
    !set insdraw_filebase=!listuniq $insdraw_filebase
208
              !set insdraw_filebase=!listuniq $insdraw_filebase
209
    !set insdraw_filebase=!items2words $insdraw_filebase
209
              !set insdraw_filebase=!items2words $insdraw_filebase
210
    !insdraw copy 0,0,-1,-1,-1,-1,$wims_deposit\
210
              !insdraw copy 0,0,-1,-1,-1,-1,$wims_deposit\
211
      $dessin\
211
      $dessin\
212
      $dessin_p
212
      $dessin_p
213
      !sh cd $wims_home/\
213
              !sh cd $wims_home/\
214
     cp s2/$wims_session/$ins_filename sessions/$wims_session/getfile/click/$ins_filename
214
      cp s2/$wims_session/$ins_filename sessions/$wims_session/getfile/click/$ins_filename
215
 !set imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$ins_filename
215
              !set imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$ins_filename
-
 
216
            !endif
-
 
217
          !endif
-
 
218
        !else
-
 
219
          data=!append item $click_x,$click_y to $data
-
 
220
          !if $type iswordof 1
-
 
221
            dessin=!append item $click_x,$click_y,10,black to $dessin
-
 
222
          !endif
-
 
223
          !if $type iswordof 2 3
-
 
224
            !insdraw $dessin
-
 
225
            !set imgsrc=$ins_filename
-
 
226
          !endif
-
 
227
          !reset legend
-
 
228
          ext=1
-
 
229
        !endif ext <=1
-
 
230
      !else legend
-
 
231
        !if $legend=$empty and $begin!=1
-
 
232
          test=nolegend
216
        !endif
233
        !endif
217
     !endif
-
 
218
   !else
-
 
219
     data=!append item $click_x,$click_y to $data
234
        !if ($click_x=0 and $click_y=0) and $begin!=1 and $type!=3
220
     !if $type iswordof 1
235
          test=noclick
221
dessin=!append item $click_x,$click_y,10,black to $dessin
-
 
222
     !endif
-
 
223
     !if $type iswordof 2 3
-
 
224
 !insdraw $dessin
-
 
225
 !set imgsrc=$ins_filename
-
 
226
     !endif
236
        !endif
227
     !reset legend
237
      !endif legend
228
     ext=1
-
 
229
    !endif ext <=1
-
 
230
  !else legend
-
 
231
   !if $legend=$empty and $begin!=1
-
 
232
     test=nolegend
-
 
233
   !endif
238
    !endif
234
   !if ($click_x=0 and $click_y=0) and $begin!=1 and $type!=3
-
 
235
     test=noclick
-
 
236
   !endif
239
  !endif
237
  !endif legend
-
 
238
!endif cmd=reply
240
!endif cmd=reply
239
 
241
 
240
!if $step >= $limit
242
!if $step >= $limit
241
  end=1
243
  end=1
242
!endif
244
!endif
243
 
245
 
244
:end
246
:end
245
 
247
 
246
!if $end!=0 and $end!=$empty
248
!if $end!=0 and $end!=$empty
247
 name_title=!line 1 of $(name_description$end)
249
  name_title=!line 1 of $(name_description$end)
248
 exo=!record 0 to -1 of data/example$end.oef
250
  exo=!record 0 to -1 of data/example$end.oef
249
 exo_begin=!record 0 of data/example$end.oef
251
  exo_begin=!record 0 of data/example$end.oef
250
 exo=!record 1 to -1 of data/example$end.oef
252
  exo=!record 1 to -1 of data/example$end.oef
251
 exo=!replace internal &lt; by < in $exo_begin\
253
  exo=!replace internal &lt; by < in $exo_begin\
252
:$(name_description$end)\
254
:$(name_description$end)\
253
$exo
255
$exo
254
 
256
 
255
 !writefile wimshome/sessions/$wims_session/submit.oef $exo
257
  !writefile wimshome/sessions/$wims_session/submit.oef $exo
256
 !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
258
  !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data
257
 insdraw_size=!line 1 of $data
259
  insdraw_size=!line 1 of $data
258
 !insdraw $dessin
260
  !insdraw $dessin
259
 !set imgfilename=$ins_filename
261
  !set imgfilename=$ins_filename
260
 !if $type iswordof 2 3
262
  !if $type iswordof 2 3
261
  !sh cd $wims_home/\
263
    !sh cd $wims_home/\
262
     cp s2/$wims_session/$imgfilename sessions/$wims_session/getfile/click/z_$wims_deposit
264
      cp s2/$wims_session/$imgfilename sessions/$wims_session/getfile/click/z_$wims_deposit
263
 !endif
265
  !endif
264
!endif
266
!endif
265
!reset click_x click_y erase javaoutput
267
!reset click_x click_y erase javaoutput
266
 
-