[system] / trunk / pg / macros / answerCustom.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/answerCustom.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 4831 Revision 4845
88# Set this to include any default parameters you want 88# Set this to include any default parameters you want
89# to include in the custom answer checkers 89# to include in the custom answer checkers
90# 90#
91@custom_cmp_defaults = (); 91@custom_cmp_defaults = ();
92 92
93=head3 another example
93 94
94# 95#
95# This one installs a custom list-based answer checker (for the 96# This one installs a custom list-based answer checker (for the
96# List and Union classes). Basically it is just a shell that makes 97# List and Union classes). Basically it is just a shell that makes
97# it a little easier to do, and provides an interface similar to 98# it a little easier to do, and provides an interface similar to
124# calls the "die" function), then the message is reported with the 125# calls the "die" function), then the message is reported with the
125# "pink screen of death", and includes a request for the student to 126# "pink screen of death", and includes a request for the student to
126# inform the instructor. 127# inform the instructor.
127# 128#
128 129
130=cut
131
129sub custom_list_cmp { 132sub custom_list_cmp {
130 my $correct = shift; my $checker = shift; 133 my $correct = shift; my $checker = shift;
131 die "custom_list_cmp requires a correct answer" unless defined($correct); 134 die "custom_list_cmp requires a correct answer" unless defined($correct);
132 die "custom_list_cmp requires a checker subroutine" unless defined($checker); 135 die "custom_list_cmp requires a checker subroutine" unless defined($checker);
133 $correct = Value::makeValue($correct); 136 $correct = Value::makeValue($correct);

Legend:
Removed from v.4831  
changed lines
  Added in v.4845

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9