--- loncom/interface/statistics/lonstudentsubmissions.pm 2012/05/03 11:21:33 1.68 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2014/03/28 15:07:01 1.71 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.68 2012/05/03 11:21:33 goltermann Exp $ +# $Id: lonstudentsubmissions.pm,v 1.71 2014/03/28 15:07:01 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -731,8 +731,29 @@ sub html_non_essay_results { push(@values,$response->{$original_header}); } } + # FIXME: Bug #6700 - Properly process multiple answer fields + # Would be a good place here but the data needs to be properly + # compiled somewhere before. + # elsif (($resptype =~ /^(numerical|formula|custom)$/) && + # (submission) && (ref)) { + # de-ref...: push(@values,$response->{$original_header}); } } else { - @values = map { $response->{$_}; } @$headers; + foreach my $original_header (@$headers) { + if ($original_header eq 'Time') { + push(@values,&Apache::lonlocal::locallocaltime($response->{$original_header})); + } elsif (($original_header eq 'Submission') && + !($resptype =~ /^(radiobutton|option|match|rank)$/)) { + # encode all submissions which have not been encoded above + push(@values,&HTML::Entities::encode($response->{$original_header},'<>&"')); + } elsif (($original_header eq 'Correct') && + ($resptype eq 'radiobutton')) { + # encode foil separators + push(@values,&HTML::Entities::encode($response->{$original_header},'&')); + } else { + # A normal column + push(@values,$response->{$original_header}); + } + } } my $td = ''; my $str = $td.join(''.$td,@values).''; @@ -1238,7 +1259,7 @@ sub prepare_csv_output { sub csv_format_item { my ($item,$type) = @_; if ($type eq 'Time') { - $item = localtime($item); + $item = &Apache::lonlocal::locallocaltime($item); } $item =&Apache::loncommon::csv_translate($item); return $item;