[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm inputtags.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 26 Mar 2004 20:10:42 -0000
albertel Fri Mar 26 15:10:42 2004 EDT
Modified files:
/loncom/homework inputtags.pm default_homework.lcpm
Log:
- Fixes for #870, now can tell te difference between when I student types in a a garbage unit, and when they type in a wrong unit
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.136 loncom/homework/inputtags.pm:1.137
--- loncom/homework/inputtags.pm:1.136 Fri Mar 12 19:36:11 2004
+++ loncom/homework/inputtags.pm Fri Mar 26 15:10:42 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.136 2004/03/13 00:36:11 albertel Exp $
+# $Id: inputtags.pm,v 1.137 2004/03/26 20:10:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -305,7 +305,9 @@
}
if (defined($result)) { return ($result,$msg); }
foreach my $possibleaward ('MISSING_ANSWER', 'ERROR', 'NO_RESPONSE',
- 'TOO_LONG', 'UNIT_FAIL', 'NO_UNIT',
+ 'TOO_LONG', 'UNIT_INVALID_INSTRUCTOR',
+ 'UNIT_INVALID_STUDENT', 'UNIT_IRRECONCIBLE',
+ 'UNIT_FAIL', 'NO_UNIT',
'UNIT_NOTNEEDED', 'WANTED_NUMERIC',
'BAD_FORMULA', 'SIG_FAIL', 'INCORRECT',
'MISORDERED_RANK', 'INVALID_FILETYPE',
@@ -413,7 +415,18 @@
$message = &mt("Significant figures are incorrect, you provided [_1] significant figures while [_2] to [_3] were expected. Submission not graded.",(split(/:/,$awardmsg)));
$bgcolor=$possiblecolors{'not_charged_try'};
$button=1;
- } elsif ($award eq 'UNIT_FAIL') {
+ } elsif ($award eq 'UNIT_INVALID_INSTRUCTOR') {
+ $message = &mt('Error in instructor specifed unit. This error has been reported to the instructor.', $awardmsg);
+ if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}
+ $bgcolor=$possiblecolors{'not_charged_try'};
+ $button=1;
+ } elsif ($award eq 'UNIT_INVALID_STUDENT') {
+ $message = &mt('Unable to interpret units. Computer reads units as "[_1]"',
+ $awardmsg);
+ if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}
+ $bgcolor=$possiblecolors{'not_charged_try'};
+ $button=1;
+ } elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') {
$message = &mt('Units incorrect. Computer reads units as "[_1]"',
$awardmsg);
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.76 loncom/homework/default_homework.lcpm:1.77
--- loncom/homework/default_homework.lcpm:1.76 Mon Mar 22 16:05:15 2004
+++ loncom/homework/default_homework.lcpm Fri Mar 26 15:10:42 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
#
-# $Id: default_homework.lcpm,v 1.76 2004/03/22 21:05:15 albertel Exp $
+# $Id: default_homework.lcpm,v 1.77 2004/03/26 20:10:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -135,7 +135,11 @@
elsif ($result == '9') { $result='ANS_CNT_NOT_MATCH'; }
elsif ($result =='10') { $result='SUB_RECORDED'; }
elsif ($result =='11') { $result='BAD_FORMULA'; }
- elsif ($result =='12') { $result='WANTED_NUMERIC'; }
+ elsif ($result =='13') { $result='UNIT_INVALID_INSTRUCTOR'; }
+ elsif ($result =='141') { $result='UNIT_INVALID_STUDENT'; }
+ elsif ($result =='142') { $result='UNIT_INVALID_STUDENT'; }
+ elsif ($result =='143') { $result='UNIT_INVALID_STUDENT'; }
+ elsif ($result =='15') { $result='UNIT_IRRECONCIBLE'; }
else {$result = "ERROR: Unknown Result:$result:$@:";}
return ("$result:\nRetError $reterror:\nError $error:\nAnswer $answer:\nResponse $response:\n type-$type|$tol|$tol_type|$sig:$sig_lbound:$sig_ubound|$unit|\n$message",$reterror);