--- loncom/interface/statistics/lonstudentsubmissions.pm 2005/04/12 21:49:49 1.41 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2006/04/29 18:01:17 1.42 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.41 2005/04/12 21:49:49 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.42 2006/04/29 18:01:17 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -190,6 +190,8 @@ sub get_headers { shift(@basic_headers); # Get rid of 'Correct' } @headers = (@foils,@basic_headers); + } elsif (lc($resptype) eq 'task') { + @headers = ('Grader','Status',@basic_headers,'Submission'); } else { @headers = ('Submission',@basic_headers); } @@ -369,6 +371,14 @@ sub prepare_html_output { $response, $single_response). ''); + } elsif (lc($resptype) eq 'task') { + my $results = + &html_task_results(\@headers, + $prob,$partid,$respid, + $response,$resptype); + if ($results) { + push(@{$resp_data->{'real'}},$results); + } } else { push(@{$resp_data->{'real'}}, &html_non_essay_results(\@headers, @@ -442,14 +452,27 @@ sub hashify_response { } $resp_hash->{'Submission'} = $response->[&Apache::loncoursedata::RDs_submission()]; - $resp_hash->{'Award Detail'} = - $response->[&Apache::loncoursedata::RDs_awarddetail()]; $resp_hash->{'Time'} = $response->[&Apache::loncoursedata::RDs_timestamp()]; $resp_hash->{'Attempt'} = $response->[&Apache::loncoursedata::RDs_tries()]; $resp_hash->{'Awarded'} = $response->[&Apache::loncoursedata::RDs_awarded()]; + if ($prob->is_task()) { + $resp_hash->{'Grader'} = + $response->[&Apache::loncoursedata::RDs_response_eval_2()]; + if ($resp_hash->{'Attempt'} eq '0') { + $resp_hash->{'Attempt'} = ''; + } + $resp_hash->{'Award Detail'} = + $response->[&Apache::loncoursedata::RDs_part_award()]; + $resp_hash->{'Status'} = + $response->[&Apache::loncoursedata::RDs_response_eval()]; + } else { + $resp_hash->{'Award Detail'} = + $response->[&Apache::loncoursedata::RDs_awarddetail()]; + } + return $resp_hash; } @@ -512,6 +535,20 @@ sub html_format_essay_sub { return $submission; } +sub html_task_results { + my ($headers,$prob,$partid,$respid,$response,$resptype) = @_; + if (! ref($headers) || ref($headers) ne 'ARRAY' || ! scalar(@$headers)) { + return ''; + } + + my @values; + @values = map { $response->{$_}; } @$headers; + + my $td = ''; + my $str = $td.join(''.$td,@values).''; + return $str; +} + sub html_non_essay_results { my ($headers,$prob,$partid,$respid,$response,$resptype) = @_; if (! ref($headers) || ref($headers) ne 'ARRAY' || ! scalar(@$headers)) { @@ -792,7 +829,9 @@ sub compile_response_data { my $submission = &HTML::Entities::decode (&Apache::lonnet::unescape($response->{'Submission'})); - return () if (! defined($submission) || $submission eq ''); + if (!$prob->is_task()) { + return () if (! defined($submission) || $submission eq ''); + } $submission =~ s/\\\"/\"/g; $submission =~ s/\\\'/\'/g; if ($resptype eq 'radiobutton') { @@ -1106,7 +1145,7 @@ sub CreateInterface { $Str .= ''."\n"; $Str .= ''."\n"; # - $Str .= ''.&mt('Status: [_1]', + $Str .= '

'.&mt('Status: [_1]', ''). ''.'

';