Subversion Repositories wimsdev

Rev

Rev 16939 | 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=
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
13907 bpr 107
          !if $(replytype$k) iswordof function default equation sigunits numexp\
108
            or $(replystyle$k) iswordof numeric text
12325 bpr 109
            rg_=!item 1 of $rg_
14006 bpr 110
            Rg$iii=!append line $prompt_empty to $(Rg$iii)
13723 bpr 111
            !goto endRg
13801 bpr 112
          !endif
13799 bpr 113
          !if $(replytype$k) iswordof imgcomp textcomp compose reorder
12325 bpr 114
            rg_=!translate internal | to $\
20 reyssat 115
$ in $rg_
12325 bpr 116
            rg_=!rows2lines $rg_
14008 bpr 117
            rg_=!nonempty lines $rg_
118
            !! due to , in math mode for example
119
            rg_tmp=!items2lines $rg_
120
            rg_tmp=!replace internal , by &#44; in $rg_tmp
121
            rg_tmp=!lines2items $rg_tmp
14436 bpr 122
            !if ?analyze isin $(rg_tmp[1])
123
              rg_tmp=!item 2 to -1 of $rg_tmp
124
            !endif
12325 bpr 125
            rg_=!line 1 of $rg_
126
            !if $(replytype$k)=imgcomp
127
              rg_=!item 2 to -1 of $rg_
128
              rg_=!nospace $rg_
17176 bpr 129
              rg_=!replace , by ">,<img src="$imagedir/ in <img src="$imagedir/$rg_">
12325 bpr 130
              rg__=!shuffle $rg_
14006 bpr 131
              Rg$iii=!append line $rg__ to $(Rg$iii)
12325 bpr 132
            !else
13788 bpr 133
              rg_cnt_=!itemcnt $rg_tmp
12325 bpr 134
              rg__=!shuffle $rg_cnt_
13788 bpr 135
              rg_tmp=!listuniq $(rg_tmp[$rg__])
14006 bpr 136
              Rg$iii=!append line $rg_tmp to $(Rg$iii)
13799 bpr 137
            !endif
12325 bpr 138
            rg_=!translate , to $ $ in $rg_
13876 bpr 139
            !goto endRg
13799 bpr 140
          !endif
12325 bpr 141
          !if $(replytype$k) iswordof correspond
13876 bpr 142
            !set rg__=!rows2lines $rg_
12325 bpr 143
            !distribute lines $rg__ into rg1__,rg2__
144
            !set rg__cnt=!itemcnt $rg1__
145
            !set rg_2_=!shuffle $rg__cnt
13908 bpr 146
            !set rg__=<table class="wimscenter wimsnoborder"><tr>
147
            !set rgg_=<table class="wimscenter wimsnoborder"><tr>
13796 bpr 148
            !for tmp=1 to $rg__cnt
13908 bpr 149
              !set rg__=$rg__<tr><td>$(rg1__[$tmp])</td><td style="min-width:30px;text-align:left">&bullet;</td><td style="min-width:30px;text-align:right">&bullet;</td><td>$(rg2__[$(rg_2_[$tmp])])</td></tr>
150
              !set rgg_=$rgg_<tr><td>$(rg1__[$tmp])</td><td>\(\longleftrightarrow\)</td><td>$(rg2__[$tmp])</td></tr>
13796 bpr 151
            !next
152
            !set rg__=$rg__</tr></table>
153
            !set rg_=$rgg_</tr></table>
16938 bpr 154
            !!FIXME latex version
14006 bpr 155
            Rg$iii=!append line $(rg__) to $(Rg$iii)
13723 bpr 156
            !goto endRg
12325 bpr 157
          !endif
13798 bpr 158
          !if $(replytype$k) iswordof draw
159
            rg__=$(rg_[2;])
160
            tmp=!item 1 of $rg__
161
            !if $tmp=arrows
13880 bpr 162
              arrow_head=!getopt arrowhead in $(replyoption$k)
13798 bpr 163
              !default arrow_head=10
164
              comp=,$arrow_head
165
            !endif
166
            rg__=!replace internal $tmp by $tmp blue$comp in $rg__
167
            !reset comp
168
            rg_=!declosing $(rg_[1;])
13801 bpr 169
            !! FIXME inputsize is in the field embed not accessible here
13798 bpr 170
            rg_=200,200$	$ $rg_
171
            !readproc oef/canvasdraw.phtml $rg_
172
            canvasdraw=!replace internal $\
173
$ by in $canvasdraw_out
14006 bpr 174
            Rg$iii=!append line $canvasdraw to $(Rg$iii)
13798 bpr 175
            !readproc oef/canvasdraw.phtml $rg_$	$ $rg__
176
            rg_=!replace internal $\
177
$ by in $canvasdraw_out
178
            !goto endRg
179
          !endif
14006 bpr 180
          Rg$iii=!append line $prompt_empty to $(Rg$iii)
13723 bpr 181
:endRg
12325 bpr 182
          !if $conditioncnt<1
13892 bpr 183
            tmp=!replace internal , by &#44; in $(replyname$k)
14006 bpr 184
            Replyname$iii=$(Replyname$iii)$tmp,
12325 bpr 185
            !if noanalyzeprint notwordof $(replyoption$k)
186
              !if $(replyname$k)$rg_ !=
187
                !if http isin $(replyname$k)$rg_
13798 bpr 188
                  rep=$rg_
16938 bpr 189
                  replatex=
12325 bpr 190
                !else
191
                  !if $(replyname$k)!=
192
                    rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep
16939 bpr 193
                    replatex=!append line $(replyname$k) : \verb£ $rg_ £ to $replatex
12325 bpr 194
                  !else
195
                    rep=!append line $rg_ to $rep
16939 bpr 196
                    replatex=!append line \verb£ $rg_ £ to $replatex
13799 bpr 197
                  !endif
13794 bpr 198
                !endif
199
              !endif
200
            !endif
201
          !endif
12348 bpr 202
        !else
14006 bpr 203
          Replytype$iii=!append item $(replytype$k) to $(Replytype$iii)
204
          Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii)
12348 bpr 205
        !endif r$k isitemof $thisstep
206
        !reset replyoption$k
207
      !next k
13876 bpr 208
    !endif
12348 bpr 209
    rep=!imgrename $rep
14006 bpr 210
    ans_$iii=!trim $rep
16938 bpr 211
    anslatex_$iii=!trim $replatex
14006 bpr 212
    !if $(ans_$iii)!=
12325 bpr 213
      test_print=1
214
    !endif
13876 bpr 215
  !endif
12325 bpr 216
  !reset intro_check
14006 bpr 217
  Rg$iii=!imgrename $(Rg$iii)
12325 bpr 218
  !if $latex_exists>=0
219
    !readproc oef/latex.proc exo
874 bpr 220
  !endif