From: Davide P.C. <dp...@un...> - 2005-08-15 22:58:45
|
Folks: When I wrote the Parser code, one of the things I was after was consistency in terms of error messages. Since the same parser was being used for ALL types of answers, it would know about the other types of objects no matter what type of answer you were looking for. For example, if you are checking for a numeric answer, the Parser still will give appropriate error messages even when the student types an interval: it will say something to the effect that you typed an interval but that it expected a number. Since you have the ability to change the Context, however, that somewhat undermines this, since you can remove its knowledge of some types of objects (e.g., the Numeric class does not know about points). When I developed the Legacy module for the Parser, which makes num_cmp and fun_cmp use the Parser answer checkers, I implemented contexts that mirrored the traditional num_cmp and fun_cmp environments as closely as I could. This is the right thing to do for backward compatibility, but I'm not sure it is the best idea for the future. For example, all the default Parser contexts include definitions for NONE, INF, INFINITY, -INF, -INFINITY, and DNE, as common strings that might be used in other parts of the problem, so the Parser should recognize these and respond appropriately when the student enters them when some other type of answer is expected (usually they are marked incorrect silently). I took these out of the num_cmp and fun_cmp contexts, however, so if a student types NONE in an answer blank for num_cmp, he or she will get an error message instead (but it will at least be "'NONE' has no meaning in this context" rather than a message about an undefined variable 'N'). I think that in the long run, NONE, DNE, and the infinities should all be defined all the time. Do you think these should be added back into the Parser-based versions of num_cmp and fun_cmp? Davide |