Rev 15409 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8725 | bpr | 1 | !reset inputsize |
2 | !if $wims_read_parm=$empty |
||
13736 | bpr | 3 | !exit |
8725 | bpr | 4 | !endif |
5 | !if $wims_read_parm=help |
||
13736 | bpr | 6 | !read help/$lang/special/imageinput.phtml |
13884 | bpr | 7 | !exit |
8725 | 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 imgurl=!item 1 of $parm |
||
14 | |||
15 | !set inputsize=!item 2 to -1 of $parm |
||
16 | !set parm=!line 2 to -1 of $inputsize |
||
17 | !set inputsize=!line 1 of $inputsize |
||
9015 | bpr | 18 | !set parm=!nonempty lines $parm |
8725 | bpr | 19 | !distribute items $inputsize into bigsize,inputsize,option |
20 | |||
21 | !set bigsize=!translate x, to $ $ in $bigsize |
||
22 | !distribute words $bigsize into bigsizex,bigsizey |
||
23 | |||
24 | !if noanswer isin $option |
||
13736 | bpr | 25 | !set noanswer=1 |
8725 | bpr | 26 | !endif |
8777 | bpr | 27 | !set inputsize=!item 1 of $inputsize |
8725 | bpr | 28 | !default inputsize=1x5 |
29 | !set inputsize=!translate x to , in $inputsize |
||
30 | |||
31 | !set parmcnt=!linecnt $parm |
||
8777 | bpr | 32 | !set parm=!sort reverse line $parm |
8725 | bpr | 33 | |
15409 | bpr | 34 | !set sp_imagecss=<style>\ |
8725 | bpr | 35 | .sp_image {position:relative;display:inline-block;width:$(bigsizex)px;height:$(bigsizey)px;}\ |
36 | .sp_image input{margin:0;padding:0;position:absolute;}\ |
||
37 | .sp_image textarea{margin:0;padding:0;position:absolute;} |
||
38 | |||
39 | !reset hlist positionlist |
||
40 | !for tt = 1 to $parmcnt |
||
13736 | bpr | 41 | !set ld=!line $tt of $parm |
42 | !reset inputsize_tmp |
||
43 | !distribute item $ld into m_,xy_,inputsize_tmp,css |
||
44 | !set xy_=!replace internal x by , in $xy_ |
||
45 | !distribute items $xy_ into x_,y_ |
||
46 | !set x_=$[round($x_)] |
||
47 | !set y_=$[round($y_)] |
||
48 | !default inputsize_tmp=$inputsize |
||
49 | !set reply_tmp=!nospace $m_ |
||
50 | !set rep_tmp=!replace internal reply by r in $reply_tmp |
||
51 | !set n_=!text select 0123456789 in $reply_tmp |
||
52 | !set n_=$[$n_] |
||
53 | !if debug iswordof $m_oefenv and ?analyze notin $(replygood$n_) |
||
54 | !read oef/special/debug.input $n_ |
||
55 | !endif |
||
56 | !set inputsize_tmp=!translate x to , in $inputsize_tmp |
||
57 | !if $(inputsize_tmp[2])=$empty and $(inputsize_tmp[1])!=$empty |
||
58 | !set inputsize_tmp=1,$inputsize_tmp |
||
59 | !endif |
||
60 | !set inputsize_tmp=!nospace $inputsize_tmp |
||
8725 | bpr | 61 | !!set inputsize_tmp=!items2words $inputsize_tmp |
13736 | bpr | 62 | !default inputsize_tmp=$inputsize |
63 | !set nbdim=!itemcnt $inputsize_tmp |
||
64 | !if $nbdim==2 |
||
65 | !distribute items $inputsize_tmp into sizer,sizec |
||
66 | !if $sizer==1 |
||
67 | !set nbdim=1 |
||
68 | !set inputsize_tmp=$sizec |
||
69 | !endif |
||
70 | !endif |
||
71 | !if $n_!=$empty and $(replytype$n_) iswordof numeric nocase case atext \ |
||
11985 | bpr | 72 | range litexp algexp formal equation function matrix raw default set aset fset numexp |
8782 | bpr | 73 | !set embedded=!append item r$n_ to $embedded |
13884 | bpr | 74 | !if $printing=yes |
75 | !set sp_imagecss=$sp_imagecss\ |
||
13978 | bpr | 76 | .sp_image>.print_input{margin:0;position:absolute;}\ |
77 | .sp_image #reply$n_{left:$(x_)px;top:$(y_)px;$css}\ |
||
78 | .print_input {border: 1px solid; padding: 0 .5em;} |
||
13884 | bpr | 79 | !set hlist=$hlist\ |
13978 | bpr | 80 | <div id="reply$n_" class="print_input">$prompt_empty</div> |
13884 | bpr | 81 | !else |
82 | !set sp_imagecss=$sp_imagecss\ |
||
13978 | bpr | 83 | .sp_image> input{margin:0;position:absolute;}\ |
8782 | bpr | 84 | .sp_image #reply$n_{left:$(x_)px;top:$(y_)px;$css} |
13884 | bpr | 85 | !if $nbdim==2 |
86 | !set hlist=$hlist\ |
||
17176 | bpr | 87 | <textarea id="reply$n_" rows="$sizer" cols="$sizec" name="reply$n_" value="$(reply$n_)" class="nowrap"></textarea> |
13884 | bpr | 88 | !else |
89 | !set hlist=$hlist\ |
||
17176 | bpr | 90 | <input id="reply$n_" size="$inputsize_tmp" name="reply$n_" value="$(reply$n_)"> |
13884 | bpr | 91 | !endif |
8782 | bpr | 92 | !endif |
93 | !set positionlist=!append line $x_,$y_ to $positionlist |
||
94 | !set nrep=!append item $n_ to $nrep |
||
95 | !set sizelist=!append line $inputsize_tmp to $sizelist |
||
13736 | bpr | 96 | !endif |
8725 | bpr | 97 | !next tt |
13884 | bpr | 98 | !if $printing=yes |
99 | $sp_imagecss |
||
100 | </style> |
||
13978 | bpr | 101 | <div class="sp_image"> |
13884 | bpr | 102 | $hlist |
17176 | bpr | 103 | <img src="$imgurl" style="width:$(bigsizex)px;height:$(bigsizey)px;" alt=""> |
13884 | bpr | 104 | </div> |
105 | !exit |
||
106 | !endif |
||
8725 | bpr | 107 | !if $q_form=yes |
13736 | bpr | 108 | $sp_imagecss |
109 | </style> |
||
110 | <div class="sp_image"> |
||
111 | $hlist |
||
17176 | bpr | 112 | <img src="$imgurl" style="width:$(bigsizex)px;height:$(bigsizey)px;" alt=""> |
13736 | bpr | 113 | </div> |
8725 | bpr | 114 | !else |
13736 | bpr | 115 | !read themes/$wims_theme/oefcolors |
116 | !if $oef_indbad=$empty |
||
117 | !read themes/oefcolors |
||
118 | !endif |
||
119 | !distribute item $oef_indbad,$oef_indgood,$oef_indforget, $oef_indpartial, $oef_indprec\ |
||
120 | into colorr_bad,colorr_good,colorr_forget,colorr_partial,colorr_prec |
||
121 | !reset hlir hlig |
||
15409 | bpr | 122 | !set sp_imagecss=<style>\ |
13736 | bpr | 123 | .sp_image_r {position:relative;display:inline-block;width:$(bigsizex)px;height:$(bigsizey)px;}\ |
124 | .sp_image_r span {margin:0;padding:0;position:absolute;}\ |
||
125 | .sp_image_r textarea{margin:0;padding:0;position:absolute;} |
||
126 | !set sp_imagecss=$sp_imagecss\ |
||
127 | .sp_image_g {position:relative;display:inline-block;width:$(bigsizex)px;height:$(bigsizey)px;}\ |
||
128 | .sp_image_g span {margin:0;padding:0;position:absolute;}\ |
||
129 | .sp_image_g textarea{margin:0;padding:0;position:absolute;} |
||
8867 | bpr | 130 | |
13736 | bpr | 131 | !reset test |
132 | !for tt=1 to $parmcnt |
||
133 | !set aa=$(nrep[$tt]) |
||
134 | !set inputsize_tmp=!line $aa of $sizelist |
||
135 | !if $(inputsize_tmp[2])!=$empty |
||
8725 | bpr | 136 | !set hlir=$hlir\ |
17176 | bpr | 137 | <textarea disabled="disabled" id="sp_imageinput_r$tt" rows="$(inputsize_tmp[2])" cols="$(inputsize_tmp[1])" class="nowrap">$(reply$tt)</textarea> |
13736 | bpr | 138 | !set hlig=$hlig\ |
17176 | bpr | 139 | <textarea disabled="disabled" id="sp_imageinput_g$tt" rows="$(inputsize_tmp[2])" cols="$(inputsize_tmp[1])" class="nowrap">$(replygood$tt)</textarea> |
13736 | bpr | 140 | !else |
141 | !set hlir=$hlir\ |
||
142 | <span id="sp_imageinput_r$tt">$(reply$tt)<sup>[$tt]</sup></span> |
||
8725 | bpr | 143 | !set hlig=$hlig\ |
13736 | bpr | 144 | <span id="sp_imageinput_g$tt">$(replygood$tt)</span> |
8867 | bpr | 145 | !endif |
13736 | bpr | 146 | !if $(diareply$tt)!=good |
147 | !set test=1 |
||
148 | !endif |
||
149 | !set tt_=!word 1 of $(replygood$tt) |
||
150 | !if $tt_!=?analyze |
||
151 | !set cl=$(colorr_$(diareply$tt)) |
||
152 | !if $(precreply$tt)=yes |
||
153 | !set cl=color:$(colorr_prec) |
||
154 | !endif |
||
155 | !if $(partialgood$tt)=yes |
||
156 | !set cl=color:$(colorr_partial) |
||
157 | !endif |
||
158 | !else |
||
159 | !reset cl |
||
160 | !endif |
||
161 | !set sp_imagecss=$sp_imagecss\ |
||
162 | .sp_image_r #sp_imageinput_r$tt {left:$(positionlist[$aa;1])px;top:$(positionlist[$aa;2])px;$cl} |
||
8725 | bpr | 163 | |
13736 | bpr | 164 | !set sp_imagecss=$sp_imagecss\ |
165 | .sp_image_g #sp_imageinput_g$tt {left:$(positionlist[$aa;1])px;top:$(positionlist[$aa;2])px;} |
||
166 | !set replyname$tt=[$tt] |
||
167 | !next tt |
||
168 | $sp_imagecss |
||
169 | </style> |
||
170 | <div class="sp_image_r"> |
||
171 | $hlir |
||
17176 | bpr | 172 | <img src="$imgurl" style="width:$(bigsizex)px; height:$(bigsizey)px" alt=""> |
13736 | bpr | 173 | </div> |
8725 | bpr | 174 | |
13736 | bpr | 175 | !if $test=1 and $noanswer!=1 |
176 | <div class="sp_image_g"> |
||
177 | $hlig |
||
17176 | bpr | 178 | <img src="$imgurl" style="width:$(bigsizex)px; height:$(bigsizey)px" alt=""> |
13736 | bpr | 179 | </div> |
8725 | bpr | 180 | !endif |
181 | !endif |