version 1.24, 2004/09/23 14:55:24
|
version 1.25, 2004/10/08 16:40:54
|
Line 109 sub BuildStudentSubmissionsPage {
|
Line 109 sub BuildStudentSubmissionsPage {
|
my $resource = $navmap->getBySymb($symb); |
my $resource = $navmap->getBySymb($symb); |
push(@Problems,$resource); |
push(@Problems,$resource); |
} |
} |
# |
# |
if (! scalar(@Problems) || ! defined($Problems[0])) { |
if (! scalar(@Problems) || ! defined($Problems[0])) { |
$r->print('resource is undefined'); |
$r->print('resource is undefined'); |
} else { |
} else { |
Line 458 sub html_results {
|
Line 458 sub html_results {
|
sub html_format_sub { |
sub html_format_sub { |
my ($submission,$resptype) = @_; |
my ($submission,$resptype) = @_; |
return '' if (! defined($submission) || $submission eq ''); |
return '' if (! defined($submission) || $submission eq ''); |
|
$submission = &HTML::Entities::decode($submission); |
|
$submission =~ s/\\\"/\"/g; |
|
$submission =~ s/\\\'/\'/g; |
if ($resptype eq 'essay') { |
if ($resptype eq 'essay') { |
$submission =~ s|\\r\\n|$/|g; |
$submission =~ s|\\r\\n|$/|g; |
$submission = &HTML::Entities::encode($submission,'<>&"'); |
$submission = &HTML::Entities::encode($submission,'<>&"'); |
Line 465 sub html_format_sub {
|
Line 468 sub html_format_sub {
|
$submission =~ s|\\||g; |
$submission =~ s|\\||g; |
$submission = '<p>'.$submission.'</p>'; |
$submission = '<p>'.$submission.'</p>'; |
} elsif ($resptype eq 'radiobutton') { |
} elsif ($resptype eq 'radiobutton') { |
|
$submission = &HTML::Entities::encode($submission,'<>&"'); |
$submission =~ s/=([^=])$//; |
$submission =~ s/=([^=])$//; |
} elsif ($resptype =~ /^(option|match|rank)$/) { |
} elsif ($resptype =~ /^(option|match|rank)$/) { |
$submission = |
$submission = |
'<ul class="sub_studentans">'. |
'<ul class="sub_studentans">'. |
'<li>'.join('</li><li>', |
'<li>'.join('</li><li>', |
map { |
map { &HTML::Entities::encode($_,'<>&"'); |
&Apache::lonnet::unescape($_) ; |
} map { |
} sort split('&',$submission) |
&Apache::lonnet::unescape($_) ; |
|
} sort split('&',$submission) |
). |
). |
'</li><ul>'; |
'</li><ul>'; |
|
} else { |
|
$submission = &HTML::Entities::encode($submission,'<>&"'); |
} |
} |
return $submission; |
return $submission; |
} |
} |
Line 709 sub excel_format_response {
|
Line 716 sub excel_format_response {
|
&Apache::lonnet::unescape($_) ; |
&Apache::lonnet::unescape($_) ; |
} sort split('&',$answer) |
} sort split('&',$answer) |
); |
); |
|
} elsif ($responsetype eq 'string') { |
|
$answer =~ s/\\(n|r)/\n/g; |
|
$answer =~ s/(\s*$|^\s*)//g; |
|
$answer =~ s/\\\'/\'/g; |
} |
} |
if ($answer =~ m/^=/) { |
if ($answer =~ m/^=/) { |
$answer = ' '.$answer; |
$answer = ' '.$answer; |