Rev 4616 | Rev 4645 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4612 | bpr | 1 | !read lang/names.phtml.fr |
2 | !default step=1 |
||
3 | !set limit=50 |
||
4 | |||
5 | !if $ext=0 |
||
6 | arrow=0 |
||
7 | !else |
||
8 | arrow=3 |
||
9 | !endif |
||
10 | |||
11 | !if $end=1 |
||
4616 | bpr | 12 | !goto end |
4612 | bpr | 13 | !endif |
14 | !if $step <=1 |
||
15 | !set wims_form_method=file |
||
16 | !set already=!sh mkdir -p $wims_home/$wims_sesdir/$sesdir ; ls $wims_home/$wims_sesdir/$sesdir |
||
17 | !set already=!words2items $already |
||
18 | !set already=!nospace $already |
||
19 | !endif |
||
20 | !if $step>$limit |
||
21 | test=limit |
||
22 | !exit |
||
23 | !endif |
||
24 | # how to detect the need to compute? |
||
25 | !if $cmd=reply |
||
26 | error= |
||
27 | compute= |
||
28 | !if $wims_deposit_old=0 |
||
29 | !reset wims_deposit_old |
||
30 | !endif |
||
31 | !default wims_deposit=$wims_deposit_old |
||
32 | !if $data= |
||
33 | !if noname.file isin $wims_deposit or $wims_deposit=$empty |
||
34 | wims_deposit=$wims_deposit_old |
||
35 | !else |
||
36 | !reset wims_deposit_old |
||
37 | !endif |
||
4616 | bpr | 38 | !endif |
39 | !if $wims_deposit_old!= |
||
4612 | bpr | 40 | f_wims_deposit=!replace internal . by , in $wims_deposit_old |
41 | f_wims_deposit=!item 1 of $f_wims_deposit_old |
||
42 | data=!sh cat $wims_home/$wims_sesdir/data_$f_wims_deposit |
||
43 | insdraw_size=!line 1 of $data |
||
44 | step=!linecnt $data |
||
45 | test_ext=!line 2 of $data |
||
46 | test_ext=!itemcnt $test_ext |
||
47 | !if $test_ext=3 and $ext=1 |
||
48 | data=!line 1 of $data |
||
49 | step=3 |
||
50 | !goto 2 |
||
51 | !endif |
||
52 | !if $step=0 |
||
53 | step=1 |
||
54 | !goto 1 |
||
55 | !endif |
||
56 | !for l_ =2 to $step |
||
57 | c_=!line $l_ of $data |
||
58 | !if $ext=1 |
||
59 | dessin=!append line arrow $(c_[2..5]),5,black to $dessin |
||
60 | !endif |
||
61 | !if $ext=0 |
||
62 | dessin=!append line fcircle $(c_[2..3]),10,black to $dessin |
||
63 | !endif |
||
64 | !next |
||
65 | step=$[$step+1] |
||
66 | !exit |
||
4616 | bpr | 67 | !endif wims_deposit_old |
68 | |||
4612 | bpr | 69 | :1 |
4616 | bpr | 70 | |
4612 | bpr | 71 | !if $step=1 |
72 | !if / isin $wims_deposit or .. isin $wims_deposit or noname.file isin $wims_deposit or $wims_deposit=$empty |
||
73 | !if $wims_deposit_old!= |
||
74 | wims_deposit=$wims_deposit_old |
||
75 | !else |
||
76 | test=noimage |
||
77 | !exit |
||
78 | !endif |
||
79 | !endif |
||
80 | test_wims_deposit=!replace internal . by , in $wims_deposit |
||
81 | test_wims_deposit=!item -1 of $test_wims_deposit |
||
82 | test_wims_deposit=!lowercase $test_wims_deposit |
||
83 | !if $test_wims_deposit notwordof jpg png jpeg gif |
||
84 | test=bad_image |
||
85 | !exit |
||
86 | !endif |
||
87 | !if $wims_deposit_old= |
||
88 | !sh cd $wims_home/$wims_sesdir\ |
||
89 | mkdir -p getfile\ |
||
90 | mkdir -p $sesdir\ |
||
91 | mv user-deposit $sesdir/$wims_deposit |
||
92 | !endif |
||
93 | !increase step |
||
94 | !endif |
||
95 | :2 |
||
4616 | bpr | 96 | !if $step>=2 |
97 | !if $erase=yes |
||
98 | !if $ext=0 |
||
4612 | bpr | 99 | dessin=!line 1 to -2 of $dessin |
4616 | bpr | 100 | !else |
4612 | bpr | 101 | dessin=!line 1 to -3 of $dessin |
4616 | bpr | 102 | !endif |
4612 | bpr | 103 | data=!line 1 to -2 of $data |
104 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
105 | step=$[max($[$step-1],2)] |
||
106 | !if $step=2 |
||
107 | !reset data |
||
108 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
109 | !endif |
||
110 | !reset legend test erase |
||
111 | !exit |
||
4616 | bpr | 112 | !endif |
113 | !endif |
||
114 | !reset wims_form_method |
||
115 | imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$wims_deposit |
||
116 | click_x=$[$click_x] |
||
117 | click_y=$[$click_y] |
||
118 | !if $step=2 |
||
4612 | bpr | 119 | !if $click_x != 0 and $click_y != 0 |
120 | data=!append line $click_x,$click_y to $data |
||
121 | !increase step |
||
122 | insdraw_size=$click_x,$click_y |
||
123 | !else |
||
124 | test=nosize |
||
125 | !endif |
||
4616 | bpr | 126 | !else |
4612 | bpr | 127 | !if $legend!=$empty and ($click_x!=0 or $click_y!=0) |
128 | !if $ext<=1 |
||
129 | data=!append line $legend,$click_x,$click_y to $data |
||
130 | !if $ext=1 |
||
131 | dessin=!append line fcircle $click_x,$click_y,5,black to $dessin |
||
132 | !endif |
||
133 | !increase step |
||
134 | !if $ext=0 |
||
135 | !reset legend |
||
136 | dessin=!append line fcircle $click_x,$click_y,10,black to $dessin |
||
137 | !else |
||
138 | dessin=!append line arrow $click_x,$click_y to $dessin |
||
139 | !endif |
||
140 | !else |
||
141 | data=!append item $click_x,$click_y to $data |
||
142 | dessin=!append item $click_x,$click_y,10,black to $dessin |
||
143 | !reset legend |
||
144 | !endif |
||
145 | ext=$[$arrow-$ext] |
||
146 | !else |
||
147 | !if $legend=$empty |
||
148 | test=nolegend |
||
149 | !endif |
||
150 | !if ($click_x=0 and $click_y=0) |
||
151 | test=noclick |
||
152 | !endif |
||
153 | !endif |
||
154 | !endif |
||
155 | !endif |
||
156 | !if $step >= $limit |
||
157 | end=1 |
||
158 | !endif |
||
159 | |||
160 | :end |
||
161 | |||
162 | !if $end!=0 and $end!=$empty |
||
4616 | bpr | 163 | name_title=!line 1 of $(name_description$end) |
164 | exo=!record 0 to -1 of data/example$end.oef |
||
165 | exo_begin=!record 0 of data/example$end.oef |
||
166 | exo=!record 1 to -1 of data/example$end.oef |
||
167 | exo=!replace internal < by < in $exo_begin\ |
||
4612 | bpr | 168 | :$(name_description$end)\ |
169 | $exo |
||
170 | |||
4616 | bpr | 171 | !writefile wimshome/sessions/$wims_session/submit.oef $exo |
172 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
4612 | bpr | 173 | |
4616 | bpr | 174 | !sh cd $wims_home/sessions/$wims_session\ |
4612 | bpr | 175 | mkdir -p getfile/oefimg\ |
4618 | bpr | 176 | cp $sesdir/$wims_deposit getfile/oefimg/$wims_deposit |
177 | |||
4612 | bpr | 178 | mkdir -p $wims_home/log/classes/$wims_class/src/images |
179 | !! il faudrait connaitre le nom de l'exo |
||
4616 | bpr | 180 | cp $sesdir/$wims_deposit $wims_home/log/classes/$wims_class/src/images/$wims_deposit |
4612 | bpr | 181 | |
182 | !endif |
||
183 | !reset click_x click_y erase |
||
184 |