Subversion Repositories wimsdev

Rev

Rev 13908 | Rev 14006 | 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
13898 bpr 16
    embedcnt$i=$embedcnt
13923 bpr 17
    oefcss_$i=$oefcss
13880 bpr 18
  !endif
19
  wims_prefix=$wims_prefix_
12325 bpr 20
  !if $format=html
21
    question_$i=$question
22
    !if __EXECUTED_ isin $question
23
      varcnt_$i=$varcnt
24
      var_$i=$val1
25
      !for v=2 to $varcnt+5
26
        v_=!translate internal $\
20 reyssat 27
$ to $	$ in $(val$v)
12325 bpr 28
        var_$i=$(var_$i)\
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>
12325 bpr 38
      chce_$i=$rep
39
      test_print=1
40
    !else
41
      chce_$i=
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
12325 bpr 60
          Replytype$i=!append item $(replytype$k) to $(Replytype$i)
13890 bpr 61
          Replystyle$i=!append item $(replystyle$k) to $(Replystyle$i)
62
 
63
          !if $(replytype$k) iswordof flashcard
64
            question_$i=
65
            !reset rg_
66
            Rg$i=!append line $prompt_empty to $(Rg$i)
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
88
            Rg$i=!append line $rg_tmp to $(Rg$i)
13723 bpr 89
            !goto endRg
13816 bpr 90
          !endif
13798 bpr 91
          !if $(replytype$k) iswordof coord
92
            rg_=<img src="$(rg_[1;])" />
93
            Rg$i=!append line $rg_ to $(Rg$i)
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_
13876 bpr 101
            !goto endRg
13816 bpr 102
          !endif
13907 bpr 103
          !if $(replytype$k) iswordof function default equation sigunits numexp\
104
            or $(replystyle$k) iswordof numeric text
12325 bpr 105
            rg_=!item 1 of $rg_
13890 bpr 106
            Rg$i=!append line $prompt_empty to $(Rg$i)
13723 bpr 107
            !goto endRg
13801 bpr 108
          !endif
13799 bpr 109
          !if $(replytype$k) iswordof imgcomp textcomp compose reorder
12325 bpr 110
            rg_=!translate internal | to $\
20 reyssat 111
$ in $rg_
12325 bpr 112
            rg_=!rows2lines $rg_
13788 bpr 113
            rg_tmp=!lines2items $rg_
12325 bpr 114
            rg_=!line 1 of $rg_
115
            !if $(replytype$k)=imgcomp
116
              rg_=!item 2 to -1 of $rg_
117
              rg_=!nospace $rg_
118
              rg_=!replace , by " />,<img src="$imagedir/ in <img src="$imagedir/$rg_" />
119
              rg__=!shuffle $rg_
120
              Rg$i=!append line $rg__ to $(Rg$i)
121
            !else
13788 bpr 122
              rg_cnt_=!itemcnt $rg_tmp
12325 bpr 123
              rg__=!shuffle $rg_cnt_
13788 bpr 124
              rg_tmp=!listuniq $(rg_tmp[$rg__])
125
              Rg$i=!append line $rg_tmp to $(Rg$i)
13799 bpr 126
            !endif
12325 bpr 127
            rg_=!translate , to $ $ in $rg_
13876 bpr 128
            !goto endRg
13799 bpr 129
          !endif
12325 bpr 130
          !if $(replytype$k) iswordof correspond
13876 bpr 131
            !set rg__=!rows2lines $rg_
12325 bpr 132
            !distribute lines $rg__ into rg1__,rg2__
133
            !set rg__cnt=!itemcnt $rg1__
134
            !set rg_2_=!shuffle $rg__cnt
13908 bpr 135
            !set rg__=<table class="wimscenter wimsnoborder"><tr>
136
            !set rgg_=<table class="wimscenter wimsnoborder"><tr>
13796 bpr 137
            !for tmp=1 to $rg__cnt
13908 bpr 138
              !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>
139
              !set rgg_=$rgg_<tr><td>$(rg1__[$tmp])</td><td>\(\longleftrightarrow\)</td><td>$(rg2__[$tmp])</td></tr>
13796 bpr 140
            !next
141
            !set rg__=$rg__</tr></table>
142
            !set rg_=$rgg_</tr></table>
12325 bpr 143
            Rg$i=!append line $(rg__) to $(Rg$i)
13723 bpr 144
            !goto endRg
12325 bpr 145
          !endif
13798 bpr 146
          !if $(replytype$k) iswordof draw
147
            rg__=$(rg_[2;])
148
            tmp=!item 1 of $rg__
149
            !if $tmp=arrows
13880 bpr 150
              arrow_head=!getopt arrowhead in $(replyoption$k)
13798 bpr 151
              !default arrow_head=10
152
              comp=,$arrow_head
153
            !endif
154
            rg__=!replace internal $tmp by $tmp blue$comp in $rg__
155
            !reset comp
156
            rg_=!declosing $(rg_[1;])
13801 bpr 157
            !! FIXME inputsize is in the field embed not accessible here
13798 bpr 158
            rg_=200,200$	$ $rg_
159
            !readproc oef/canvasdraw.phtml $rg_
160
            canvasdraw=!replace internal $\
161
$ by in $canvasdraw_out
162
            Rg$i=!append line $canvasdraw to $(Rg$i)
163
            !readproc oef/canvasdraw.phtml $rg_$	$ $rg__
164
            rg_=!replace internal $\
165
$ by in $canvasdraw_out
166
            !goto endRg
167
          !endif
13880 bpr 168
          !if $(replytype$k) iswordof crossword
13890 bpr 169
            Rg$i=!append line $prompt_empty to $(Rg$i)
13880 bpr 170
            !goto endRg
171
          !endif
13890 bpr 172
          Rg$i=!append line $prompt_empty to $(Rg$i)
13723 bpr 173
:endRg
12325 bpr 174
          !if $conditioncnt<1
13892 bpr 175
            tmp=!replace internal , by &#44; in $(replyname$k)
176
            Replyname$i=$(Replyname$i)$tmp,
12325 bpr 177
            !if noanalyzeprint notwordof $(replyoption$k)
178
              !if $(replyname$k)$rg_ !=
179
                !if http isin $(replyname$k)$rg_
13798 bpr 180
                  rep=$rg_
12325 bpr 181
                !else
182
                  !if $(replyname$k)!=
183
                    rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep
184
                  !else
185
                    rep=!append line $rg_ to $rep
13799 bpr 186
                  !endif
13794 bpr 187
                !endif
188
              !endif
189
            !endif
190
          !endif
12348 bpr 191
        !else
192
          Replytype$i=!append item $(replytype$k) to $(Replytype$i)
193
          Replystyle$i=!append item $(replystyle$k) to $(Replystyle$i)
194
        !endif r$k isitemof $thisstep
195
        !reset replyoption$k
196
      !next k
13876 bpr 197
    !endif
12348 bpr 198
    rep=!imgrename $rep
199
    ans_$i=!trim $rep
12325 bpr 200
    !if $(ans_$i)!=
201
      test_print=1
202
    !endif
13876 bpr 203
  !endif
12325 bpr 204
  !reset intro_check
13880 bpr 205
  Rg$i=!imgrename $(Rg$i)
12325 bpr 206
  !if $latex_exists>=0
207
    !readproc oef/latex.proc exo
874 bpr 208
  !endif