Subversion Repositories wimsdev

Rev

Rev 17865 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8654 bpr 1
!reset inputsize
2
!set force_mathml=yes
3
!if $wims_read_parm=$empty
13573 obado 4
  !exit
8654 bpr 5
!endif
6
!if $wims_read_parm=help
13573 obado 7
  !read help/$lang/special/mathmlinput.phtml
8
  !exit
8654 bpr 9
!endif
13896 bpr 10
!set prompt_empty_=\cdots\cdots\cdots
8654 bpr 11
!set parm=!replace internal ,   r by $  r in $wims_read_parm
12
!set parm=!replace internal $   $ by $\
13
$ in $parm
14
 
15
!set code=!item 1 of $parm
16
!set code=!declosing $code
17
 
18
!set inputsize=!item 2 to -1 of $parm
19
!set parm=!line 2 to -1 of $inputsize
20
!set inputsize=!line 1 of $inputsize
8658 bpr 21
 
8777 bpr 22
!if noanswer iswordof $inputsize
13573 obado 23
  !set noanswer=1
8658 bpr 24
!endif
8777 bpr 25
!set inputsize=!item 1 of $inputsize
8658 bpr 26
!set inputsize=!text select 0123456789 in $inputsize
8654 bpr 27
!default inputsize=5
28
!set inputsize=!items2words $inputsize
8725 bpr 29
 
8654 bpr 30
!set parmcnt=!linecnt $parm
8777 bpr 31
!set parm=!sort reverse line $parm
8654 bpr 32
 
8777 bpr 33
!set pretext=!replace internal reply by REPLY in $code
34
 
8725 bpr 35
!for tt = 1 to $parmcnt
13573 obado 36
  !set ld=!line $tt of $parm
37
  !set upcase=!uppercase $(ld[1])
38
  !reset inputsize_tmp
39
  !distribute item $ld into m_,inputsize_tmp,css
40
  !default inputsize_tmp=$inputsize
41
  !set reply_tmp=!nospace $m_
42
  !set rep_tmp=!replace internal reply by r in $reply_tmp
43
  !set n_=!text select 0123456789 in $reply_tmp
44
  !set n_=$[$n_]
45
  !bound n_ between integer 1 and 100 default $
13918 bpr 46
  !if $printing=yes
47
    !set pretext=!replace internal REPLY$n_ by $prompt_empty_ in $pretext
48
  !else
15183 bpr 49
    !if $n_!=$empty and $(replytype$n_) iswordof numeric nocase case atext chemformula \
17865 bpr 50
        range litexp algexp formal equation function raw symtext default aset fset set\
51
        numexp complex
13918 bpr 52
      !set embedded=!append item r$n_ to $embedded
53
      !if debug iswordof $m_oefenv and ?analyze notin $(replygood$n_)
54
        !read oef/special/debug.input $n_
55
      !endif
13884 bpr 56
      !set pretext=!replace internal REPLY$n_ by $ \input{$(inputsize_tmp)}{$n_}{$(css)}{$(reply$n_)}{0} $ in $pretext
18224 bpr 57
      !set hlist=$hlist<input type="hidden" id="reply$n_" name="reply$n_" value="">
13918 bpr 58
      !set formm=$formm document.forms['replyform'].reply$n_.value=document.getElementById("mathml"+$n_).value;
59
      !set nrep=!append item $n_ to $nrep
13884 bpr 60
    !endif
8867 bpr 61
  !endif
8725 bpr 62
!next tt
13884 bpr 63
!if $printing=yes
18224 bpr 64
  \($pretext \)
13884 bpr 65
  !exit
66
!endif
8654 bpr 67
!if $q_form=yes
13573 obado 68
  <script>function read_mathml(){ $formm }</script>
18224 bpr 69
  \( $pretext \)
14604 bpr 70
  $hlist
71
  !reset hlist
13573 obado 72
  !set oef_js_submit=$oef_js_submit read_mathml();
8654 bpr 73
!else
15465 bpr 74
  !if $cmd=hint
75
    !set noanswer=1
76
  !endif
15175 obado 77
  !readproc themes/$wims_theme/oefcolors
13573 obado 78
  !if $oef_indbad=$empty
15175 obado 79
    !readproc themes/oefcolors
13573 obado 80
  !endif
15175 obado 81
  !if $presentgood>0
82
    !distribute item $oef_indbad,$oef_indgood,$oef_indforget,$oef_indpartial,$oef_indprec\
13573 obado 83
    into colorr_bad,colorr_good,colorr_forget,colorr_partial,colorr_prec
15175 obado 84
  !else
85
    !distribute item black,black,black,black,black\
86
    into colorr_bad,colorr_good,colorr_forget,colorr_partial,colorr_prec
87
  !endif
13573 obado 88
  !set codegood=$code
89
  !set codereply=$code
90
  !set test=0
91
  !for tt = 1 to $parmcnt
92
    !reset inputsize_tmp
93
    !set ld=!line $tt of $parm
94
    !distribute item $ld into m_,inputsize_tmp,css
95
    !default inputsize_tmp=$inputsize
96
    !set m_=!text select 0123456789 in $m_
97
    !set m_=$[$m_]
98
    !if $m_ isitemof $nrep
8867 bpr 99
      !default reply_$m_=$(reply$m_)
14199 bpr 100
      !set tt1=!word 1 of $(replygood$m_)
101
      !if $tt1!=?analyze
13573 obado 102
        !set cl=$(colorr_$(diareply$m_))
8867 bpr 103
      !else
13573 obado 104
        !set cl=$colorr_ana
14199 bpr 105
        !set noanswer=1
8867 bpr 106
      !endif
107
      !if $(diareply$m_)!=good
13573 obado 108
        !set test=1
8867 bpr 109
      !endif
16259 reyssat 110
      !set replytolatex=!rawmath $(reply_$m_)
111
      !set replytolatex=!texmath $replytolatex
112
      !set rgoodtolatex=!rawmath $(replyGood$m_)
113
      !set rgoodtolatex=!texmath $rgoodtolatex
114
      !set defaultrgoodtolatex=!rawmath $(replygood$m_)
115
      !default rgoodtolatex=!texmath $defaultrgoodtolatex
15175 obado 116
      !set codereply=!replace internal reply$m_ by $ \color{$cl}{$replytolatex} $ in $codereply
13573 obado 117
      !set codegood=!replace internal reply$m_ by $ $(rgoodtolatex)$ in $codegood
8867 bpr 118
    !endif m_
13573 obado 119
  !next tt
15180 bpr 120
  !if $test=1 and $noanswer!=1 and $presentgood>0
13573 obado 121
    \( $codereply \quad\) \(\quad $codegood\)
122
  !else
123
    \( $codereply \)
124
  !endif
8654 bpr 125
!endif