Rev 16784 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8654 | bpr | 1 | !reset inputsize |
8454 | bpr | 2 | !if $wims_read_parm=$empty |
13736 | bpr | 3 | !exit |
8454 | bpr | 4 | !endif |
5 | !if $wims_read_parm=help |
||
13736 | bpr | 6 | !read help/$lang/special/codeinput.phtml |
7 | !exit |
||
8454 | bpr | 8 | !endif |
9 | !set parm=!replace internal , r by $ r in $wims_read_parm |
||
10 | !set parm=!replace internal $ $ by $\ |
||
11 | $ in $parm |
||
12 | |||
13 | !set code=!item 1 of $parm |
||
14 | !set code=!declosing $code |
||
15 | |||
16 | !set inputsize=!item 2 to -1 of $parm |
||
17 | !set parm=!line 2 to -1 of $inputsize |
||
18 | !set inputsize=!line 1 of $inputsize |
||
8777 | bpr | 19 | |
20 | !if noanswer iswordof $inputsize |
||
13736 | bpr | 21 | !set noanswer=1 |
16134 | bpr | 22 | !set inputsize=!replace internal noanswer by $ in $inputsize |
8725 | bpr | 23 | !endif |
8777 | bpr | 24 | !if div iswordof $inputsize |
25 | !set pre=div |
||
16134 | bpr | 26 | !set inputsize=!replace internal div by $ in $inputsize |
8777 | bpr | 27 | !else |
28 | !set pre=pre |
||
29 | !endif |
||
16134 | bpr | 30 | !set inputsize=!nonempty items $inputsize |
8777 | bpr | 31 | !set inputsize=!item 1 of $inputsize |
8454 | bpr | 32 | !default inputsize=1x5 |
33 | |||
34 | !set parmcnt=!linecnt $parm |
||
8777 | bpr | 35 | !set parm=!sort reverse line $parm |
16379 | bpr | 36 | !set pretext=!replace internal for="reply by for="label in $code |
37 | !set pretext=!replace internal reply by REPLY in $pretext |
||
8454 | bpr | 38 | |
8725 | bpr | 39 | !for tt = 1 to $parmcnt |
13736 | bpr | 40 | !set ld=!line $tt of $parm |
41 | !set upcase=!uppercase $(ld[1]) |
||
42 | !reset inputsize_tmp |
||
43 | !if $(upcase) isin $pretext |
||
44 | !set reply_tmp=!nospace $(ld[1]) |
||
45 | !set i_tmp=!text select 0123456789 in $reply_tmp |
||
46 | !if debug iswordof $m_oefenv and ?analyze notin $(replygood$i_tmp) |
||
47 | !read oef/special/debug.input $i_tmp |
||
48 | !endif |
||
49 | !set rep_tmp=!replace internal reply by r in $reply_tmp |
||
50 | !set embedded=!append item $rep_tmp to $embedded |
||
14352 | bpr | 51 | !distribute item $ld into m_,inputsize_tmp,css |
16134 | bpr | 52 | !default inputsize_tmp=$inputsize |
13736 | bpr | 53 | !set inputsize_tmp=!translate x to , in $inputsize_tmp |
54 | !if $(inputsize_tmp[2])=$empty and $(inputsize_tmp[1])!=$empty |
||
55 | !set inputsize_tmp=1,$inputsize_tmp |
||
56 | !endif |
||
57 | !set inputsize_tmp=!nospace $inputsize_tmp |
||
58 | !set inputsize_tmp=!items2words $inputsize_tmp |
||
59 | !set nbdim=!wordcnt $inputsize_tmp |
||
60 | !if $nbdim==2 |
||
61 | !distribute words $inputsize_tmp into sizer,sizec |
||
62 | !if $sizer==1 |
||
63 | !set nbdim=1 |
||
64 | !set inputsize_tmp=$sizec |
||
65 | !endif |
||
66 | !endif |
||
13884 | bpr | 67 | !if $printing=yes |
68 | !set pretext=!replace internal $upcase by $prompt_empty in $pretext |
||
13736 | bpr | 69 | !else |
14353 | bpr | 70 | !reset style_tmp option_tmp |
14352 | bpr | 71 | !if $(css)!=$empty |
14353 | bpr | 72 | !if $(css)=default |
73 | !set class_tmp=class="wims_oef_input" |
||
74 | !endif |
||
14352 | bpr | 75 | !set style_tmp=style="$(css)" |
76 | !endif |
||
13884 | bpr | 77 | !if $nbdim==2 |
14353 | bpr | 78 | !set pretext=!replace internal $upcase by <textarea $class_tmp $style_tmp rows="$sizer" cols="$sizec" name="$reply_tmp">$($reply_tmp)</textarea> in $pretext |
13884 | bpr | 79 | !else |
14434 | bpr | 80 | !if $(replytype$i_tmp) iswordof menu |
81 | !set pretext_=!row 2 of $(replygood$i_tmp) |
||
82 | !if sort iswordof $(replyoption$i_tmp) |
||
83 | !set pretext_=!sort items $pretext_ |
||
84 | !else |
||
85 | !set pretext_=!shuffle $pretext_ |
||
86 | !endif |
||
87 | !set pretextcnt=!itemcnt $pretext_ |
||
88 | !set pretext_tmp=<option value="">$ch_choose</option> |
||
89 | !for tmp=1 to $pretextcnt |
||
90 | !set pretext_tmp=!append word <option value="$(pretext_[$tmp])">$(pretext_[$tmp])</option>\ |
||
91 | to $pretext_tmp |
||
92 | !next |
||
93 | !set pretext=!replace internal $upcase by \ |
||
94 | <select id="$reply_tmp" name="$reply_tmp">$pretext_tmp</select> in $pretext |
||
95 | !else |
||
17176 | bpr | 96 | !set pretext=!replace internal $upcase by <input $class_tmp $style_tmp id="$reply_tmp" size="$inputsize_tmp" name="$reply_tmp" value="$($reply_tmp)"> in $pretext |
14434 | bpr | 97 | !endif |
13884 | bpr | 98 | !endif |
13736 | bpr | 99 | !endif |
100 | !endif |
||
8454 | bpr | 101 | !next |
8777 | bpr | 102 | |
14956 | bpr | 103 | !set pretext=!replace internal for="label by for="reply in $pretext |
13884 | bpr | 104 | !if $q_form=yes or $printing=yes |
13736 | bpr | 105 | <$pre class="oef_codeinput"> |
106 | $pretext |
||
107 | </$pre> |
||
8454 | bpr | 108 | !else |
13736 | bpr | 109 | !set pretext=$code |
16784 | bpr | 110 | !set pretext=!replace internal </label> by in $pretext |
13736 | bpr | 111 | !read themes/$wims_theme/oefcolors |
112 | !if $oef_indbad=$empty |
||
113 | !read themes/oefcolors |
||
114 | !endif |
||
115 | !for tt = 1 to $parmcnt |
||
116 | !set ld=!line $tt of $parm |
||
14352 | bpr | 117 | !distribute item $ld into m_,inputsize_tmp,css |
118 | !default inputsize_tmp=$inputsize |
||
13736 | bpr | 119 | !if $(ld[1]) isin $pretext |
16784 | bpr | 120 | !set pretext=!replace internal <label for="reply$tt"> by in $pretext |
13736 | bpr | 121 | !set m_=!text select 0123456789 in $(ld[1]) |
122 | !default reply_$m_=$(reply$m_) |
||
123 | !set tt=!word 1 of $(replygood$m_) |
||
124 | !if $tt!=?analyze |
||
125 | !set cl=!nospace oef_ind$(diareply$m_) |
||
126 | !if $(precreply$m_)=yes and $(diareply$m_)=bad |
||
127 | !set cl=!nospace oef_indprec |
||
128 | !endif |
||
129 | !if $(partialgood$m_)=yes |
||
130 | !set cl=!nospace oef_indpartial |
||
131 | !endif |
||
132 | !else |
||
133 | !set cl=oef_empty |
||
134 | !endif |
||
135 | !set pretext=!replace internal $(ld[1]) by <div class="inline $cl">$(reply_$m_)</div><sup>[$m_]</sup> in $pretext |
||
136 | !set replyname$m_=[$m_] |
||
137 | !endif |
||
138 | !next |
||
139 | <$pre> |
||
140 | $pretext |
||
141 | </$pre> |
||
8454 | bpr | 142 | !endif |