# CDC Community

đč Historical Conservation đč

### Site Tools

tutor:judge_command

# 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â.