Rev 7385 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
133 | bpr | 1 | |
2 | <b>画直线、多边形、点、线段、向量、矩形.</b> |
||
5903 | bpr | 3 | (名称: <span class="tt">javacurve</span>) |
17193 | bpr | 4 | <br> |
133 | bpr | 5 | 这种回答类型允许用户在一个图形上画直线、多边形、线段、向量、矩形 |
6 | 或点. |
||
7 | |||
8 | <p> |
||
9 | 标准答案用矩阵形式给出 (行分隔符是分号 `;'). |
||
10 | 第一行是图形的 URL(所在地址). |
||
6617 | zjchen | 11 | 第二行是对用户图形的测试条件, 见下表. 如果想要根据条件来分析回答, |
7385 | bpr | 12 | 那么用一个空变量作为正确答案, |
6617 | zjchen | 13 | 在栏目 <span class="tt wims_code_words">embed</span> |
14 | 的第 2 行填入图形的地址 URL, 第 3 行填入下表所示的类型 |
||
15 | (例如 <span class="tt wims_code_words">points</span>, |
||
6604 | bpr | 16 | <span class="tt wims_code_words">line</span> ...). |
6584 | bpr | 17 | </p> |
3361 | bpr | 18 | !set p=anstype.$lang/javacurve |
19 | !readproc tabletheme |
||
20 | $table_header |
||
21 | !set caption=!record 1 of help/$p |
||
22 | <caption>$caption</caption> |
||
23 | !set header=!record 2 of help/$p |
||
24 | $table_tr<th>$(header[1])</th><th>$(header[2])</th></tr> |
||
25 | !set cnt_record=!recordcnt help/$p |
||
26 | !for u= 3 to $cnt_record |
||
27 | !set l_=!record $u of help/$p |
||
6249 | bpr | 28 | $table_tr<td class="tt"> |
3361 | bpr | 29 | !line 1 of $l_ |
6249 | bpr | 30 | </td><td> |
3361 | bpr | 31 | !line 2 to -1 of $l_ |
32 | </td> |
||
7385 | bpr | 33 | </tr> |
3361 | bpr | 34 | !next |
35 | $table_end |
||
6590 | zjchen | 36 | 可把选项加到 : |
7385 | bpr | 37 | <span class="tt wims_code_words">precision</span>, |
38 | <span class="tt wims_code_words">color1</span> (回答的颜色), |
||
6590 | zjchen | 39 | <span class="tt wims_code_words">color2</span> (正确答案的颜色). |
40 | 例如 |
||
6584 | bpr | 41 | <pre> |
42 | \answer{}{...}{type=jsxgraphcurve}{option=color1=black color2=#B4B4FF precision=8} |
||
43 | </pre> |
||
6590 | zjchen | 44 | 对精度 <span class="tt wims_code_words">precision</span> 的选取要多加小心 ... |
3361 | bpr | 45 | |
2071 | zjchen | 46 | <p> |
3364 | zjchen | 47 | 建议把输入栏嵌入陈述中. 它不能与其它输入栏共存, |
48 | 因为任何用户点击图像都会把表格发送出去. |
||
5903 | bpr | 49 | 图像的大小记录在 <span class="tt">\embed</span> 的第二个变量内, 格式是 <span class="tt">L x H</span>, |
50 | 例如 <span class="tt">\embed{reply</span><em>n</em>, <span class="tt">300 x 400}</span>. |
||
133 | bpr | 51 | |
52 | </p> |
||
53 | 一般说来, 变量 |
||
5903 | bpr | 54 | <span class="tt">\reply</span><em>n</em> 被用于 \feedback 记录了回答时的点击 (x1,...), |
133 | bpr | 55 | 其中 <em>n</em> 是输入栏的号码. |
56 | 不过以下情形是例外: |
||
57 | <ul><li> |
||
5903 | bpr | 58 | 在 <span class="tt">points</span> 的情形, |
133 | bpr | 59 | 第一行是点击坐标(以点素pixel为单位)的表, |
5903 | bpr | 60 | 第二行是 <span class="tt">n1,n2,n3</span>, 其中 |
61 | <span class="tt">n1</span> 正确点的个数, <span class="tt">n2</span> 是散失点的个数, |
||
62 | <span class="tt">n3</span> 是错误点的个数. 第三行是找对的点的个数表. |
||
133 | bpr | 63 | </li><li> |
5903 | bpr | 64 | 在 <span class="tt">circle</span> 的情形, 第一行是点击坐标以及半径的表, |
7385 | bpr | 65 | 第二行是 <span class="tt">n1,n2</span>, |
5903 | bpr | 66 | 当中心正确时 <span class="tt">n1</span> 取 1, 否则取 0, |
67 | 当半径正确时 <span class="tt">n2</span> 取 1, 否则取 0. |
||
133 | bpr | 68 | </li> |
69 | <li> |
||
5903 | bpr | 70 | 在 <span class="tt">sline</span> 的情形, 第一行是点击坐标表, |
7385 | bpr | 71 | 第二行是 <span class="tt">n1,n2,n3</span>, |
5903 | bpr | 72 | 当起点正确时 <span class="tt">n1</span> 取 1, 否则取 0, |
73 | 当斜率正确时 <span class="tt">n2</span> 取 1, 否则取 0, |
||
74 | 当指向正确时 <span class="tt">n3</span> 取 1, 否则取 0. |
||
133 | bpr | 75 | </li> |
76 | </ul> |