Rev 14008 | Rev 16938 | Go to most recent revision | 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= |
12460 | bpr | 44 | !!FIXME |
12325 | bpr | 45 | !if 3 isin $intro_check or $intro_check=$empty |
46 | !for k=1 to $choicecnt |
||
47 | !if $(choicename$k)!= |
||
48 | rep=!append line <em>$(choicename$k)</em>: $(choicegood$k) to $rep |
||
49 | !else |
||
50 | rep=!append line $(choicegood$k) to $rep |
||
51 | !endif |
||
52 | !next k |
||
53 | !for k=1 to $replycnt |
||
54 | thisstep=!line 1 of $oefsteps |
||
55 | !if r$k isitemof $thisstep or $oefsteps=$empty |
||
56 | rg_=$(replygood$k) |
||
13890 | bpr | 57 | !reset anstyle |
58 | !readproc anstype/$(replytype$k).input def |
||
13907 | bpr | 59 | replystyle$k=$anstyle |
14006 | bpr | 60 | Replytype$iii=!append item $(replytype$k) to $(Replytype$iii) |
61 | Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii) |
||
13890 | bpr | 62 | |
14006 | bpr | 63 | !if $(replytype$k) iswordof flashcard time crossword |
64 | question_$iii= |
||
13890 | bpr | 65 | !reset rg_ |
14006 | bpr | 66 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13890 | bpr | 67 | !goto endRg |
68 | !endif |
||
13880 | bpr | 69 | !if $(replytype$k) iswordof checkbox click mark menu radio clickfill dragfill multipleclick |
13810 | bpr | 70 | rg_=!rows2lines $rg_ |
12325 | bpr | 71 | rg1_=!line 1 of $rg_ |
72 | rg2_=!line 2 to -1 of $rg_ |
||
73 | rg2_=!translate internal $\ |
||
20 | reyssat | 74 | $ to ; in $rg2_ |
13880 | bpr | 75 | !if $(replytype$k) iswordof checkbox click mark menu radio |
13794 | bpr | 76 | rg_=!item $rg1_ of $rg2_ |
77 | !else |
||
78 | rg_=$rg1_ |
||
79 | !endif |
||
13788 | bpr | 80 | rg_tmp=$rg2_ |
13793 | bpr | 81 | !if $(replytype$k) iswordof clickfill dragfill |
13890 | bpr | 82 | !if ?analyze notin $rg1_ |
83 | rg_tmp=!listuniq $rg1_,$rg2_ |
||
84 | !else |
||
85 | rg_tmp=$rg2_ |
||
86 | !endif |
||
13788 | bpr | 87 | !endif |
14006 | bpr | 88 | Rg$iii=!append line $rg_tmp to $(Rg$iii) |
13723 | bpr | 89 | !goto endRg |
13816 | bpr | 90 | !endif |
13798 | bpr | 91 | !if $(replytype$k) iswordof coord |
92 | rg_=<img src="$(rg_[1;])" /> |
||
14006 | bpr | 93 | Rg$iii=!append line $rg_ to $(Rg$iii) |
13798 | bpr | 94 | !goto endRg |
95 | !endif |
||
12325 | bpr | 96 | !if $(replytype$k) iswordof atext wlist nocase case |
97 | rg_=!translate internal ;| to $\ |
||
20 | reyssat | 98 | \ |
99 | $ in $rg_ |
||
12325 | bpr | 100 | rg_=!line 1 of $rg_ |
14006 | bpr | 101 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13876 | bpr | 102 | !goto endRg |
13816 | bpr | 103 | !endif |
13907 | bpr | 104 | !if $(replytype$k) iswordof function default equation sigunits numexp\ |
105 | or $(replystyle$k) iswordof numeric text |
||
12325 | bpr | 106 | rg_=!item 1 of $rg_ |
14006 | bpr | 107 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13723 | bpr | 108 | !goto endRg |
13801 | bpr | 109 | !endif |
13799 | bpr | 110 | !if $(replytype$k) iswordof imgcomp textcomp compose reorder |
12325 | bpr | 111 | rg_=!translate internal | to $\ |
20 | reyssat | 112 | $ in $rg_ |
12325 | bpr | 113 | rg_=!rows2lines $rg_ |
14008 | bpr | 114 | rg_=!nonempty lines $rg_ |
115 | !! due to , in math mode for example |
||
116 | rg_tmp=!items2lines $rg_ |
||
117 | rg_tmp=!replace internal , by , in $rg_tmp |
||
118 | rg_tmp=!lines2items $rg_tmp |
||
14436 | bpr | 119 | !if ?analyze isin $(rg_tmp[1]) |
120 | rg_tmp=!item 2 to -1 of $rg_tmp |
||
121 | !endif |
||
12325 | bpr | 122 | rg_=!line 1 of $rg_ |
123 | !if $(replytype$k)=imgcomp |
||
124 | rg_=!item 2 to -1 of $rg_ |
||
125 | rg_=!nospace $rg_ |
||
126 | rg_=!replace , by " />,<img src="$imagedir/ in <img src="$imagedir/$rg_" /> |
||
127 | rg__=!shuffle $rg_ |
||
14006 | bpr | 128 | Rg$iii=!append line $rg__ to $(Rg$iii) |
12325 | bpr | 129 | !else |
13788 | bpr | 130 | rg_cnt_=!itemcnt $rg_tmp |
12325 | bpr | 131 | rg__=!shuffle $rg_cnt_ |
13788 | bpr | 132 | rg_tmp=!listuniq $(rg_tmp[$rg__]) |
14006 | bpr | 133 | Rg$iii=!append line $rg_tmp to $(Rg$iii) |
13799 | bpr | 134 | !endif |
12325 | bpr | 135 | rg_=!translate , to $ $ in $rg_ |
13876 | bpr | 136 | !goto endRg |
13799 | bpr | 137 | !endif |
12325 | bpr | 138 | !if $(replytype$k) iswordof correspond |
13876 | bpr | 139 | !set rg__=!rows2lines $rg_ |
12325 | bpr | 140 | !distribute lines $rg__ into rg1__,rg2__ |
141 | !set rg__cnt=!itemcnt $rg1__ |
||
142 | !set rg_2_=!shuffle $rg__cnt |
||
13908 | bpr | 143 | !set rg__=<table class="wimscenter wimsnoborder"><tr> |
144 | !set rgg_=<table class="wimscenter wimsnoborder"><tr> |
||
13796 | bpr | 145 | !for tmp=1 to $rg__cnt |
13908 | bpr | 146 | !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> |
147 | !set rgg_=$rgg_<tr><td>$(rg1__[$tmp])</td><td>\(\longleftrightarrow\)</td><td>$(rg2__[$tmp])</td></tr> |
||
13796 | bpr | 148 | !next |
149 | !set rg__=$rg__</tr></table> |
||
150 | !set rg_=$rgg_</tr></table> |
||
14006 | bpr | 151 | Rg$iii=!append line $(rg__) to $(Rg$iii) |
13723 | bpr | 152 | !goto endRg |
12325 | bpr | 153 | !endif |
13798 | bpr | 154 | !if $(replytype$k) iswordof draw |
155 | rg__=$(rg_[2;]) |
||
156 | tmp=!item 1 of $rg__ |
||
157 | !if $tmp=arrows |
||
13880 | bpr | 158 | arrow_head=!getopt arrowhead in $(replyoption$k) |
13798 | bpr | 159 | !default arrow_head=10 |
160 | comp=,$arrow_head |
||
161 | !endif |
||
162 | rg__=!replace internal $tmp by $tmp blue$comp in $rg__ |
||
163 | !reset comp |
||
164 | rg_=!declosing $(rg_[1;]) |
||
13801 | bpr | 165 | !! FIXME inputsize is in the field embed not accessible here |
13798 | bpr | 166 | rg_=200,200$ $ $rg_ |
167 | !readproc oef/canvasdraw.phtml $rg_ |
||
168 | canvasdraw=!replace internal $\ |
||
169 | $ by in $canvasdraw_out |
||
14006 | bpr | 170 | Rg$iii=!append line $canvasdraw to $(Rg$iii) |
13798 | bpr | 171 | !readproc oef/canvasdraw.phtml $rg_$ $ $rg__ |
172 | rg_=!replace internal $\ |
||
173 | $ by in $canvasdraw_out |
||
174 | !goto endRg |
||
175 | !endif |
||
14006 | bpr | 176 | Rg$iii=!append line $prompt_empty to $(Rg$iii) |
13723 | bpr | 177 | :endRg |
12325 | bpr | 178 | !if $conditioncnt<1 |
13892 | bpr | 179 | tmp=!replace internal , by , in $(replyname$k) |
14006 | bpr | 180 | Replyname$iii=$(Replyname$iii)$tmp, |
12325 | bpr | 181 | !if noanalyzeprint notwordof $(replyoption$k) |
182 | !if $(replyname$k)$rg_ != |
||
183 | !if http isin $(replyname$k)$rg_ |
||
13798 | bpr | 184 | rep=$rg_ |
12325 | bpr | 185 | !else |
186 | !if $(replyname$k)!= |
||
187 | rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep |
||
188 | !else |
||
189 | rep=!append line $rg_ to $rep |
||
13799 | bpr | 190 | !endif |
13794 | bpr | 191 | !endif |
192 | !endif |
||
193 | !endif |
||
194 | !endif |
||
12348 | bpr | 195 | !else |
14006 | bpr | 196 | Replytype$iii=!append item $(replytype$k) to $(Replytype$iii) |
197 | Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii) |
||
12348 | bpr | 198 | !endif r$k isitemof $thisstep |
199 | !reset replyoption$k |
||
200 | !next k |
||
13876 | bpr | 201 | !endif |
12348 | bpr | 202 | rep=!imgrename $rep |
14006 | bpr | 203 | ans_$iii=!trim $rep |
204 | !if $(ans_$iii)!= |
||
12325 | bpr | 205 | test_print=1 |
206 | !endif |
||
13876 | bpr | 207 | !endif |
12325 | bpr | 208 | !reset intro_check |
14006 | bpr | 209 | Rg$iii=!imgrename $(Rg$iii) |
12325 | bpr | 210 | !if $latex_exists>=0 |
211 | !readproc oef/latex.proc exo |
||
874 | bpr | 212 | !endif |