home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / educatio / tw31.zip / TWTUT5.CHP < prev    next >
Text File  |  1993-05-25  |  7KB  |  266 lines

  1. %
  2. #EF
  3. #TGETTING INPUT
  4. #C2,R5
  5. In this Chapter we will look at ways you can get your ~G~IReaders~N actively
  6.  
  7. involved in your ~M~Itutorial~N.
  8.  
  9.  
  10.  
  11. There are a number of ~HCommands~N in ~H~bTutorialWriter~N which require input from
  12.  
  13. the ~G~IReader~N.  They are :
  14.  
  15.  
  16. ~H            #Y ~N     -  asks for information~H
  17.             #QQ,R ~N  -  asks a Question and checks the answer.~H
  18.             #QQ,B ~N  -  same as #QQ,R in a different format.~H
  19.             #QQ,F ~N  -  asks for a specific answer.~H
  20.             #QQ,C ~N  -  asks for an answer and Branches.
  21.  
  22.  
  23.  
  24. #W
  25. %
  26. #EF
  27. #T
  28. #C2,R5
  29. The format of the ~C~I#Y ~HCommand~N is ~C~I#Yn~N where ~C~In~N is a value between ~H0~N and ~H9~N.
  30.  
  31. You phrase the question you want answered using the normal ~HCommands~N, then
  32.  
  33. when you use the ~C~I#Yn~H Command~N, the program will accept a line of input up to
  34.  
  35. 30 characters long, at the ~HCURRENT CURSOR LOCATION~N.
  36.  
  37.  
  38. To 'play back' the input, you use an ~HInline Command~N,~C~I ~~Un~N, where ~C~In~N matches
  39.  
  40. ~C~I#Y ~Nnumber. Here's an example :
  41.  
  42.  
  43. ~H~~HWhat is your first name ?~~N
  44. { #Y1
  45.  
  46. ~H ~~HHello, ~~U1, nice to meet you.~~N
  47. #C2
  48.  
  49. ~NLet's try it out.
  50. #W
  51. #ES,1,18,80,25
  52. #C2,R18
  53. ~H What is your first name ?~N
  54. #Y1
  55.  
  56. ~H Hello, ~U1, nice to meet you.
  57.  
  58. #WP
  59. %
  60. #EF
  61. #T
  62. #C2,R5
  63. You can have up to ten inputs from your ~G~IReader~N, ~C~I0~N through ~C~I9~N, but it
  64.  
  65. is up to you to keep track of which is which.
  66.  
  67.  
  68. Some points to note are that ~C~I~~Un~N can be used inside ~HBoxes~N, but ~H#Y~N cannot.
  69.  
  70. And when using ~C~I~~Un~N inside a ~HBox~N, or even on the screen, be sure to leave
  71.  
  72. enough space for the input.  The maximum size of the input is 30 characters.
  73.  
  74. And inputs are global to the ~M~Itutorial~N, i.e. an input obtained in one Chapter
  75.  
  76. can be displayed in another. To be sure that the input has been given, it is
  77.  
  78. better to ask for it in a ~HMenu Chapter~N.
  79.  
  80.  
  81. And finally, all inputs are lost when the ~M~Itutorial~N is over.
  82. #WP
  83. %
  84. #EF
  85. #T
  86. #C2,R5
  87. Now for the ~HQuick Questions~C~I #QQ~N,  which pose a question, wait for an answer,
  88.  
  89. evaluate the answer and comment whether it is right or wrong.  Then the right
  90.  
  91. answer is presented. The format of this ~HCommand~N is :
  92.  
  93.  
  94.  
  95. ~H#QQ,Type,n
  96. ~Hn lines of question ~N
  97. ~HCorrect Answer
  98. ~HTest strings~N
  99.  
  100.  
  101.  
  102. ~C~IType~N can have the value ~C~IR~N for a ~HQuestion Robot~N  or ~C~IB~N for a ~HBox~N.
  103. #WP
  104. %
  105. #EF
  106. #T
  107. #C2,R4
  108. The ~HQuestion Robot~N needs a screen to itself but the ~HBox~N can overlay other
  109.  
  110. text on the screen, without destroying it.  Another difference is that the
  111.  
  112. ~HQuestion Robot~N is limited to questions with a maximum of three lines and a
  113.  
  114. maximum line length of 40 characters. ~HBox~N can handle up to 16 lines with a
  115.  
  116. maximum width of 70 characters. The ~HBox~N borders are drawn automatically to
  117.  
  118. accommodate the longest line in the question.
  119.  
  120. Both types test answers in the same way. The student's response is examined
  121.  
  122. to see if it contains a ~Htest string~N.  Upper or lower case has no effect but
  123.  
  124. spaces are significant. Up to five test strings can be given, separated by
  125.  
  126. commas. For example to test for ~HPresident~N you might use the following:
  127.  
  128. ~Hpresident,pres,side,ident,ide~N. If any are in the answer, it is correct.
  129.  
  130. #WP
  131. %
  132. #EF
  133. #T
  134. #C2,R5
  135. ~H#EF                               ~NClear the screen
  136. ~H#TQuick Question                  ~NPut a title on
  137. ~H#QQ,R,2                           ~NQuestion Robot with two lines to read
  138. ~HWho shot an apple off his         ~NThe two line Question
  139. ~Hson's head with a crossbow ?
  140. ~HWilliam Tell                      ~NThe Correct Answer
  141. ~Htel,will,ill                      ~NThe test strings to be compared with
  142.                                   the User's answer to determine if it is
  143.                                   correct.
  144.  
  145. ~H#QQ,B,1                           ~NQuestion Box with 1 line to read
  146. ~HWho shot an apple off his son's head with a crossbow ?  ~NThe Question
  147. ~HWilliam Tell                      ~NThe Correct Answer
  148. ~Htel,will,ill                      ~NThe test strings to be compared with
  149.                                   the User's answer to determine if it is
  150.                                   correct.
  151.  
  152. Answer one wrongly and the other correctly to see both results.
  153.  
  154. #WP
  155. %
  156. #EF
  157. #T
  158. #QQ,R,2
  159. Who shot an apple off his
  160. son's head with a crossbow ?
  161. William Tell
  162. tel,will,ill
  163. #D3
  164. #QQ,B,1
  165. Who shot an apple off his son's head with a crossbow ?
  166. William Tell
  167. tel,will,ill
  168. #WP
  169. %
  170. #EF
  171. #T
  172. #C2,R5
  173. Next comes the ~C~I#QQ,F,x1,y1,Tries,word~N question. In this case, you position
  174. the cursor to where you want the input to be accepted. That is the ~C~Ix1,y1~N in
  175. the ~HCommand~N. Then you specify how many ~C~ITries~N the ~G~IReader~N can have to enter the
  176. right letter. And then you add the '~C~Iword~N' or phrase that you want entered.
  177.  
  178. When ~G~ITWTEACH~N reads this ~HCommand~N, it puts a '~C~I_~N' for every letter or space in
  179. '~C~Iword~N' at the ~C~Ix1,y1~N location, then waits for keyboard input. If the input
  180. matches (~HUpper and Lower case are considered the same~N), the character is
  181. filled in. If it is wrong, then after ~C~ITries~N attempts, it is filled in.
  182.  
  183. Let's try it out. I want you to enter the name of the ~HCompany~N which produces
  184. ~H~bTutorialWriter~N, which is ~C~II.E.S.~N  Here's the ~HCommand~N :
  185. ~H#QQ,F,27,16,3,I.E.S.~N
  186.  
  187. This says it is a ~C~IFill-in Question~N, with the ~HCursor~N at ~C~IColumn 27~N on ~C~IRow 16~N,
  188. and you have ~C~I3~N Tries per letter in the word ~C~II.E.S.~N
  189.  
  190. Hit ~HCONTINUE~N to see how it works.
  191. #W
  192. #EL,25
  193. #QQ,F,27,16,3,I.E.S.
  194. #WP
  195. %
  196. #EF
  197. #T
  198. #C2,R5
  199. The last ~HInput Command~N for this Chapter is the most powerful. It is a
  200. ~HBranching~N question and consists of a ~HControl Command~N plus ~HMarkers~N.
  201.  
  202. The Command is written like this:
  203.  
  204. ~H#QQ,C
  205. ~HTest strings come next
  206. ~H&1
  207. ~N  This is displayed if the Test strings are found in the input.
  208.   Then it jumps to &3 and continues the tutorial
  209. ~H&2
  210.   This is displayed if the Test strings are NOT found in the input.
  211.   Then it jumps to &3 and continues the tutorial
  212. ~H&3
  213. ~Hthe ~M~Itutorial~H continues here.~N
  214.  
  215. Any of the ~H~bTutorialWriter~H Commands~N (except the ~C~I#M~H Menu Command~N, of course)
  216. can be used between the ~C~I&1~N and the ~C~I&2~N or the ~C~I&2~N and the ~C~I&3~N. So you can give
  217. a quick comment or a ~M~Imini-tutorial~N, depending on your needs.
  218. #WP
  219. %
  220. #EF
  221. #T
  222. #C2,R5
  223. Here's an example. It uses a couple of ~HCommands~N we haven't covered yet,
  224. the ~C~I#P~N for ~HPlay~N and ~C~I#GT~N for ~HTextscreen~N. But we will cover them in Chapter 8.
  225.  
  226. ~HWhat State are you from?
  227. ~H#QQ,C
  228. ~Htexas,tx,tex
  229. ~H&1
  230. ~H#GT,texas
  231. ~H#Pyellow
  232. ~H&2
  233.  
  234. Sorry to hear that. But we can't all be from Texas, I suppose.
  235. ~H#D5
  236. ~H&3~N
  237.                                                                              
  238. Now, depending on which one of these options you want to test, answer ~HTexas~N
  239. or something else when the question is asked. Then ~Z~w PAGEBACK ~N and try the other
  240. option.
  241. #W
  242. #ES,1,20,80,25
  243. #C2,R20
  244. ~HWhat State are you from?~N
  245. #QQ,C
  246. texas,tx,tex
  247. &1
  248. #GT,texas
  249. #Pyellow
  250. &2
  251.  
  252. Sorry to hear that. But we can't all be from Texas, I suppose.
  253. #D5
  254. &3
  255. #WP
  256. %
  257. #EF
  258. #T
  259. #C2,R10
  260. There are other ways of getting ~HInput~N from your ~G~IReaders~N, in the form of
  261.  
  262. ~C~IQuizzes~N and ~C~ITests~N, and we will cover these in Chapter 7.
  263.  
  264. #WP
  265. #X
  266.