Rev 4616 | Go to most recent revision | Details | 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 |
||
12 | !goto end |
||
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 |
||
38 | |||
39 | !if $wims_deposit_old!= |
||
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 |
||
67 | !endif |
||
68 | :1 |
||
69 | !if $step=1 |
||
70 | !if / isin $wims_deposit or .. isin $wims_deposit or noname.file isin $wims_deposit or $wims_deposit=$empty |
||
71 | !if $wims_deposit_old!= |
||
72 | wims_deposit=$wims_deposit_old |
||
73 | !else |
||
74 | test=noimage |
||
75 | !exit |
||
76 | !endif |
||
77 | !endif |
||
78 | test_wims_deposit=!replace internal . by , in $wims_deposit |
||
79 | test_wims_deposit=!item -1 of $test_wims_deposit |
||
80 | test_wims_deposit=!lowercase $test_wims_deposit |
||
81 | !if $test_wims_deposit notwordof jpg png jpeg gif |
||
82 | test=bad_image |
||
83 | !exit |
||
84 | !endif |
||
85 | !if $wims_deposit_old= |
||
86 | !sh cd $wims_home/$wims_sesdir\ |
||
87 | mkdir -p getfile\ |
||
88 | mkdir -p $sesdir\ |
||
89 | mv user-deposit $sesdir/$wims_deposit |
||
90 | !endif |
||
91 | !increase step |
||
92 | !endif |
||
93 | :2 |
||
94 | !if $step>=2 |
||
95 | !if $erase=yes |
||
96 | !if $ext=0 |
||
97 | dessin=!line 1 to -2 of $dessin |
||
98 | !else |
||
99 | dessin=!line 1 to -3 of $dessin |
||
100 | !endif |
||
101 | data=!line 1 to -2 of $data |
||
102 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
103 | step=$[max($[$step-1],2)] |
||
104 | !if $step=2 |
||
105 | !reset data |
||
106 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
107 | !endif |
||
108 | !reset legend test erase |
||
109 | !exit |
||
110 | !endif |
||
111 | !reset wims_form_method |
||
112 | imgsrc=$wims_ref_name?session=$session&cmd=getfile&special_parm=$sesdir1/$wims_deposit |
||
113 | click_x=$[$click_x] |
||
114 | click_y=$[$click_y] |
||
115 | !if $step=2 |
||
116 | !if $click_x != 0 and $click_y != 0 |
||
117 | data=!append line $click_x,$click_y to $data |
||
118 | !increase step |
||
119 | insdraw_size=$click_x,$click_y |
||
120 | !else |
||
121 | test=nosize |
||
122 | !endif |
||
123 | !else |
||
124 | !if $legend!=$empty and ($click_x!=0 or $click_y!=0) |
||
125 | !if $ext<=1 |
||
126 | data=!append line $legend,$click_x,$click_y to $data |
||
127 | !if $ext=1 |
||
128 | dessin=!append line fcircle $click_x,$click_y,5,black to $dessin |
||
129 | !endif |
||
130 | !increase step |
||
131 | !if $ext=0 |
||
132 | !reset legend |
||
133 | dessin=!append line fcircle $click_x,$click_y,10,black to $dessin |
||
134 | !else |
||
135 | dessin=!append line arrow $click_x,$click_y to $dessin |
||
136 | !endif |
||
137 | !else |
||
138 | data=!append item $click_x,$click_y to $data |
||
139 | dessin=!append item $click_x,$click_y,10,black to $dessin |
||
140 | !reset legend |
||
141 | !endif |
||
142 | ext=$[$arrow-$ext] |
||
143 | !else |
||
144 | !if $legend=$empty |
||
145 | test=nolegend |
||
146 | !endif |
||
147 | !if ($click_x=0 and $click_y=0) |
||
148 | test=noclick |
||
149 | !endif |
||
150 | !endif |
||
151 | !endif |
||
152 | !endif |
||
153 | !if $step >= $limit |
||
154 | end=1 |
||
155 | !endif |
||
156 | |||
157 | :end |
||
158 | |||
159 | !if $end!=0 and $end!=$empty |
||
160 | |||
161 | name_title=!line 1 of $(name_description$end) |
||
162 | exo=!record 0 to -1 of data/example$end.oef |
||
163 | exo_begin=!record 0 of data/example$end.oef |
||
164 | exo=!record 1 to -1 of data/example$end.oef |
||
165 | exo=!replace internal < by < in $exo_begin\ |
||
166 | :$(name_description$end)\ |
||
167 | $exo |
||
168 | |||
169 | !writefile wimshome/sessions/$wims_session/submit.oef $exo |
||
170 | !writefile wimshome/sessions/$wims_session/data_$f_wims_deposit $data |
||
171 | |||
172 | !sh cd $wims_home/sessions/$wims_session\ |
||
173 | mkdir -p getfile/oefimg\ |
||
174 | cp $sesdir/$wims_deposit getfile/oefimg/$wims_deposit\ |
||
175 | mkdir -p $wims_home/log/classes/$wims_class/src/images |
||
176 | !! il faudrait connaitre le nom de l'exo |
||
177 | cp $sesdir/$wims_deposit $wims_home/log/classes/$wims_class/src/images/$wims_deposit |
||
178 | |||
179 | !endif |
||
180 | !reset click_x click_y erase |
||
181 |