Rev 13794 | Rev 13796 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !advance prcnt |
2 | !if $prcnt>6 and $wims_user!=supervisor |
||
12325 | bpr | 3 | error=too_many_print |
4 | printing=yes |
||
5 | !exit |
||
20 | reyssat | 6 | !endif |
7 | |||
8 | printmax=40 |
||
9 | !reset savedrawcnt print |
||
10 | printing=yes |
||
11 | exo=!listintersect $exo and $exolist |
||
12 | !default exo=$defaultlist |
||
2650 | bpr | 13 | wims_intro_parm=$exo |
2646 | bpr | 14 | !default exo=$exolist |
15 | exo_cnt=!itemcnt $exo |
||
16 | !!at least 1 exercise of each type |
||
13764 | bpr | 17 | !if $random=0 |
18 | exo_=!makelist x for x=1 to $exo_cnt |
||
19 | !else |
||
20 | exo_=!shuffle $exo_cnt |
||
21 | !endif |
||
2646 | bpr | 22 | qnum1=$[$qnum-$exo_cnt] |
23 | !if $qnum1 >= 1 |
||
12325 | bpr | 24 | exo__=!randint 1,$exo_cnt repeat $qnum1 |
25 | exo_=$exo_,$exo__ |
||
2646 | bpr | 26 | !endif |
27 | exo=$(exo[$(exo_)]) |
||
20 | reyssat | 28 | exo=!item 1 to $printmax of $exo |
29 | n=!itemcnt $exo |
||
30 | |||
31 | !if $n<1 |
||
12325 | bpr | 32 | !exit |
20 | reyssat | 33 | !endif |
34 | |||
35 | M=0 |
||
36 | m_step=1 |
||
874 | bpr | 37 | test_print=0 |
2656 | bpr | 38 | !if $wims_developer!= or $wims_user=supervisor |
39 | latex_exists=0 |
||
40 | !readproc oef/latex.proc begin |
||
41 | !else |
||
42 | latex_exists=-1 |
||
43 | !endif |
||
44 | |||
20 | reyssat | 45 | !for i=1 to $n |
12325 | bpr | 46 | question_$i= |
47 | e_=!item $i of $exo |
||
48 | name_$i=$e_ |
||
49 | !if $lang_choice!=$empty |
||
50 | title_$i=!defof title_$lang_choice in $(class_header)def/$e_.def |
||
51 | !else |
||
52 | title_$i=!defof title_$lang in $(class_header)def/$e_.def |
||
53 | !endif |
||
54 | !if $(title_$i)=$empty |
||
55 | title_$i=!defof title in $(class_header)def/$e_.def |
||
56 | !endif |
||
57 | !reset question testcondition format |
||
58 | thisexo=$e_ |
||
59 | !readproc oef/imagedir.proc |
||
60 | varcnt=!defof varcnt in $(class_header)def/$e_.def |
||
61 | !default varcnt=0 |
||
62 | !for v=2 to $varcnt+5 |
||
63 | val$v= |
||
64 | !next v |
||
65 | status=prep |
||
66 | !read $(class_header)def/$e_.def |
||
67 | !if $format=html |
||
68 | question_$i=$question |
||
69 | !if __EXECUTED_ isin $question |
||
70 | varcnt_$i=$varcnt |
||
71 | var_$i=$val1 |
||
72 | !for v=2 to $varcnt+5 |
||
73 | v_=!translate internal $\ |
||
20 | reyssat | 74 | $ to $ $ in $(val$v) |
12325 | bpr | 75 | var_$i=$(var_$i)\ |
20 | reyssat | 76 | $v_ |
12325 | bpr | 77 | !next v |
78 | !endif __EXECUTED_ |
||
79 | !ifval $replycnt=0 and $choicecnt=1 |
||
80 | rep=!item 1 to 6 of $choicebad1 |
||
81 | rep=!append item $choicegood1 to $rep |
||
82 | rep=!listuniq $rep |
||
83 | rep=!sort items $rep |
||
84 | rep=!replace , by </li><li> in <ul style="list-style-type: square;"><li>$rep</li></ul> |
||
85 | chce_$i=$rep |
||
86 | test_print=1 |
||
87 | !else |
||
88 | chce_$i= |
||
89 | !endif replycnt=0 and choicecnt=1 |
||
90 | rep= |
||
12460 | bpr | 91 | !!FIXME |
12325 | bpr | 92 | !if 3 isin $intro_check or $intro_check=$empty |
93 | !for k=1 to $choicecnt |
||
94 | !if $(choicename$k)!= |
||
95 | rep=!append line <em>$(choicename$k)</em>: $(choicegood$k) to $rep |
||
96 | !else |
||
97 | rep=!append line $(choicegood$k) to $rep |
||
98 | !endif |
||
99 | !next k |
||
100 | !for k=1 to $replycnt |
||
101 | thisstep=!line 1 of $oefsteps |
||
102 | !if r$k isitemof $thisstep or $oefsteps=$empty |
||
103 | rg_=$(replygood$k) |
||
104 | Replytype$i=!append item $(replytype$k) to $(Replytype$i) |
||
105 | Replystyle$i=!append item $anstyle to $(Replystyle$i) |
||
106 | !if $(replytype$k) iswordof checkbox mark click menu radio clickfill dragfill |
||
107 | rg_=!translate internal ; to $\ |
||
20 | reyssat | 108 | $ in $rg_ |
12325 | bpr | 109 | rg1_=!line 1 of $rg_ |
110 | rg2_=!line 2 to -1 of $rg_ |
||
111 | rg2_=!translate internal $\ |
||
20 | reyssat | 112 | $ to ; in $rg2_ |
13795 | bpr | 113 | !if $(replytype$k) iswordof checkbox mark click menu radio |
13794 | bpr | 114 | rg_=!item $rg1_ of $rg2_ |
115 | !else |
||
116 | rg_=$rg1_ |
||
117 | !endif |
||
13788 | bpr | 118 | rg_tmp=$rg2_ |
13793 | bpr | 119 | !if $(replytype$k) iswordof clickfill dragfill |
13788 | bpr | 120 | rg_tmp=!listuniq $rg1_,$rg2_ |
121 | !endif |
||
122 | Rg$i=!append line $rg_tmp to $(Rg$i) |
||
13723 | bpr | 123 | !goto endRg |
12325 | bpr | 124 | !endif checkbox |
125 | !if $(replytype$k) iswordof atext wlist nocase case |
||
126 | rg_=!translate internal ;| to $\ |
||
20 | reyssat | 127 | \ |
128 | $ in $rg_ |
||
12325 | bpr | 129 | rg_=!line 1 of $rg_ |
130 | !endif atext |
||
131 | !if $(replytype$k) iswordof function default equation |
||
132 | rg_=!item 1 of $rg_ |
||
133 | Rg$i=!append line $ to $(Rg$i) |
||
13723 | bpr | 134 | !goto endRg |
12325 | bpr | 135 | !endif function |
136 | !if $(replytype$k) iswordof imgcomp textcomp compose reorder \ |
||
137 | dragfill clickfill |
||
138 | rg_=!translate internal | to $\ |
||
20 | reyssat | 139 | $ in $rg_ |
12325 | bpr | 140 | rg_=!rows2lines $rg_ |
13788 | bpr | 141 | rg_tmp=!lines2items $rg_ |
12325 | bpr | 142 | rg_=!line 1 of $rg_ |
143 | !if $(replytype$k)=imgcomp |
||
144 | rg_=!item 2 to -1 of $rg_ |
||
145 | rg_=!nospace $rg_ |
||
146 | rg_=!replace , by " />,<img src="$imagedir/ in <img src="$imagedir/$rg_" /> |
||
147 | rg__=!shuffle $rg_ |
||
148 | Rg$i=!append line $rg__ to $(Rg$i) |
||
149 | !else |
||
13788 | bpr | 150 | rg_cnt_=!itemcnt $rg_tmp |
12325 | bpr | 151 | rg__=!shuffle $rg_cnt_ |
13788 | bpr | 152 | rg_tmp=!listuniq $(rg_tmp[$rg__]) |
153 | Rg$i=!append line $rg_tmp to $(Rg$i) |
||
13723 | bpr | 154 | !goto endRg |
13788 | bpr | 155 | !endif imgcomp |
12325 | bpr | 156 | rg_=!translate , to $ $ in $rg_ |
157 | !endif imgcomp textcomp |
||
158 | !if $(replytype$k) iswordof correspond |
||
159 | !set rg__=!replace internal ; by $\ |
||
3134 | bpr | 160 | $ in $rg_ |
12325 | bpr | 161 | !distribute lines $rg__ into rg1__,rg2__ |
162 | !set rg__cnt=!itemcnt $rg1__ |
||
163 | !set rg_2_=!shuffle $rg__cnt |
||
164 | !set rg__=!replace internal , by </td><td> in <table class="wimsborder"><tr><td>$rg1__</td></tr><tr><td>$(rg2__[$rg_2_])</td></tr></table> |
||
165 | !set rg_=!replace internal , by </td><td> in <table class="wimsborder"><tr><td>$(rg_[1;])</td></tr><tr><td>$(rg_[2;])</td></tr></table> |
||
3134 | bpr | 166 | $prompt_ |
12325 | bpr | 167 | Rg$i=!append line $(rg__) to $(Rg$i) |
13723 | bpr | 168 | !goto endRg |
12325 | bpr | 169 | !endif |
13723 | bpr | 170 | Rg$i=!append line empty to $(Rg$i) |
171 | :endRg |
||
12325 | bpr | 172 | !if $conditioncnt<1 |
173 | !if noanalyzeprint notwordof $(replyoption$k) |
||
174 | !if $(replyname$k)$rg_ != |
||
175 | !if http isin $(replyname$k)$rg_ |
||
176 | rep=!append line $name_noprint to $rep |
||
177 | !else |
||
178 | !if $(replyname$k)!= |
||
179 | rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep |
||
180 | !else |
||
181 | rep=!append line $rg_ to $rep |
||
182 | !endif replyname$k nonempty |
||
13794 | bpr | 183 | !endif |
184 | !endif |
||
185 | !endif |
||
186 | !endif |
||
12348 | bpr | 187 | !else |
188 | Replytype$i=!append item $(replytype$k) to $(Replytype$i) |
||
189 | Replystyle$i=!append item $(replystyle$k) to $(Replystyle$i) |
||
190 | !endif r$k isitemof $thisstep |
||
191 | !reset replyoption$k |
||
192 | !next k |
||
193 | !endif intro_check |
||
194 | rep=!imgrename $rep |
||
195 | ans_$i=!trim $rep |
||
12325 | bpr | 196 | !if $(ans_$i)!= |
197 | test_print=1 |
||
198 | !endif |
||
199 | !endif html |
||
200 | !reset intro_check |
||
201 | !if $latex_exists>=0 |
||
202 | !readproc oef/latex.proc exo |
||
874 | bpr | 203 | !endif |
12325 | bpr | 204 | Rg$i=!imgrename $(Rg$i) |
20 | reyssat | 205 | !next i |
2656 | bpr | 206 | !if $latex_exists>=1 |
207 | !readproc oef/latex.proc end |
||
3128 | bpr | 208 | !endif |