[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm
raeburn
raeburn@source.lon-capa.org
Sun, 28 Feb 2010 23:37:03 -0000
raeburn Sun Feb 28 23:37:03 2010 EDT
Modified files:
/loncom/homework essayresponse.pm
Log:
- New awards for surveys:
ANONYMOUS ANONYMOUS_CREDIT SUBMITTED_CREDIT
- given for question types: anonsurvey, anonsurvey_cred, survey_cred.
- anonsurvey -- course personnel can not view both identity of submitter
and submission details.
- anonsurveycred -- same anonymity, but submitter receives 'awarded' for
submission
- surveycred - submitter receives 'awarded' for submission to survey.
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.101 loncom/homework/essayresponse.pm:1.102
--- loncom/homework/essayresponse.pm:1.101 Sat May 23 18:07:57 2009
+++ loncom/homework/essayresponse.pm Sun Feb 28 23:37:03 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.101 2009/05/23 18:07:57 riegler Exp $
+# $Id: essayresponse.pm,v 1.102 2010/02/28 23:37:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -55,11 +55,17 @@
if (!defined($maxfilesize)) {
$maxfilesize = 10.0; #FIXME This should become a domain configuration
}
- if ( $Apache::lonhomework::type eq 'survey' ) {
+ if (($Apache::lonhomework::type eq 'survey') ||
+ ($Apache::lonhomework::type eq 'surveycred') ||
+ ($Apache::lonhomework::type eq 'anonsurvey') ||
+ ($Apache::lonhomework::type eq 'anonsurveycred')) {
$result.= '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" /> ';
}
$result.='<br /><table border="1">';
- if ( $Apache::lonhomework::type ne 'survey' ) {
+ if (($Apache::lonhomework::type ne 'survey') &&
+ ($Apache::lonhomework::type ne 'surveycred') &&
+ ($Apache::lonhomework::type eq 'anonsurvey') &&
+ ($Apache::lonhomework::type ne 'anonsurveycred')) {
$result.= '<tr><td>'.
'<label>'.
'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked="checked" /> '.
@@ -146,7 +152,15 @@
if (( $response =~ /[^\s]/) || ($filename =~ /[^\s]/) || ($portfiles =~ /[^\s]/)) {
my $award='DRAFT';
if ($env{'form.HWDRAFT'.$part.'_'.$id} eq 'yes') {
- $award='SUBMITTED';
+ if ($Apache::lonhomework::type eq 'anonsurvey') {
+ $award='ANONYMOUS';
+ } elsif ($Apache::lonhomework::type eq 'anonsurveycred') {
+ $award='ANONYMOUS_CREDIT';
+ } elsif ($Apache::lonhomework::type eq 'surveycred') {
+ $award='SUBMITTED_CREDIT';
+ } else {
+ $award='SUBMITTED';
+ }
}
my $uploadedflag=0;
my $totalsize=0;