CDC Community

🔹 Historical Conservation 🔹

User Tools

Site Tools


More on Erasing: The -eraseu- Command

When a student's response is judged “no” or “wrong”, he or she can correct the response by hitting ERASE or ERASE1 to erase a letter or word, or by hitting NEXT, EDIT, or EDIT' to erase the entire response. If additional judging keys have been defined with a -jkey- command, these will act like NEXT and erase the response. If there is only one -arrow- command and no -endarrow-, these options are available even after an “ok” judgment (except that a NEXT key or another judging key takes the student to the next main unit rather than merely erasing the response). If there is a “force firsterase”, the student need not clear an incorrect response by pressing NEXT before trying a different response. In this case, the first key of the new response will cause the old response to be erased.

If the student erases part or all of his or her response, the “ok” or “no” is erased. Moreover, the last response-contingent message to the student is erased, since it is no longer relevant. For example:

. . . wrong cat write The cat is not a canine. . . .

The student types “cat” and presses NEXT:

⪢ cat no The cat is not a canine.

Notice that there is a default -at- three lines below the response. Suppose the student now presses ERASE:

⪢ ca

The “t”, the “no”, and the text of the -write- statement have all disappeared automatically. This is appropriate since the comment “The cat is not a canine” is no longer needed.

It is helpful to know that the method TUTOR uses for automatically erasing such text is by re-executing the last -write-, -writec-, or -showstatement in the erase mode. Suppose we change the lesson slightly:

. . . wrong cat write The cat is not a canine. write Meow! . . .

Now the sequence looks like this:

⪢ cat no The cat is not a canine. Meow!

⪢ ca The cat is not a canine.

Only the last -write- statement is removed, leaving “The cat is not a canine” on the screen. Notice that the normal automatic erasing can be prevented simply by adding an extra -write- statement. Even a blank -write- statement will do.

As another example, consider this:

. . . wrongv 4 write Number of apples= show apnum . . .

Only the -show- will be erased, leaving “Number of apples=” on the screen. If this is not desirable, use an embedded -show-:

. . . wrongv 4 write Number of apples=⊀s,apnum⊁ . . .

Now the last -write- statement includes the showing of the number, and all the writing will be erased. It is important not to change “apnum” after the -write-. If you change its value from what it was when shown by the -write-, the re-execution in “mode erase” will turn off the wrong dots in the numerical part of the writing. Here is the type of sequence to be avoided:

. . . wrongv 4 write Number of apples=⊀s,apnum⊁ calc apnum⇐apnum+25 . . .

The number will not be erased properly due to the change in “apnum”.

Similar problems can arise with the other -show- commands, including -showa-.

Sometimes the automatic erasing of the last text statement is insufficient. For example, if the reply to the student included a drawing produced with -draw-, or if there were several -write- statements, you would need some additional mechanism to remove the reply when the student presses ERASE. There is an -eraseu- command which you can use to specify a subroutine to be done when the student changes his or her response:

. . . eraseu eblock arrow 1215 . . . unit eblock at 1512 erase 35,4 at 318 erase 42 . . .

Unit “eblock” will be done whenever the student changes a response. Only the first press of the ERASE key triggers the erase unit, since additional executions of the unit would be erasing nothing.

Another example involves an erase unit specific to a particular response:

. . . wrong 3 dogs do woof eraseu remove . . . unit remove mode erase do woof mode write eraseu . . .

The statement “eraseu remove” defines unit “remove” as the unit to be done when the student presses ERASE (or NEXT, etc.). Unit “remove” in the example shown simply re-does unit “woof” in the erase mode, thus taking off the screen everything originally displayed by unit “woof”. The final blank -eraseu- clears the pointer so there is no longer an erase unit specified.

Notice the similarities between the -imain- and -eraseu- commands. Both specify units to be done under specific conditions.

Keeping Things on the Screen: "inhibit erase"

tutor/more_on_erasing.txt · Last modified: 2022/08/25 20:35 by