Subversion Repositories wimsdev

Rev

Rev 67 | Rev 404 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !set special_list=imagefill,expandlines,rename,help,tooltip
  2.  
  3. !if $lang=cn
  4. !set special_list=imagefill,expandlines,help
  5.  
  6. <p><center><h2>OEFµÄ¸ß¼¶¼¼ÇÉ</h2></center>
  7.  
  8. <h3>Òþ²ØÍ¼ÐÎÃû³Æ</h3>
  9. Èç¹ûÄãµÄÁ·Ï°ÐèҪʶ±ðËæ»úѡȡµÄͼÐÎ, ͼÐÎÎļþÃû¾ÍÊÇÒ»¸öÖØÒªµÄÌáʾ.
  10. ΪÁËÒþ²Ø´ËÎļþÃû, Äã¿ÉÒÔд
  11.  
  12. <pre>\img{\imagedir/picture.jpg align=middle alt="picture"}</pre>
  13.  
  14. ÕâÑùѧÉúÔÚä¯ÀÀÆ÷Àï¿´µ½µÄÊÇ
  15.  
  16. <pre>&lt;img src="a_random_unrelated_file_name" align=middle alt="picture"&gt;</pre>
  17.  
  18. ÕæÊµÎļþÃû±»Òþ²ØÁË.
  19.  
  20. <p><b>×¢Òâ</b>. ²»ÒªÖ±½ÓʹÓÃWIMSÃüÁî <em>rename</em> ´¦ÀíÎļþÃû,
  21. ·ñÔòÁ·Ï°½«²»ÄÜÔÚ±»±£´æµÄ»·¾³ÀïÕý³£¹¤×÷.
  22.  
  23. <h3>·Ö²½Á·Ï°</h3>
  24. ·Ö²½Á·Ï°¿Éͨ¹ýÃüÁî <tt>\steps</tt> ¶¨Òå. ¾ÙÀýÀ´Ëµ, Èç¹ûÄ㶨Òå
  25.  
  26. <pre>\steps{choice 1, reply 1
  27. choice 2, reply 2, reply 3
  28. choice 3
  29. }</pre>
  30.  
  31. ´ËÁ·Ï°½«·Ö³É3²½, µÚÒ»²½ÒªÇó¶àÖØÑ¡Ôñ(choice 1)ÒÔ¼°×ÔÓɸñʽµÄ»Ø´ð(reply 1),
  32. µÚ2²½ÊÇÒ»¸ö¶àÖØÑ¡ÔñÒÔ¼°Á½¸ö×ÔÓɸñʽµÄ»Ø´ðµÄ»Ø´ð, µÈµÈ.
  33. <p>
  34. <tt>\steps</tt> µÄÄÚÈݽÓÊÜ(Ç°ÃæÒѶ¨ÒåµÄ)²ÎÊýÒÔ¼°Ìõ¼þ¶¨Òå,
  35. ÕýÈç¶Ô²ÎÊýµÄ¶¨ÒåÒ»Ñù. ÕâÑù¾ÍʹµÃÄã¿ÉÒÔÑ¡ÔñÐÔµØÕ¹Ê¾»Ø´ðÀ¸(¸ù¾Ý²ÎÊýµÄËæ»ú±äÁ¿),
  36. ÉõÖÁÖ»º¬Ò»²½µÄÇéÐÎÒ²ÊÇÈç´Ë.
  37. <p>
  38. Çë×¢Òâ, Èç¹ûÓû§ÔÚÇ°ÃæµÄ²½ÖèÀï³öÁË´í, ÒÔºóµÄ²½Öè¾Í²»³öÏÖÁË(¿ÉÒÔÈÏΪȫ¶¼´íÁË).
  39. <p>
  40. ÔÚÁ·Ï°µÄ³ÂÊöÀï, µ±Ç°µÄ²½Êý¿Éͨ¹ý±äÁ¿ <tt>\step</tt> »ñµÃ,
  41. ´Ë±äÁ¿Ëæ×ÅÓû§»Ø´ðµÄ½øÕ¹¶øÖð²½È¡Öµ 1,2,...
  42. <p>
  43. ΪÁËÉè¼Æ¶¯Ì¬µÄ·Ö²½Á·Ï°(²½ÊýËæÓû§µÄ»Ø´ð¶ø·¢Éú±ä»¯),
  44. Äã¿ÉÒÔʹÓÃÃüÁî <tt>\nextstep{...}</tt>. <tt>\nextstep</tt> ÀàËÆÓÚ <tt>\steps</tt>,
  45. µ«Ö»ÓеÚÒ»ÐÐÊÇÓÐЧµÄ. Ëü½öµ±ÆäÄÚÈÝÊÇÓÉÕâÑùµÄ±äÁ¿¸ø³öʱ²ÅÄÜʹÓÃ,
  46. Õâ¸ö±äÁ¿Ó¦¸ÃÓÉ post-reply µÄ²ÎÊý¶¨ÒåËù¸Ä±ä.
  47. µ±ÔÚijһ²½Ê± <tt>\nextstep</tt> µÄÄÚÈݱä³É¿ÕÁË, Á·Ï°¾ÍÍ£Ö¹ÁË.
  48. <p>
  49. ÔÚÈκÎÇéÐÎ, ÔÚÒ»¸öOEFÔ´ÂëÄÚ, ×î¶àÖ»ÄܳöÏÖÒ»¸ö <tt>\steps</tt> »ò
  50. <tt>\nextstep</tt> µÄÉùÃ÷.
  51.  
  52. <h3>Ìõ¼þ·Ö²æÓëÑ­»·</h3>
  53.  
  54. ¿ÉÓõÄÃüÁî:
  55.  
  56. <pre>
  57. \if{Ìõ¼þ}{ifµÄÄÚÈÝ}
  58. \if{Ìõ¼þ}{ifµÄÄÚÈÝ}{ÆäËüÄÚÈÝ}
  59. \for{var=n1 to n2}{Ñ­»·ÄÚÈÝ}
  60. \while{Ìõ¼þ}{Ñ­»·ÄÚÈÝ}     (Ö»ÓÃÔÚÖ÷»·¾³)
  61. </pre>
  62.  
  63. ÕâЩÃüÁî¿ÉÒÔ±»ÓÃÓÚ³ÂÊö¡¢Ìáʾ¡¢½â´ð»ò·´À¡ÄÚ, »òÓÃÓÚÖ÷»·¾³Àï.
  64. ÔÚ×îºóÒ»ÖÖÇéÐÎ, Ìõ¼þÖ´ÐÐÖ»Ó°Ïì²ÎÊýµÄ¶¨Òå.
  65.  
  66. <a name=special>
  67. <h3>ÌØÊâ·½·¨</h3></a>
  68.  
  69. ÔÚÁ·Ï°µÄ³ÂÊöÀïÀûÓÃÃüÁî <tt>\special{...}</tt>
  70. ¿ÉÓÐÏÂÁÐÌØÊâ·½·¨:
  71. <p>
  72. !if $special_parm=all
  73.  !for sp in $special_list
  74.   <p><center><h4>ÌØÊâ·½·¨<tt>$sp</tt></center></h4> <p>
  75.   Ò»°ãÓï·¨: <tt>\special{$sp <i>²ÎÊý</i>}</tt> <p>
  76.  
  77.   !read oef/special/$sp.phtml help
  78.  !next sp
  79. !else
  80.  !for sp in $special_list
  81.   !href cmd=help&special_parm=oefadv&special_parm2=$sp#special $sp
  82.  &nbsp;
  83.  !next sp
  84. !endif
  85.  
  86. !if $special_parm2 isitemof $special_list
  87. <p><center><h4>ÌØÊâ·½·¨<tt>$special_parm2</tt></center></h4> <p>
  88. Ò»°ãÓï·¨: <tt>\special{$special_parm2 <i>²ÎÊý</i>}</tt> <p>
  89.  
  90. !read oef/special/$special_parm2.phtml help
  91. !endif
  92.  
  93. <h3>Ô¤´¦Àí×ÊÔ´</h3>
  94.  
  95. ±¾¹¦Äܲ»ÄÜÓÃÓÚCreatexo. Äã¿ÉÔÚÄ£¿é¹¤¾ß(Modtool)ÏÂʹÓÃËüÀ´Ð´OEF(¼°Deductio)Á·Ï°.
  96. <p>
  97. ËüʹÄã¿ÉÒÔ°ÑÔ´ÂëµÄ¹«¹²²¿·Ö°üº¬ÔÚ¼¸¸öoefÎļþÀï.
  98. ÄãÒ²¿ÉÒÔÀûÓÃËü´ÓÒ»¸öÔ¤×ÊÔ´ÅúÉú³É¼¸¸öoef, ËüÃÇÏ໥֮¼äÏà²îһЩºê¶¨Òå.
  99. <p>
  100. ΪʹÓÃÕâ¸ö¹¦ÄÜ, Ó¦ÔÚ src Ͻ¨Á¢Ò»¸ö×ÓĿ¼ cpp/.
  101. Ô¤×ÊÔ´ÎļþÒÔ .cpp ×÷Ϊºó׺·ÅÈë´Ë×ÓĿ¼. ÔÚÕâЩÎļþÀï,
  102. Äã¿ÉÒÔ¼ÓÈë cpp µÄÖ¸ÁîÈç <tt>#include</tt> »ò <tt>#if</tt>.
  103. (Çë²Î¿´ cpp ÊÖ²á»ò c µÄ˵Ã÷ÒÔÁ˽âÓï·¨ÏêÇé.)
  104. <p>
  105. cppÎļþµÄµÚÒ»ÐÐÓ¦¸Ã¶¨ÒåÒ»¸öÄ¿±ê±í, Æä¸ñʽΪ
  106. <pre>
  107. target=targ1 targ2 targ3 ...
  108. </pre>
  109. ÕâÐÐÃüÁîµÄÒâÒåÊDZ¾cppÎļþ½«Éú³É targ1.oef, targ2.org, µÈµÈ.
  110. (Êä³öÎļþ»á×Ô¶¯Ìí¼Óºó׺ .oef). ÔÚÉú³ÉÄ¿±êÎļþ <em>targ1</em> ʱ,
  111. ν´Ê <tt>#TARGET</tt> »á±»¶¨ÒåΪ <em>targ1</em>. (¶øÇÒºê
  112. <em>TARGET_targ1</em> Ò²±»¶¨Òå.)
  113. ËùÒÔÔÚcppÔ­ÎļþÀï¿ÉÒÔ¼ÓÈëÈçϵÄÐÐ:
  114. <pre>
  115. #if #TARGET (targ1)
  116. \title{Á·Ï°1}
  117.  \integer{v1=3}
  118.  \text{t1=ÕâÊÇtarget 1}
  119. #endif
  120. #if #TARGET (targ2)
  121. \title{Á·Ï°2}
  122.  \integer{v1=5}
  123.  \text{t1=ÕâÊÇtarget 2}
  124. #endif
  125. </pre>
  126. ʹµÃÉú³ÉµÄÄÚÈÝÓëÄ¿±êÓйØ.
  127. <p>
  128. °üº¬ÎļþÒ²Ó¦¼ÓÉϺó׺ .inc ºó·Åµ½ src/cpp Ŀ¼Àï. ÃüÁîÐÐ
  129. <pre>
  130. #include "common.inc"
  131. </pre>
  132. ½«°Ñ common.inc µÄÄÚÈݲåÈëÉú³ÉµÄoefÎļþÀï.
  133. Çë×¢Òâ, ΪÁ˰²È«µÄÔ­Òò, ½ûÖ¹Ö¸Ã÷°üº¬ÎļþµÄĿ¼.
  134. <p>
  135. ÌØ±ðÌáʾ; Èç¹ûÄãµÄcppÎļþµÄÎı¾ÀﺬÓÐδ¹Ø±ÕµÄµ¥ÒýºÅ»òË«ÒýºÅµÄ»°,
  136. cpp»áÏÝÓÚ»ìÂÒ. ÔÚÕâÖÖÇéÐÎ,
  137. Äã¿ÉÒÔÀûÓà c µÄ×¢½â(<tt>/* ... */</tt>)°Ñº¬ÓÐÕâÑùÎı¾µÄÃüÁî±£»¤ÆðÀ´.
  138.  
  139. <h3>Á·Ï°»·¾³</h3>
  140. ÌØÊâ±äÁ¿ <tt>\oefenv</tt> ¿ÉÓÃÀ´²âÊÔÁ·Ï°µÄ»·¾³(Èç¹ûÔÚÁ·Ï°ÀïûÓжÔËüÖØ¶¨ÒåµÄ»°).
  141. <p>
  142. Ŀǰ´Ë±äÁ¿ÄܲâÊÔµÄÄÚÈÝÖ»ÓÐ
  143. ``debug''. ÔÚÒÔÏÂÇéÐÎÀï, debug½«³öÏÖÔÚ <tt>\oefenv</tt> Àï:<ol>
  144. <li>µ±ËüÔÚCreatexoÄÚÖ´ÐÐʱ.
  145. <li>µ±ËüÔÚModtoolÄÚ±»²âÊÔʱ, Ä¿µÄÊÇΪÁË¿ª·¢.
  146. <li>µ±ËüÊǰ༶µÄÁ·Ï°, ¶øÇÒ±»Ö÷³Ö½ÌʦִÐÐʱ.
  147. </ol>
  148. ÔÚÕâЩÇéÐÎ, Ðí¶àÀàÐ͵ÄÊäÈëÀ¸Àï¶¼»áÏÔʾÕýÈ·µÄ´ð°¸,
  149. ÈÃÄã¿´µ½Á·Ï°ÆÚÍûµÄ½á¹ûÊÇʲô.
  150. <p>
  151. Äã¿ÉÒÔÓÃÒÔÏÂÐÎʽÔÚÁ·Ï°ÀïÌí¼Ó¾À´íÐÅÏ¢
  152. <pre>
  153. \if{debug iswordof \oefenv}{ÓûÌí¼ÓµÄ¾À´íÐÅÏ¢}
  154. </pre>
  155. µ±Á·Ï°±»²âÊÔʱ, ÕâЩÐÅÏ¢»á×Ô¶¯ÏÔʾ, ¶øÇÒѧÉú×ö×÷ҵʱÓÖ×Ô¶¯Òþ²Ø.
  156. !exit
  157. !endif
  158.  
  159. !set special_list=imagefill,expandlines,help
  160.  
  161. <p><center><h2>Advanced features of OEF</h2></center>
  162.  
  163. <h3>Hiding image names</h3>
  164. If your exercise requires recognition of a randomly picked picture, the file
  165. name of the picture might give clue to the exercise. In order to hide this
  166. file name, you can write
  167.  
  168. <pre>\img{\imagedir/picture.jpg align=middle alt="picture"}</pre>
  169.  
  170. Then on the browser, the student will see
  171.  
  172. <pre>&lt;img src="a_random_unrelated_file_name" align=middle alt="picture"&gt;</pre>
  173.  
  174. The true file name is thus hidden to the student.
  175.  
  176. <p><b>Note</b>. Don't use directly the WIMS command <em>rename</em> to
  177. process the file name, or the exercise won't work correctly under saved
  178. environment.
  179.  
  180. <h3>Multi-step exercises</h3>
  181. Multi-step exercises can be defined via the command <tt>\steps</tt>. For
  182. example, if you define (among parameters)
  183.  
  184. <pre>\steps{choice 1, reply 1
  185. choice 2, reply 2, reply 3
  186. choice 3
  187. }</pre>
  188.  
  189. the exercise will be presented with 3 steps, the first asks for a multiple
  190. choice (choice 1) and a freestyle reply (reply 1), the second a multiple
  191. choice and two freestyle replies, etc.
  192. <p>
  193. The content of <tt>\steps</tt> accepts (earlier-defined) parameters as well as
  194. conditional definitions, in the same way as the definition of parameters.
  195. This allows you to selectively present response
  196. fields (according to random variations of parameters), even in the case
  197. where there is only one step.
  198. <p>
  199. It is to be noted that if a user makes a mistake in
  200. an early step, subsequent steps will not be presented (and will be
  201. considered all wrong).
  202. <p>
  203. The current step number is available to the statement of the exercise,
  204. via the variable
  205. <tt>\step</tt> which takes successively the values of 1,2,... when the user
  206. advances in his/her answering.
  207. <p>
  208. To make dynamic multi-step exercises (steps varying with student answers), you
  209. can use the command <tt>\nextstep{...}</tt>. The content of
  210. <tt>\nextstep</tt> is the similar to <tt>\steps</tt> but only the first line
  211. is effective. It is useful only when the content is given by a variable
  212. which is changed by post-reply parameter definitions. The exercise stops when
  213. the content of <tt>\nextstep</tt> is empty at some step.
  214. <p>
  215. In any case, at most one declaration <tt>\steps</tt> or <tt>\nextstep</tt>
  216. should appear in an OEF source.
  217.  
  218. <h3>Conditional branching and loops</h3>
  219.  
  220. Available commands:
  221.  
  222. <pre>
  223. \if{condition}{if_content}
  224. \if{condition}{if_content}{otherwise_content}
  225. \for{var=n1 to n2}{loop_content}
  226. \while{condition}{loop_content}     (main environment only)
  227. </pre>
  228.  
  229. These commands can be used either within statement, hint, solution or
  230. feedback, or in the main environment. In the latter case, the conditional
  231. execution only affects parameter definitions.
  232.  
  233. <a name=special>
  234. <h3>Special methods</h3></a>
  235.  
  236. With the command <tt>\special{...}</tt> in the statement of an exercise, the
  237. following special methods are available:
  238. <p>
  239. !if $special_parm=all
  240.  !for sp in $special_list
  241.   <p><center><h4>The special method <tt>$sp</tt></h4></center> <p>
  242.   General syntax: <tt>\special{$sp <i>parameters</i>}</tt> <p>
  243.  
  244.   !read oef/special/$sp.phtml help
  245.  !next sp
  246. !else
  247.  !for sp in $special_list
  248.   !href cmd=help&special_parm=oefadv&special_parm2=$sp#special $sp
  249.  &nbsp;
  250.  !next sp
  251. !endif
  252.  
  253. !if $special_parm2 isitemof $special_list
  254. <p><center><h4>The special method <tt>$special_parm2</tt></h4></center> <p>
  255. General syntax: <tt>\special{$special_parm2 <i>parameters</i>}</tt> <p>
  256.  
  257. !read oef/special/$special_parm2.phtml help
  258. !endif
  259.  
  260. <h3>Preprocessed sources</h3>
  261.  
  262. This feature is not available for Createxo. You can use it if you write OEF
  263. (and Deductio) exercises under Modtool.
  264. <p>
  265. It allows you to include common portions of codes into several oef files.
  266. You can also use it to make batch generation of several oefs from one
  267. pre-source, each differing from the others by some macro definitions.
  268. <p>
  269. To use this feature, a subdirectory cpp/ should be created under src. Put
  270. into it pre-source files with extension .cpp. In these files, you can add
  271. cpp directives like <tt>#include</tt> or <tt>#if</tt>. (Please refer to cpp
  272. manual and c specification for details of the syntax.)
  273. <p>
  274. The first line of the cpp file must define a list of targets, in the format
  275. <pre>
  276. target=targ1 targ2 targ3 ...
  277. </pre>
  278. This line means that this cpp file should generate targ1.oef, targ2.org, etc.
  279. (the extension .oef will be
  280. appended to the output names). When generating the target file <em>targ1</em>, the
  281. predicate <tt>#TARGET</tt> will be defined as <em>targ1</em>. (And a macro
  282. <em>TARGET_targ1</em> is also defined.)
  283. Therefore in the cpp source file, you can add lines like
  284. <pre>
  285. #if #TARGET (targ1)
  286. \title{Exercise 1}
  287.  \integer{v1=3}
  288.  \text{t1=this is target 1}
  289. #endif
  290. #if #TARGET (targ2)
  291. \title{Exercise 2}
  292.  \integer{v1=5}
  293.  \text{t1=this is target 2}
  294. #endif
  295. </pre>
  296. in order to make the contents target-dependent.
  297. <p>
  298. Include files should also be put into the src/cpp directory, with extension
  299. .inc. And a line
  300. <pre>
  301. #include "common.inc"
  302. </pre>
  303. will insert the content of common.inc into the generated oef file.
  304. Please note that for security reasons, it is prohibited to specify
  305. directories of include files.
  306. <p>
  307. A special remark: cpp gets confused when your file contains single or double
  308. quotes in the text that are not closed. In this case, you can protect the
  309. commands containing such texts by c comments (<tt>/* ... */</tt>).
  310.  
  311. <h3>Exercise environment</h3>
  312. A special variable <tt>\oefenv</tt> can be used to test the environment of
  313. an exercise (if it is not redefined within the exercise).
  314. <p>
  315. For the time being, the only testable content of the variable is the word
  316. ``debug''. This word appears within <tt>\oefenv</tt> in the following
  317. situations: <ol>
  318. <li>When it is executed within Createxo.
  319. <li>When it is under test in Modtool, by the developer himself.
  320. <li>When it is a class exercise and is executed by the supervisor.
  321. </ol>
  322. Note that in these cases, the good reply will appear as default in the input
  323. fields of many types, allowing you to see what the exercise expects without
  324. typing into the fields.
  325. <p>
  326. You may add debugging informations into your exercise using things like
  327. <pre>
  328. \if{debug iswordof \oefenv}{debugging informations to add into}
  329. </pre>
  330. These debugging informations will be automatically shown when the exercise
  331. is under test, and automatically hidden when students work on it.
  332.  
  333.  
  334.