--- loncom/homework/grades.pm 2014/02/27 02:52:22 1.596.2.12.2.29
+++ loncom/homework/grades.pm 2019/07/07 15:31:52 1.596.2.12.2.48
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.596.2.12.2.29 2014/02/27 02:52:22 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12.2.48 2019/07/07 15:31:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,6 +44,9 @@ use Apache::Constants qw(:common :http);
use Apache::lonlocal;
use Apache::lonenc;
use Apache::bridgetask();
+use Apache::lontexconvert();
+use HTML::Parser();
+use File::MMagic;
use String::Similarity;
use LONCAPA;
@@ -354,7 +357,7 @@ sub reset_caches {
}
sub scantron_partids_tograde {
- my ($resource,$cid,$uname,$udom,$check_for_randomlist,$bubbles_per_row) = @_;
+ my ($resource,$cid,$uname,$udom,$check_for_randomlist,$bubbles_per_row,$scancode) = @_;
my (%analysis,@parts);
if (ref($resource)) {
my $symb = $resource->symb();
@@ -362,6 +365,13 @@ sub reset_caches {
if ($check_for_randomlist) {
$add_to_form = { 'check_parts_withrandomlist' => 1,};
}
+ if ($scancode) {
+ if (ref($add_to_form) eq 'HASH') {
+ $add_to_form->{'code_for_randomlist'} = $scancode;
+ } else {
+ $add_to_form = { 'code_for_randomlist' => $scancode,};
+ }
+ }
my $analyze =
&get_analyze($symb,$uname,$udom,undef,$add_to_form,
undef,undef,undef,$bubbles_per_row);
@@ -465,8 +475,8 @@ sub cleanRecord {
$env{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
$env{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob.
}
- $answer =~ s-\n-
-g;
- return '
'.&keywords_highlight(&HTML::Entities::encode($answer, '"<>&')).''; + $answer = &Apache::lontexconvert::msgtexconverted($answer); + return '
'.&keywords_highlight($answer).''; } elsif ( $response eq 'organic') { my $result=&mt('Smile representation: [_1]', '"'.&HTML::Entities::encode($answer, '"<>&').'"'); @@ -915,10 +925,11 @@ sub listStudents { my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($symb,$env{'form.probTitle'},($env{'form.showgrading'} eq 'yes')); - my %lt = &Apache::lonlocal::texthash ( + my %js_lt = &Apache::lonlocal::texthash ( 'multiple' => 'Please select a student or group of students before clicking on the Next button.', 'single' => 'Please select the student before clicking on the Next button.', ); + &js_escape(\%js_lt); $request->print(<