--- loncom/homework/grades.pm 2020/02/12 16:25:56 1.762
+++ loncom/homework/grades.pm 2020/05/08 13:49:02 1.767
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.762 2020/02/12 16:25:56 raeburn Exp $
+# $Id: grades.pm,v 1.767 2020/05/08 13:49:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -315,7 +315,7 @@ sub reset_caches {
$add_to_form = { 'code_for_randomlist' => $scancode,};
}
}
- my $analyze =
+ my $analyze =
&get_analyze($symb,$uname,$udom,undef,$add_to_form,
undef,undef,undef,$bubbles_per_row);
if (ref($analyze) eq 'HASH') {
@@ -345,7 +345,7 @@ sub cleanRecord {
if ($response =~ /^(option|rank)$/) {
my %answer=&Apache::lonnet::str2hash($answer);
my @answer = %answer;
- %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
+ %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my %grading=&Apache::lonnet::str2hash($record->{$version."resource.$partid.$respid.submissiongrading"});
my ($toprow,$bottomrow);
foreach my $foil (@$order) {
@@ -363,7 +363,7 @@ sub cleanRecord {
} elsif ($response eq 'match') {
my %answer=&Apache::lonnet::str2hash($answer);
my @answer = %answer;
- %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
+ %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my %grading=&Apache::lonnet::str2hash($record->{$version."resource.$partid.$respid.submissiongrading"});
my @items=&Apache::lonnet::str2array($record->{$version."resource.$partid.$respid.submissionitems"});
my ($toprow,$middlerow,$bottomrow);
@@ -422,7 +422,6 @@ sub cleanRecord {
}
$answer = &Apache::lontexconvert::msgtexconverted($answer);
return '
'.&keywords_highlight($answer).'
';
-
} elsif ( $response eq 'organic') {
my $result=&mt('Smile representation: [_1]',
'"'.&HTML::Entities::encode($answer, '"<>&').'"');
@@ -655,7 +654,7 @@ sub canmodify {
#can modify the requested section
return 1;
} else {
- # can't modify the request section
+ # can't modify the requested section
return 0;
}
}
@@ -668,19 +667,19 @@ sub canview {
my ($sec)=@_;
if ($perm{'vgr'}) {
if (!defined($perm{'vgr_section'})) {
- # can modify whole class
+ # can view whole class
return 1;
} else {
if ($sec eq $perm{'vgr_section'}) {
- #can modify the requested section
+ #can view the requested section
return 1;
} else {
- # can't modify the request section
+ # can't view the requested section
return 0;
}
}
}
- #can't modify
+ #can't view
return 0;
}
@@ -821,14 +820,14 @@ sub initialverifyreceipt {
#--- Check whether a receipt number is valid.---
sub verifyreceipt {
- my ($request,$symb) = @_;
+ my ($request,$symb) = @_;
my $courseid = $env{'request.course.id'};
my $receipt = &Apache::lonnet::recprefix($courseid).'-'.
$env{'form.receipt'};
$receipt =~ s/[^\-\d]//g;
- my $title.=
+ my $title =
'
'.
&mt('Verifying Receipt Number [_1]',$receipt).
'
'."\n";
@@ -917,7 +916,7 @@ sub listStudents {
my $getsec = $env{'form.section'} eq '' ? 'all' : $env{'form.section'};
my $getgroup = $env{'form.group'} eq '' ? 'all' : $env{'form.group'};
unless ($submitonly) {
- $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
+ $submitonly = $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
}
my $result='';
@@ -1214,8 +1213,8 @@ LISTJAVASCRIPT
#---- Called from the listStudents routine
sub check_script {
- my ($form, $type)=@_;
- my $chkallscript= &Apache::lonhtmlcommon::scripttag('
+ my ($form,$type) = @_;
+ my $chkallscript = &Apache::lonhtmlcommon::scripttag('
function checkall() {
for (i=0; iprint(&mt('There are currently no submitted documents.'));
- return;
+ $r->print(&mt('There are currently no submitted documents.'));
+ return;
}
my $all_students =
join("\n", &Apache::loncommon::get_env_multiple('form.stuinfo'));
@@ -4738,7 +4737,7 @@ sub get_fields {
}
sub csvuploadassign {
- my ($request,$symb)= @_;
+ my ($request,$symb) = @_;
if (!$symb) {return '';}
my $error_msg = '';
my $datatoken = &Apache::loncommon::valid_datatoken($env{'form.datatoken'});
@@ -4854,7 +4853,7 @@ sub csvuploadassign {
$grades{$store_key}=$entries{$fields{$dest}};
}
}
- if (! %grades) {
+ if (! %grades) {
push(@skipped,&mt("[_1]: no data to save","$username:$domain"));
} else {
$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}";
@@ -5655,7 +5654,7 @@ the homework problem.
sub defaultFormData {
my ($symb)=@_;
- return '';
+ return '';
}
@@ -7827,7 +7826,7 @@ sub verify_bubbles_checked {
my $ansnumstr = join('","',@ansnums);
my $warning = &mt("A bubble or 'No bubble' selection has not been made for one or more lines.");
&js_escape(\$warning);
- my $output = &Apache::lonhtmlcommon::scripttag((<';
return $result;
}
@@ -10212,12 +10209,12 @@ ENDUPFORM
ENDGRADINGFORM
- $result.=''.&Apache::loncommon::end_data_table_row().
+ $result.=''.&Apache::loncommon::end_data_table_row().
&Apache::loncommon::start_data_table_row().'
'.(<$pcorrect:
-'
+
ENDPERCFORM
$result.='
'.
&Apache::loncommon::end_data_table_row().
@@ -10226,7 +10223,7 @@ ENDPERCFORM
}
sub process_clicker_file {
- my ($r,$symb)=@_;
+ my ($r,$symb) = @_;
if (!$symb) {return '';}
my %Saveable_Parameters=&clicker_grading_parameters();
@@ -10556,7 +10553,7 @@ sub turning_eval {
sub assign_clicker_grades {
- my ($r,$symb)=@_;
+ my ($r,$symb) = @_;
if (!$symb) {return '';}
# See which part we are saving to
my $res_error;
@@ -10567,11 +10564,11 @@ sub assign_clicker_grades {
# FIXME: This should probably look for the first handgradeable part
my $part=$$partlist[0];
# Start screen output
- my $result=&Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_header_row().
- '