Subversion Repositories wimsdev

Rev

Rev 14006 | Rev 14436 | 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 &#44; in $rg_tmp
118
            rg_tmp=!lines2items $rg_tmp
12325 bpr 119
            rg_=!line 1 of $rg_
120
            !if $(replytype$k)=imgcomp
121
              rg_=!item 2 to -1 of $rg_
122
              rg_=!nospace $rg_
123
              rg_=!replace , by " />,<img src="$imagedir/ in <img src="$imagedir/$rg_" />
124
              rg__=!shuffle $rg_
14006 bpr 125
              Rg$iii=!append line $rg__ to $(Rg$iii)
12325 bpr 126
            !else
13788 bpr 127
              rg_cnt_=!itemcnt $rg_tmp
12325 bpr 128
              rg__=!shuffle $rg_cnt_
13788 bpr 129
              rg_tmp=!listuniq $(rg_tmp[$rg__])
14006 bpr 130
              Rg$iii=!append line $rg_tmp to $(Rg$iii)
13799 bpr 131
            !endif
12325 bpr 132
            rg_=!translate , to $ $ in $rg_
13876 bpr 133
            !goto endRg
13799 bpr 134
          !endif
12325 bpr 135
          !if $(replytype$k) iswordof correspond
13876 bpr 136
            !set rg__=!rows2lines $rg_
12325 bpr 137
            !distribute lines $rg__ into rg1__,rg2__
138
            !set rg__cnt=!itemcnt $rg1__
139
            !set rg_2_=!shuffle $rg__cnt
13908 bpr 140
            !set rg__=<table class="wimscenter wimsnoborder"><tr>
141
            !set rgg_=<table class="wimscenter wimsnoborder"><tr>
13796 bpr 142
            !for tmp=1 to $rg__cnt
13908 bpr 143
              !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>
144
              !set rgg_=$rgg_<tr><td>$(rg1__[$tmp])</td><td>\(\longleftrightarrow\)</td><td>$(rg2__[$tmp])</td></tr>
13796 bpr 145
            !next
146
            !set rg__=$rg__</tr></table>
147
            !set rg_=$rgg_</tr></table>
14006 bpr 148
            Rg$iii=!append line $(rg__) to $(Rg$iii)
13723 bpr 149
            !goto endRg
12325 bpr 150
          !endif
13798 bpr 151
          !if $(replytype$k) iswordof draw
152
            rg__=$(rg_[2;])
153
            tmp=!item 1 of $rg__
154
            !if $tmp=arrows
13880 bpr 155
              arrow_head=!getopt arrowhead in $(replyoption$k)
13798 bpr 156
              !default arrow_head=10
157
              comp=,$arrow_head
158
            !endif
159
            rg__=!replace internal $tmp by $tmp blue$comp in $rg__
160
            !reset comp
161
            rg_=!declosing $(rg_[1;])
13801 bpr 162
            !! FIXME inputsize is in the field embed not accessible here
13798 bpr 163
            rg_=200,200$	$ $rg_
164
            !readproc oef/canvasdraw.phtml $rg_
165
            canvasdraw=!replace internal $\
166
$ by in $canvasdraw_out
14006 bpr 167
            Rg$iii=!append line $canvasdraw to $(Rg$iii)
13798 bpr 168
            !readproc oef/canvasdraw.phtml $rg_$	$ $rg__
169
            rg_=!replace internal $\
170
$ by in $canvasdraw_out
171
            !goto endRg
172
          !endif
14006 bpr 173
          Rg$iii=!append line $prompt_empty to $(Rg$iii)
13723 bpr 174
:endRg
12325 bpr 175
          !if $conditioncnt<1
13892 bpr 176
            tmp=!replace internal , by &#44; in $(replyname$k)
14006 bpr 177
            Replyname$iii=$(Replyname$iii)$tmp,
12325 bpr 178
            !if noanalyzeprint notwordof $(replyoption$k)
179
              !if $(replyname$k)$rg_ !=
180
                !if http isin $(replyname$k)$rg_
13798 bpr 181
                  rep=$rg_
12325 bpr 182
                !else
183
                  !if $(replyname$k)!=
184
                    rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep
185
                  !else
186
                    rep=!append line $rg_ to $rep
13799 bpr 187
                  !endif
13794 bpr 188
                !endif
189
              !endif
190
            !endif
191
          !endif
12348 bpr 192
        !else
14006 bpr 193
          Replytype$iii=!append item $(replytype$k) to $(Replytype$iii)
194
          Replystyle$iii=!append item $(replystyle$k) to $(Replystyle$iii)
12348 bpr 195
        !endif r$k isitemof $thisstep
196
        !reset replyoption$k
197
      !next k
13876 bpr 198
    !endif
12348 bpr 199
    rep=!imgrename $rep
14006 bpr 200
    ans_$iii=!trim $rep
201
    !if $(ans_$iii)!=
12325 bpr 202
      test_print=1
203
    !endif
13876 bpr 204
  !endif
12325 bpr 205
  !reset intro_check
14006 bpr 206
  Rg$iii=!imgrename $(Rg$iii)
12325 bpr 207
  !if $latex_exists>=0
208
    !readproc oef/latex.proc exo
874 bpr 209
  !endif