--- loncom/homework/response.pm 2009/04/17 01:00:15 1.214
+++ loncom/homework/response.pm 2010/06/20 12:42:44 1.218
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.214 2009/04/17 01:00:15 www Exp $
+# $Id: response.pm,v 1.218 2010/06/20 12:42:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,7 +30,7 @@
=head1 NAME
-Apache::resonse.pm
+Apache::response.pm
=head1 SYNOPSIS
@@ -318,7 +318,10 @@ sub handle_previous {
if ($$previous{'last'}) {
push(@Apache::inputtags::previous,'PREVIOUSLY_LAST');
push(@Apache::inputtags::previous_version,$$previous{'version'});
- } elsif ($Apache::lonhomework::type ne 'survey') {
+ } elsif (($Apache::lonhomework::type ne 'survey') &&
+ ($Apache::lonhomework::type ne 'surveycred') &&
+ ($Apache::lonhomework::type ne 'anonsurvey') &&
+ ($Apache::lonhomework::type ne 'anonsurveycred')) {
push(@Apache::inputtags::previous,'PREVIOUSLY_USED');
push(@Apache::inputtags::previous_version,$$previous{'version'});
}
@@ -439,7 +442,7 @@ sub end_customresponse {
${$safeeval->varglob('LONCAPA::customresponse_submission')}=
$response;
- my $award = &Apache::run::run('{ my $submission=$LONCAPA::customresponse_submission;'.$Apache::response::custom_answer[-1].'}',$safeeval);
+ my ($award,$score) = &Apache::run::run('{ my $submission=$LONCAPA::customresponse_submission;'.$Apache::response::custom_answer[-1].'}',$safeeval);
if (!&Apache::inputtags::valid_award($award)) {
$error = $award;
$award = 'ERROR';
@@ -447,6 +450,9 @@ sub end_customresponse {
&Apache::response::handle_previous(\%previous,$award);
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=
$award;
+ if ($award eq 'ASSIGNED_SCORE') {
+ $Apache::lonhomework::results{"resource.$part.$id.awarded"}=1.0*$score;
+ }
if ($error) {
$Apache::lonhomework::results{"resource.$part.$id.awardmsg"}=
$error;
@@ -546,7 +552,7 @@ function edit_${id}_${field} (textarea)
newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable");
}
-
+
ENDFORMULABUTTON
}
@@ -904,6 +910,10 @@ sub showallfoils {
}
}
if ($Apache::lonhomework::type eq 'survey') { return 1; }
+ if ($Apache::lonhomework::type eq 'surveycred') { return 1; }
+ if ($Apache::lonhomework::type eq 'anonsurvey') { return 1; }
+ if ($Apache::lonhomework::type eq 'anonsurveycred') { return 1; }
+
return 0;
}