home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
COMPUSCI
/
TW30.ZIP
/
TWTUT5.CHP
< prev
next >
Wrap
Text File
|
1992-11-28
|
7KB
|
266 lines
%
#EF
#TGETTING INPUT
#C2,R5
In this Chapter we will look at ways you can get your ~G~IReaders~N actively
involved in your ~M~Itutorial~N.
There are a number of ~HCommands~N in ~H~bTutorialWriter~N which require input from
the ~G~IReader~N. They are :
~H #Y ~N - asks for information~H
#QQ,R ~N - asks a Question and checks the answer.~H
#QQ,B ~N - same as #QQ,R in a different format.~H
#QQ,F ~N - asks for a specific answer.~H
#QQ,C ~N - asks for an answer and Branches.
#W
%
#EF
#T
#C2,R5
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.
You phrase the question you want answered using the normal ~HCommands~N, then
when you use the ~C~I#Yn~H Command~N, the program will accept a line of input up to
30 characters long, at the ~HCURRENT CURSOR LOCATION~N.
To 'play back' the input, you use an ~HInline Command~N,~C~I ~~Un~N, where ~C~In~N matches
~C~I#Y ~Nnumber. Here's an example :
~H~~HWhat is your first name ?~~N
{ #Y1
~H ~~HHello, ~~U1, nice to meet you.~~N
#C2
~NLet's try it out.
#W
#ES,1,18,80,25
#C2,R18
~H What is your first name ?~N
#Y1
~H Hello, ~U1, nice to meet you.
#WP
%
#EF
#T
#C2,R5
You can have up to ten inputs from your ~G~IReader~N, ~C~I0~N through ~C~I9~N, but it
is up to you to keep track of which is which.
Some points to note are that ~C~I~~Un~N can be used inside ~HBoxes~N, but ~H#Y~N cannot.
And when using ~C~I~~Un~N inside a ~HBox~N, or even on the screen, be sure to leave
enough space for the input. The maximum size of the input is 30 characters.
And inputs are global to the ~M~Itutorial~N, i.e. an input obtained in one Chapter
can be displayed in another. To be sure that the input has been given, it is
better to ask for it in a ~HMenu Chapter~N.
And finally, all inputs are lost when the ~M~Itutorial~N is over.
#WP
%
#EF
#T
#C2,R5
Now for the ~HQuick Questions~C~I #QQ~N, which pose a question, wait for an answer,
evaluate the answer and comment whether it is right or wrong. Then the right
answer is presented. The format of this ~HCommand~N is :
~H#QQ,Type,n
~Hn lines of question ~N
~HCorrect Answer
~HTest strings~N
~C~IType~N can have the value ~C~IR~N for a ~HQuestion Robot~N or ~C~IB~N for a ~HBox~N.
#WP
%
#EF
#T
#C2,R4
The ~HQuestion Robot~N needs a screen to itself but the ~HBox~N can overlay other
text on the screen, without destroying it. Another difference is that the
~HQuestion Robot~N is limited to questions with a maximum of three lines and a
maximum line length of 40 characters. ~HBox~N can handle up to 16 lines with a
maximum width of 70 characters. The ~HBox~N borders are drawn automatically to
accommodate the longest line in the question.
Both types test answers in the same way. The student's response is examined
to see if it contains a ~Htest string~N. Upper or lower case has no effect but
spaces are significant. Up to five test strings can be given, separated by
commas. For example to test for ~HPresident~N you might use the following:
~Hpresident,pres,side,ident,ide~N. If any are in the answer, it is correct.
#WP
%
#EF
#T
#C2,R5
~H#EF ~NClear the screen
~H#TQuick Question ~NPut a title on
~H#QQ,R,2 ~NQuestion Robot with two lines to read
~HWho shot an apple off his ~NThe two line Question
~Hson's head with a crossbow ?
~HWilliam Tell ~NThe Correct Answer
~Htel,will,ill ~NThe test strings to be compared with
the User's answer to determine if it is
correct.
~H#QQ,B,1 ~NQuestion Box with 1 line to read
~HWho shot an apple off his son's head with a crossbow ? ~NThe Question
~HWilliam Tell ~NThe Correct Answer
~Htel,will,ill ~NThe test strings to be compared with
the User's answer to determine if it is
correct.
Answer one wrongly and the other correctly to see both results.
#WP
%
#EF
#T
#QQ,R,2
Who shot an apple off his
son's head with a crossbow ?
William Tell
tel,will,ill
#D3
#QQ,B,1
Who shot an apple off his son's head with a crossbow ?
William Tell
tel,will,ill
#WP
%
#EF
#T
#C2,R5
Next comes the ~C~I#QQ,F,x1,y1,Tries,word~N question. In this case, you position
the cursor to where you want the input to be accepted. That is the ~C~Ix1,y1~N in
the ~HCommand~N. Then you specify how many ~C~ITries~N the ~G~IReader~N can have to enter the
right letter. And then you add the '~C~Iword~N' or phrase that you want entered.
When ~G~ITWTEACH~N reads this ~HCommand~N, it puts a '~C~I_~N' for every letter or space in
'~C~Iword~N' at the ~C~Ix1,y1~N location, then waits for keyboard input. If the input
matches (~HUpper and Lower case are considered the same~N), the character is
filled in. If it is wrong, then after ~C~ITries~N attempts, it is filled in.
Let's try it out. I want you to enter the name of the ~HCompany~N which produces
~H~bTutorialWriter~N, which is ~C~II.E.S.~N Here's the ~HCommand~N :
~H#QQ,F,27,16,3,I.E.S.~N
This says it is a ~C~IFill-in Question~N, with the ~HCursor~N at ~C~IColumn 27~N on ~C~IRow 16~N,
and you have ~C~I3~N Tries per letter in the word ~C~II.E.S.~N
Hit ~HCONTINUE~N to see how it works.
#W
#EL,25
#QQ,F,27,16,3,I.E.S.
#WP
%
#EF
#T
#C2,R5
The last ~HInput Command~N for this Chapter is the most powerful. It is a
~HBranching~N question and consists of a ~HControl Command~N plus ~HMarkers~N.
The Command is written like this:
~H#QQ,C
~HTest strings come next
~H&1
~N This is displayed if the Test strings are found in the input.
Then it jumps to &3 and continues the tutorial
~H&2
This is displayed if the Test strings are NOT found in the input.
Then it jumps to &3 and continues the tutorial
~H&3
~Hthe ~M~Itutorial~H continues here.~N
Any of the ~H~bTutorialWriter~H Commands~N (except the ~C~I#M~H Menu Command~N, of course)
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
a quick comment or a ~M~Imini-tutorial~N, depending on your needs.
#WP
%
#EF
#T
#C2,R5
Here's an example. It uses a couple of ~HCommands~N we haven't covered yet,
the ~C~I#P~N for ~HPlay~N and ~C~I#GT~N for ~HTextscreen~N. But we will cover them in Chapter 8.
~HWhat State are you from?
~H#QQ,C
~Htexas,tx,tex
~H&1
~H#GT,texas
~H#Pyellow
~H&2
Sorry to hear that. But we can't all be from Texas, I suppose.
~H#D5
~H&3~N
Now, depending on which one of these options you want to test, answer ~HTexas~N
or something else when the question is asked. Then ~Z~w PAGEBACK ~N and try the other
option.
#W
#ES,1,20,80,25
#C2,R20
~HWhat State are you from?~N
#QQ,C
texas,tx,tex
&1
#GT,texas
#Pyellow
&2
Sorry to hear that. But we can't all be from Texas, I suppose.
#D5
&3
#WP
%
#EF
#T
#C2,R10
There are other ways of getting ~HInput~N from your ~G~IReaders~N, in the form of
~C~IQuizzes~N and ~C~ITests~N, and we will cover these in Chapter 7.
#WP
#X