[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm inputtags.pm doc/homework datastorage
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 23 May 2003 07:04:44 -0000
albertel Fri May 23 03:04:44 2003 EDT
Modified files:
/doc/homework datastorage
/loncom/homework default_homework.lcpm inputtags.pm
Log:
- Fxes Bug #941, students submitting answers over 500 characters in length mad capa engine unhappy
- documented INVALID_FILETYPE
- finished off support for ERROR return (and documented)
Index: doc/homework/datastorage
diff -u doc/homework/datastorage:1.19 doc/homework/datastorage:1.20
--- doc/homework/datastorage:1.19 Thu Apr 24 11:49:46 2003
+++ doc/homework/datastorage Fri May 23 03:04:43 2003
@@ -100,6 +100,11 @@
# resource.partid.responseid.awarded
# the real awarded should be set to the
# average of the individual awardeds
+ # TOO_LONG : answer submission to capa engine longer
+ # than 500 characters
+ # INVALID_FILETYPE : student tried to upload a file
+ # that was of an extension that was
+ # not specficy allowed
resource.partid.responseid.awarded # float between 0 and 1, percentage of
# resource.partid.weight that the student earned.
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.61 loncom/homework/default_homework.lcpm:1.62
--- loncom/homework/default_homework.lcpm:1.61 Wed Apr 30 17:10:50 2003
+++ loncom/homework/default_homework.lcpm Fri May 23 03:04:44 2003
@@ -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.61 2003/04/30 21:10:50 albertel Exp $
+# $Id: default_homework.lcpm,v 1.62 2003/05/23 07:04:44 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,6 +61,8 @@
} else {
$message .="no ws in :$response:\n";
}
+
+ if (length($response) > 500) { return "TOO_LONG: Answer too long"; }
if ($type eq '' ) {
$message .= "Didn't find a type :$type:$expr: defaulting\n";
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.101 loncom/homework/inputtags.pm:1.102
--- loncom/homework/inputtags.pm:1.101 Fri May 9 18:24:05 2003
+++ loncom/homework/inputtags.pm Fri May 23 03:04:44 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.101 2003/05/09 22:24:05 albertel Exp $
+# $Id: inputtags.pm,v 1.102 2003/05/23 07:04:44 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -251,7 +251,9 @@
if ($result eq '' ) {
foreach $award (@_) { if ($award eq 'NO_RESPONSE') {$result='NO_RESPONSE'; last;} }
}
-
+ if ($result eq '' ) {
+ foreach $award (@_) { if ($award eq 'TOO_LONG') {$result='TOO_LONG'; last;}}
+ }
if ($result eq '' ) {
foreach $award (@_) {
if ($award eq 'UNIT_FAIL' ||
@@ -336,6 +338,12 @@
} elsif ($award eq 'MISSING_ANSWER') {
$message = 'Some parts were not submitted';
$button = 1;
+ } elsif ($award eq 'ERROR') {
+ $message = 'An error occured while trying to grade answer.';
+ $button = 1;
+ } elsif ($award eq 'TOO_LONG') {
+ $message = "The submitted answer was too long.";
+ $button=1;
} elsif ($award eq 'WANTED_NUMERIC') {
$message = "This question expects a numeric answer";
$button=1;