Rev 17176 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
12325 | bpr | 1 | varcnt=!defof varcnt in $(class_header)def/$e_.def |
2 | !default varcnt=0 |
||
3 | !for v=2 to $varcnt+5 |
||
4 | val$v= |
||
5 | !next v |
||
6 | status=prep |
||
13880 | bpr | 7 | wims_prefix_=$wims_prefix |
8 | !reset wims_prefix |
||
9 | !! hack for declaring not printable exercise if the commande !getdef (equivalent defof) is used |
||
10 | !! should be better to allow this command as in the printable version outside a class |
||
11 | testgetdef=!sh grep !getdef $(Class_header)def/$e_.def |
||
12 | !if $testgetdef!= |
||
13 | question= |
||
14 | !else |
||
15 | !read $(class_header)def/$e_.def |
||
14006 | bpr | 16 | embedcnt$iii=$embedcnt |
17 | oefcss_$iii=$oefcss |
||
13880 | bpr | 18 | !endif |
19 | wims_prefix=$wims_prefix_ |
||
12325 | bpr | 20 | !if $format=html |
14006 | bpr | 21 | question_$iii=$question |
12325 | bpr | 22 | !if __EXECUTED_ isin $question |
14006 | bpr | 23 | varcnt_$iii=$varcnt |
24 | var_$iii=$val1 |
||
12325 | bpr | 25 | !for v=2 to $varcnt+5 |
26 | v_=!translate internal $\ |
||
20 | reyssat | 27 | $ to $ $ in $(val$v) |
14006 | bpr | 28 | var_$iii=$(var_$iii)\ |
20 | reyssat | 29 | $v_ |
12325 | bpr | 30 | !next v |
13820 | bpr | 31 | !endif |
12325 | bpr | 32 | !ifval $replycnt=0 and $choicecnt=1 |
33 | rep=!item 1 to 6 of $choicebad1 |
||
34 | rep=!append item $choicegood1 to $rep |
||
35 | rep=!listuniq $rep |
||
36 | rep=!sort items $rep |
||
13876 | bpr | 37 | rep=!replace , by </li><li> in <ul style="list-style-type:square;"><li>$rep</li></ul> |
14006 | bpr | 38 | chce_$iii=$rep |
12325 | bpr | 39 | test_print=1 |
40 | !else |
||
14006 | bpr | 41 | chce_$iii= |
13820 | bpr | 42 | !endif |
12325 | bpr | 43 | rep= |
16938 | bpr | 44 | replatex= |
12460 | bpr | 45 | !!FIXME |
12325 | bpr | 46 | !if 3 isin $intro_check or $intro_check=$empty |
47 | !for k=1 to $choicecnt |
||
48 | !if $(choicename$k)!= |
||
49 | rep=!append line <em>$(choicename$k)</em>: $(choicegood$k) to $rep |
||
16938 | bpr | 50 | replatex=!append line $(choicename$k) : \verb!$(choicegood$k)! to $replatex |
12325 | bpr | 51 | !else |
52 | rep=!append line $(choicegood$k) to $rep |
||
16938 | bpr | 53 | replatex=!append line \verb!$(choicegood$k)! to $replatex |
12325 | bpr | 54 | !endif |
55 | !next k |
||
56 | !for k=1 to $replycnt |
||
57 | thisstep=!line 1 of $oefsteps |
||
58 | !if r$k isitemof $thisstep or $oefsteps=$empty |
||
59 | rg_=$(replygood$k) |
||
13890 | bpr | 60 | !reset anstyle |
61 | !readproc anstype/$(replytype$k).input def |
||
13907 | bpr | 62 | replystyle$k=$anstyle |
14006 | bpr | 63 | Replytype$iii=!append item $(replytype$k) to $(Replytype$iii) |
64 | Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii) |
||
13890 | bpr | 65 | |
14006 | bpr | 66 | !if $(replytype$k) iswordof flashcard time crossword |
67 | question_$iii= |
||
13890 | bpr | 68 | !reset rg_ |
14006 | bpr | 69 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13890 | bpr | 70 | !goto endRg |
71 | !endif |
||
13880 | bpr | 72 | !if $(replytype$k) iswordof checkbox click mark menu radio clickfill dragfill multipleclick |
13810 | bpr | 73 | rg_=!rows2lines $rg_ |
12325 | bpr | 74 | rg1_=!line 1 of $rg_ |
75 | rg2_=!line 2 to -1 of $rg_ |
||
76 | rg2_=!translate internal $\ |
||
20 | reyssat | 77 | $ to ; in $rg2_ |
13880 | bpr | 78 | !if $(replytype$k) iswordof checkbox click mark menu radio |
13794 | bpr | 79 | rg_=!item $rg1_ of $rg2_ |
80 | !else |
||
81 | rg_=$rg1_ |
||
82 | !endif |
||
13788 | bpr | 83 | rg_tmp=$rg2_ |
13793 | bpr | 84 | !if $(replytype$k) iswordof clickfill dragfill |
13890 | bpr | 85 | !if ?analyze notin $rg1_ |
86 | rg_tmp=!listuniq $rg1_,$rg2_ |
||
87 | !else |
||
88 | rg_tmp=$rg2_ |
||
89 | !endif |
||
13788 | bpr | 90 | !endif |
14006 | bpr | 91 | Rg$iii=!append line $rg_tmp to $(Rg$iii) |
13723 | bpr | 92 | !goto endRg |
13816 | bpr | 93 | !endif |
13798 | bpr | 94 | !if $(replytype$k) iswordof coord |
17176 | bpr | 95 | rg_=<img src="$(rg_[1;])"> |
14006 | bpr | 96 | Rg$iii=!append line $rg_ to $(Rg$iii) |
13798 | bpr | 97 | !goto endRg |
98 | !endif |
||
12325 | bpr | 99 | !if $(replytype$k) iswordof atext wlist nocase case |
100 | rg_=!translate internal ;| to $\ |
||
20 | reyssat | 101 | \ |
102 | $ in $rg_ |
||
12325 | bpr | 103 | rg_=!line 1 of $rg_ |
14006 | bpr | 104 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13876 | bpr | 105 | !goto endRg |
13816 | bpr | 106 | !endif |
17332 | bpr | 107 | !!!FIXME why $(replystyle$k) iswordof numeric text |
13907 | bpr | 108 | !if $(replytype$k) iswordof function default equation sigunits numexp\ |
17332 | bpr | 109 | or ($(replystyle$k) iswordof numeric text and $(replytype$k) notwordof set) |
12325 | bpr | 110 | rg_=!item 1 of $rg_ |
14006 | bpr | 111 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13723 | bpr | 112 | !goto endRg |
13801 | bpr | 113 | !endif |
13799 | bpr | 114 | !if $(replytype$k) iswordof imgcomp textcomp compose reorder |
12325 | bpr | 115 | rg_=!translate internal | to $\ |
20 | reyssat | 116 | $ in $rg_ |
12325 | bpr | 117 | rg_=!rows2lines $rg_ |
14008 | bpr | 118 | rg_=!nonempty lines $rg_ |
119 | !! due to , in math mode for example |
||
120 | rg_tmp=!items2lines $rg_ |
||
121 | rg_tmp=!replace internal , by , in $rg_tmp |
||
122 | rg_tmp=!lines2items $rg_tmp |
||
14436 | bpr | 123 | !if ?analyze isin $(rg_tmp[1]) |
124 | rg_tmp=!item 2 to -1 of $rg_tmp |
||
125 | !endif |
||
12325 | bpr | 126 | rg_=!line 1 of $rg_ |
127 | !if $(replytype$k)=imgcomp |
||
128 | rg_=!item 2 to -1 of $rg_ |
||
129 | rg_=!nospace $rg_ |
||
17176 | bpr | 130 | rg_=!replace , by ">,<img src="$imagedir/ in <img src="$imagedir/$rg_"> |
12325 | bpr | 131 | rg__=!shuffle $rg_ |
14006 | bpr | 132 | Rg$iii=!append line $rg__ to $(Rg$iii) |
12325 | bpr | 133 | !else |
13788 | bpr | 134 | rg_cnt_=!itemcnt $rg_tmp |
12325 | bpr | 135 | rg__=!shuffle $rg_cnt_ |
13788 | bpr | 136 | rg_tmp=!listuniq $(rg_tmp[$rg__]) |
14006 | bpr | 137 | Rg$iii=!append line $rg_tmp to $(Rg$iii) |
13799 | bpr | 138 | !endif |
12325 | bpr | 139 | rg_=!translate , to $ $ in $rg_ |
13876 | bpr | 140 | !goto endRg |
13799 | bpr | 141 | !endif |
12325 | bpr | 142 | !if $(replytype$k) iswordof correspond |
13876 | bpr | 143 | !set rg__=!rows2lines $rg_ |
12325 | bpr | 144 | !distribute lines $rg__ into rg1__,rg2__ |
145 | !set rg__cnt=!itemcnt $rg1__ |
||
146 | !set rg_2_=!shuffle $rg__cnt |
||
13908 | bpr | 147 | !set rg__=<table class="wimscenter wimsnoborder"><tr> |
148 | !set rgg_=<table class="wimscenter wimsnoborder"><tr> |
||
13796 | bpr | 149 | !for tmp=1 to $rg__cnt |
13908 | bpr | 150 | !set rg__=$rg__<tr><td>$(rg1__[$tmp])</td><td style="min-width:30px;text-align:left">•</td><td style="min-width:30px;text-align:right">•</td><td>$(rg2__[$(rg_2_[$tmp])])</td></tr> |
151 | !set rgg_=$rgg_<tr><td>$(rg1__[$tmp])</td><td>\(\longleftrightarrow\)</td><td>$(rg2__[$tmp])</td></tr> |
||
13796 | bpr | 152 | !next |
153 | !set rg__=$rg__</tr></table> |
||
154 | !set rg_=$rgg_</tr></table> |
||
16938 | bpr | 155 | !!FIXME latex version |
14006 | bpr | 156 | Rg$iii=!append line $(rg__) to $(Rg$iii) |
13723 | bpr | 157 | !goto endRg |
12325 | bpr | 158 | !endif |
13798 | bpr | 159 | !if $(replytype$k) iswordof draw |
160 | rg__=$(rg_[2;]) |
||
161 | tmp=!item 1 of $rg__ |
||
162 | !if $tmp=arrows |
||
13880 | bpr | 163 | arrow_head=!getopt arrowhead in $(replyoption$k) |
13798 | bpr | 164 | !default arrow_head=10 |
165 | comp=,$arrow_head |
||
166 | !endif |
||
167 | rg__=!replace internal $tmp by $tmp blue$comp in $rg__ |
||
168 | !reset comp |
||
169 | rg_=!declosing $(rg_[1;]) |
||
13801 | bpr | 170 | !! FIXME inputsize is in the field embed not accessible here |
13798 | bpr | 171 | rg_=200,200$ $ $rg_ |
172 | !readproc oef/canvasdraw.phtml $rg_ |
||
173 | canvasdraw=!replace internal $\ |
||
174 | $ by in $canvasdraw_out |
||
14006 | bpr | 175 | Rg$iii=!append line $canvasdraw to $(Rg$iii) |
13798 | bpr | 176 | !readproc oef/canvasdraw.phtml $rg_$ $ $rg__ |
177 | rg_=!replace internal $\ |
||
178 | $ by in $canvasdraw_out |
||
179 | !goto endRg |
||
180 | !endif |
||
14006 | bpr | 181 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13723 | bpr | 182 | :endRg |
12325 | bpr | 183 | !if $conditioncnt<1 |
13892 | bpr | 184 | tmp=!replace internal , by , in $(replyname$k) |
14006 | bpr | 185 | Replyname$iii=$(Replyname$iii)$tmp, |
12325 | bpr | 186 | !if noanalyzeprint notwordof $(replyoption$k) |
187 | !if $(replyname$k)$rg_ != |
||
188 | !if http isin $(replyname$k)$rg_ |
||
13798 | bpr | 189 | rep=$rg_ |
16938 | bpr | 190 | replatex= |
12325 | bpr | 191 | !else |
192 | !if $(replyname$k)!= |
||
193 | rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep |
||
16939 | bpr | 194 | replatex=!append line $(replyname$k) : \verb£ $rg_ £ to $replatex |
12325 | bpr | 195 | !else |
196 | rep=!append line $rg_ to $rep |
||
16939 | bpr | 197 | replatex=!append line \verb£ $rg_ £ to $replatex |
13799 | bpr | 198 | !endif |
13794 | bpr | 199 | !endif |
200 | !endif |
||
201 | !endif |
||
202 | !endif |
||
12348 | bpr | 203 | !else |
14006 | bpr | 204 | Replytype$iii=!append item $(replytype$k) to $(Replytype$iii) |
205 | Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii) |
||
12348 | bpr | 206 | !endif r$k isitemof $thisstep |
207 | !reset replyoption$k |
||
208 | !next k |
||
13876 | bpr | 209 | !endif |
12348 | bpr | 210 | rep=!imgrename $rep |
14006 | bpr | 211 | ans_$iii=!trim $rep |
16938 | bpr | 212 | anslatex_$iii=!trim $replatex |
14006 | bpr | 213 | !if $(ans_$iii)!= |
12325 | bpr | 214 | test_print=1 |
215 | !endif |
||
13876 | bpr | 216 | !endif |
12325 | bpr | 217 | !reset intro_check |
14006 | bpr | 218 | Rg$iii=!imgrename $(Rg$iii) |
12325 | bpr | 219 | !if $latex_exists>=0 |
220 | !readproc oef/latex.proc exo |
||
874 | bpr | 221 | !endif |