CDC Community

🔹 Historical Conservation 🔹

User Tools

Site Tools


The -judge- Command

We have encountered the regular command -judge- (not a judging command) and have seen how it can be used to “judge wrong” a response that had already received an “ok” judgment. The -judgecommand may also be used to “judge ok” a response (disregarding what a previous judging command may have had to say). The following is a conditional form for this type of -judge- command:

judge 3a-b,ok,x,wrong

This form will either make the judgment “ok”, leave the current judgment as is (the “x” option), or make the judgment “wrong”, depending on the condition “3a-b”.

Here is a useful example:

unit negative at 1214 write Give me a negative number: arrow 1516 store num write Cannot evaluate your expression. ok $$ terminate judging judge num<0,ok,wrong writec num<0,Good!,That's positive!

We could just as well have written “judge num<O,x,wrong” since the original judgment was a universal “ok”. (Later we will study -ansv- and -wrongv- which are also useful in numerical judging.) Note that “judge ok” and “judge wrong” do not cut off the following commands. In the above example, the -writec- is performed, even though it follows the -judge- command. The -judge- command here merely alters the judgment. If you want to cut off the following commands, you can use “judge okquit” or “judge noquit”.

We have been using the -ok- or -no- commands to terminate judging unconditionally, as in the last example. It is sometimes useful to be able to switch in the other direction, from the regular state to the judging state. For example, suppose you want to count the number of attempts the student makes to satisfy the -arrow-:

. . . calc attempt⇐0 arrow 1518 ok calc attempt⇐attempt+1 judge continue answer cat . .

Judging starts just after the -arrow-. The -ok- terminates judging to permit executing the regular -calc- which increments the “attempt” counter. Then the regular -judge- command says “continue judging”, which switches TUTOR back into the judging state to examine the -answer- and other judging commands which follow. If the response is finally judged “no”, the student will respond again, and since judging starts each time from the -arrow-, the “attempt” counter will record each try. (Actually, system variable “ntries” automatically counts the number of tries, but structures similar to the structure illustrated here are often useful.)

Leaving out the -ok- and “judge continue” (which permit counting each attempt) is a common mistake. If you write:

. . . calc attempt⇐0 arrow 1518 calc attempt⇐attempt+1 answer cat . .

then “attempt” will stop at one. TUTOR initializes “attempt” to 0, then encounters the -arrow- and notes its position in the unit. Then, the following -calc- increments “attempt” to 1, after which the -answerjudging command terminates this regular processing to await the student's response. The student then enters his or her response and TUTOR starts judging. The first command after the -arrow- is the incrementing -calc-, which is skipped because it is a regular command and TUTOR is looking for judging commands. This will happen on each response entry, so “attempt” never gets larger than one. This explains the importance of bracketing the -calc- with -ok- and “judge continue”.

A related option is “judge rejudge” which is similar to “judge continue”. We have seen that “specs bumpshift” alters the “judging copy” of the response by knocking out the shift characters. The judging copy is the version of the response which is examined by the judging commands (such as -answer-). This version may differ from the student's actual response due to various operations such as “specs bumpshift”. It is also possible to -bump- other characters or to -put- one string of characters in place of another. All such operations affect the judging copy only and do not touch the original response, which remains unmodified. The statement “judge rejudge” replaces the judging copy of the response with the original response, thus cancelling the effects of any previous modifications of the judging copy. The statement also initializes the system variables associated with judging, including “anscnt”. It is, therefore, much more drastic than “judge continue”, which merely switches TUTOR to the judging state without affecting the judging copy or the system variables.

Another exceedingly useful -judge- option is “judge ignore” which erases the student's response from the screen and permits him or her to type another response without first having to use NEXT or ERASE. Unlike “judge wrong”, “ok”, or “continue”, “judge ignore” stops all processing and waits for new student input. (Even the commands following a -specs- won't be performed.) On the other hand, TUTOR goes on to the following commands after processing -judge- with tags “ok”, “wrong”, or “continue”.

The following routine (which permits the student to move a cursor on the screen) is a good example of the heightened interaction made possible through the use of “judge ignore”. We use the typewriter keys d,e,w,q,a,z,x, and c which are clustered around a 3 key by 3 key square on the keyboard, to indicate the eight compass directions for the cursor to move on the screen. These keys (shown in Fig. 7-2) have small arrows on them to indicate their common use for moving a cursor.

unit cursor calc x⇐y⇐250 $$ initialize cursor position dx⇐dy⇐10 $$ cursor step size do plot $$ plot cursor on screen inhibit arrow $$ don't show the arrowhead arrow 3201 long 1 specs $$ come here after judging do move $$ -do- is a regular command answer d $$ east: anscnt= 1 answer e $$ northeast 2 answer w $$ north 3 answer q $$ northwest 4 answer a $$ west 5 answer z $$ southwest 6 answer x $$ south 7 answer c $$ southeast 8 ignore $$ equivalent to: { no * { judge ignore unit move * erase old cursor mode erase do plot mode write * increment x and y on the basis of "anscnt" calcs anscnt-2,x⇐x+dx,x+dx,x,x-dx,x-dx,x-dx, x,x+dx calcs anscnt-2,yy,y+dy,y+dy,y+dy,y, y-dy,y-dy,y-dy do plot judge ignore unit plot at x,y write + $$ use "+" for cursor

This routine permits the student to move the cursor rapidly in any direction on the screen. A letter which matches one of the -answerstatements will cause the -calcs- statements to update x and y appropriately to move in one of the eight compass directions. The “long 1” makes it unnecessary to press NEXT to initiate judging, and the “judge ignore” after the replotting of the cursor again leaves TUTOR awaiting a new response. The “judge ignore” greatly simplifies repetitive response handling such as that which arises in this example. Normally, such a cursor-moving routine would be associated with options to perform some action, such as drawing a line. This would make it possible for the student to draw figures on the screen.

In addition to the -judge- options discussed above, there is a “judge exit” which throws away the NEXT or timeup key that had initated judging. This leaves the student in a state to type another letter on the end of his or her response. This can be used to achieve special timing and animation effects.

To summarize, the -judge- command is a regular command used for controlling various judging aspects. The -ok-, -no-, and -ignore- are judging commands which somewhat parallel the “judge ok”, “judge no”, and “judge ignore” options. The “judge rejudge” and “judge continue” options make it possible to switch from the regular state to the judging state (with or without reinitializing the judging copy of the student response and the system variables associated with judging). All of these options may appear in a conditional -judge- with “x” meaning “do nothing”:

judge expr,no,x,ok,continue,wrong,rejudge,x,ignore,ok

The subtle difference between “judge wrong” and “judge no” will be discussed in Chapter 12 in the section on “Student Response Data”. Basically, “judge wrong” is used to indicate an anticipated (specific) wrong response, whereas “judge no” indicates an unanticipated student response. Additional -judge- options are “quit”, “okquit”, and “noquit”.

Finding Key Words: The -match- and -storen- Commands

tutor/judge_command.txt · Last modified: 2022/08/25 13:31 by site_admin