The judging commands -bump- and -put- operate on the judging copy of the student's response. It is sometimes useful to manipulate other strings of characters with -pack-, -move-, and -search-. These commands are regular commands, not judging commands. Like -showa-, they operate on stored character strings, not the judging copy of the student's response. These commands are mentioned here because they are often used in association with the analyzing of student responses. In particular, the judging command -stores- can be used to get the response character string. It can then be operated on with -move- and -search-. Finally, the altered character string can be loaded back into the judging copy with the judging command -loada- (load alphanumeric; the -loada- command is precisely the opposite of -storea-). Since this section deals with a rather esoteric topic, you might just skim through it now to get a rough idea of what character string manipulations look like. If you later find a need for such operations, you should study this section again.
Here is an example of a -move- statement:
This means “move 8 characters from the 5th character of the string that starts in v3 to the 21st character of the string that starts in v52.” The 21st through 28th characters of the v52 character string are replaced by the 5th through the 12th characters of the v3 character string. The v3 character string is unaffected. In other words, -move- has the form:
If the number of characters to move is not specified, one character will be moved.
Here is an example of the use of -move-. Suppose the student types “x+4y = y-3”, and we want to convert this into the form “x+4y- (y-3)” before using -store- on it. Assume “str” has been defined:
In the -move- command the parenthesis within single quote marks, ')', means a character string one character long consisting of a right parenthesis. Similarly, `dog' would denote a character string consisting of d,o, and g. Character strings up to ten characters in length may be described this way, using single quote marks. The -move- command shown above moves the first character of ')', which is just a right parenthesis, to the (jcount + 1)th character position in “str”. This effectively appends a right parenthesis to the student's character string (as modified by the -putd-). The -loada- command moves the final character string into the judging copy so that -store- can operate on it. Note carefully the switches from the judging state to the regular state and back again.
The -search- command is used to look for occurrences of specific character strings. It has the form:
Suppose we use -storea- to place the unaltered student response “x+4y=y-3” in “str,jcount”. Then use:
This -search- command will set the variable “charnum” to 5, since the equal sign is the 5th character in “x+4y—–y -3”. If the search is unsuccessful, “charnum” is set to -I. As further illustration of -move- and -search-, let's rewrite our earlier sequence without the -putd-:
The -search- finds the equal sign. The first -move- moves the latter part of the string to make room for the insertion of -c. The second -movemakes the insertion which overwrites the characters (=y) which were there originally. The third -move- appends the `r. Normally, the -searchwould be followed by a “goto charnum,noeq,x” to take care of the case where the student did not use an equal sign, in which case “charnum” would be -1.
The single quote marks can be used to specify character strings up to ten characters long. Longer character strings can be placed in variables with a -pack- command:
This packs a character string 26 characters long into v11 and following variables. The character count (26 in this case) is placed in v3. Since each variable holds ten characters, v11 and v12 will be full while v13 will have the last six characters. The -pack- command might be considered analogous to -storea-, since both place character strings in variables. In the case of -storea-, the total character count can be gotten from the systemdefined variable “jcount”. Here is another example:
This will display “H2S04” on the screen. The character count in vl will be ten, including three shift codes and two subscripts. The character string H2SO4 is actually composed of shift, h, subscript, 2, shift, s, shift, o, subscript, 4. The character count portion of a -pack- command can be left blank, as in “pack v12„dog”, the result of which could be displayed later with the statement “showa v12”. It is possible to embed “show” commands in a -pack- statement:
There is also a conditional form, -packc-, analogous to -writec-:
There are other string-oriented commands. For example, -clock- will get the time, -date- gets today's date, -name- gets the (18-character) name the student is registered under, and -course- gets the course the student is registered in. These commands are used in the following illustration:
Suppose the student is registered as “sam nottingham” in a course “french4.” It is 10:45:37 PM (22:45:37 on a 24-hour clock) on June 3, 1974. The student will receive this display:
All of these commands, -name-, -course-, -clock-, and -date-, simply place the requested character string in the specified variable for use in a -showa-.
The -clock- command produces a character string. In addition, there is a system variable “clock” which may be used in calculational expressions. It holds the number of seconds of a daily clock to the nearest thousandth of a second, and is convenient for calculating the amount of time spent in a section of a lesson.
The -date- command also produces a character string. There is also a -day- command which produces a number corresponding to the number of days elapsed since January 1, 1973. This number of days and fraction of a day is accurate to one-tenth of a second.
The TUTOR judging commands offer a great deal of power. We have seen that the judging commands -bump- and -put- together with the regular string-oriented commands -move-, -search-, and -pack- can be used to change an otherwise intractable response into a form which can be handled with TUTOR judging commands. This is a useful scheme as
long as only minor modifications are required. However, if major modifications of the response are required in order to be able to use TUTOR judging facilities, it is usually simpler to “do your own judging.” That is, get the student's response with a -storea- and then analyze it with string-oriented commands, together with the additional calculational machinery described in Chapter 9. You might not even want to use the built-in marker features of the -arrow- command, with the associated returns to the -arrow-, when there is a “no” judgment. In such circumstances you might write a subroutine to be used in place of -arrow- commands, which merely collects the student's response:
Instead of writing “arrow 1815” with associated judging commands you would then write:
Naturally, this course of action is advisable only if you are trying to analyze responses which have a form very different from those classes of responses which can be handled well by TUTOR judging commands.