--- loncom/homework/grades.pm 2006/02/28 16:21:51 1.324
+++ loncom/homework/grades.pm 2006/04/10 06:34:07 1.349
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.324 2006/02/28 16:21:51 albertel Exp $
+# $Id: grades.pm,v 1.349 2006/04/10 06:34:07 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -118,9 +118,10 @@ sub response_type {
my %seen = ();
my (@partlist,%handgrade,%responseType);
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) {
- if (/^\w+response_.*/) {
+ if (/^\w+response_.*/ || /^Task_/) {
my ($responsetype,$part) = split(/_/,$_,2);
my ($partid,$respid) = split(/_/,$part);
+ if ($responsetype eq 'Task') { $respid='0'; }
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) {
next;
}
@@ -205,9 +206,11 @@ sub get_order {
return ($analyze{"$partid.$respid.shown"});
}
#--- Clean response type for display
-#--- Currently filters option/rank/radiobutton/match/essay response types only.
+#--- Currently filters option/rank/radiobutton/match/essay/Task
+# response types only.
sub cleanRecord {
- my ($answer,$response,$symb,$partid,$respid,$record,$order,$version) = @_;
+ my ($answer,$response,$symb,$partid,$respid,$record,$order,$version,
+ $uname,$udom) = @_;
my $grayFont = '';
if ($response =~ /^(option|rank)$/) {
my %answer=&Apache::lonnet::str2hash($answer);
@@ -288,6 +291,37 @@ sub cleanRecord {
my $jme=$record->{$version."resource.$partid.$respid.molecule"};
$result.=&Apache::chemresponse::jme_img($jme,$answer,400);
return $result;
+ } elsif ( $response eq 'Task') {
+ if ( $answer eq 'SUBMITTED') {
+ my $files = $record->{$version."resource.$respid.$partid.bridgetask.portfiles"};
+ my $result = &Apache::bridgetask::file_list($files,$uname,$udom);
+ return $result;
+ } elsif ( grep(/^\Q$version\E.*?\.instance$/, keys(%{$record})) ) {
+ my @matches = grep(/^\Q$version\E.*?\.instance$/,
+ keys(%{$record}));
+ return join(' '
+ .&mt('Overall result: [_1]',
+ $record->{$version."resource.$respid.$partid.status"})
+ .'
',($version,@matches));
+
+
+ } else {
+ my $result =
+ '';
+ my @grade = grep(/^\Q${version}resource.$respid.$partid.\E[^.]*[.]status$/,
+ keys(%{$record}));
+ foreach my $grade (sort(@grade)) {
+ my ($dim) = ($grade =~/[.]([^.]+)[.]status$/);
+ $result.= '
';
+ return $result;
+ }
+
}
return $answer;
}
@@ -556,7 +590,7 @@ sub verifyreceipt {
my $title.='Verifying Submission Receipt '.
$receipt.'
'."\n".
- 'Resource: '.$env{'form.probTitle'}.'
'."\n";
+ 'Resource: '.$env{'form.probTitle'}.'
'."\n";
my ($string,$contents,$matches) = ('','',0);
my (undef,undef,$fullname) = &getclasslist('all','0');
@@ -688,7 +722,14 @@ LISTJAVASCRIPT
$gradeTable.=''."\n".
''."\n".
''."\n".
- ''."\n".
+ '
'."\n".
+ ' Grading Increments: '.
+
''."\n".
''."\n".
'
'."\n".
@@ -1264,7 +1305,7 @@ sub sub_page_kw_js {
pDoc.write("