--- loncom/homework/grades.pm 2023/07/05 23:49:18 1.596.2.12.2.60.2.4 +++ loncom/homework/grades.pm 2020/02/12 16:25:56 1.762 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.12.2.60.2.4 2023/07/05 23:49:18 raeburn Exp $ +# $Id: grades.pm,v 1.762 2020/02/12 16:25:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,6 +44,7 @@ use Apache::Constants qw(:common :http); use Apache::lonlocal; use Apache::lonenc; use Apache::lonstathelpers; +use Apache::lonquickgrades; use Apache::bridgetask(); use Apache::lontexconvert(); use String::Similarity; @@ -147,7 +148,6 @@ sub nameUserString { #--- Get the partlist and the response type for a given problem. --- #--- Indicate if a response type is coded handgraded or not. --- -#--- Count responseIDs, essayresponse items, and dropbox items --- #--- Sets response_error pointer to "1" if navmaps object broken --- sub response_type { my ($symb,$response_error) = @_; @@ -165,7 +165,6 @@ sub response_type { return; } my $partlist = $res->parts(); - my ($numresp,$numessay,$numdropbox) = (0,0,0); my %vPart = map { $_ => 1 } (&Apache::loncommon::get_env_multiple('form.vPart')); my (%response_types,%handgrade); @@ -175,20 +174,13 @@ sub response_type { my @types = $res->responseType($part); my @ids = $res->responseIds($part); for (my $i=0; $i < scalar(@ids); $i++) { - $numresp ++; $response_types{$part}{$ids[$i]} = $types[$i]; - if ($types[$i] eq 'essay') { - $numessay ++; - if (&Apache::lonnet::EXT("resource.$part".'_'.$ids[$i].".uploadedfiletypes",$symb)) { - $numdropbox ++; - } - } $handgrade{$part.'_'.$ids[$i]} = &Apache::lonnet::EXT('resource.'.$part.'_'.$ids[$i]. '.handgrade',$symb); } } - return ($partlist,\%handgrade,\%response_types,$numresp,$numessay,$numdropbox); + return ($partlist,\%handgrade,\%response_types); } sub flatten_responseType { @@ -215,129 +207,6 @@ sub get_display_part { return $display; } -#--- Show parts and response type -sub showResourceInfo { - my ($symb,$partlist,$responseType,$formname,$checkboxes,$uploads) = @_; - unless ((ref($partlist) eq 'ARRAY') && (ref($responseType) eq 'HASH')) { - return ''; - } - my $coltitle = &mt('Problem Part Shown'); - if ($checkboxes) { - $coltitle = &mt('Problem Part'); - } else { - my $checkedparts = 0; - foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { - if (grep(/^\Q$partid\E$/,@{$partlist})) { - $checkedparts ++; - } - } - if ($checkedparts == scalar(@{$partlist})) { - return ''; - } - if ($uploads) { - $coltitle = &mt('Problem Part Selected'); - } - } - my $result = '
'. - &mt('No dropbox items or essayresponse items with uploadedfiletypes set.'). - '
'.&keywords_highlight($answer).'
' .&mt('Part(s) graded correct by the computer is marked with a [_1] symbol.',$checkIcon) ."
'. &keywords_highlight($oessay). '
'.&mt('No grading privileges').'
'.&mt('[_1]Message:[_2] No more students for this section or class.','','').'
".&mt('Users are in domain: [_1]',$domform)."
'. + &mt('Score not saved for clicker: [_1] (matched multiple usernames: [_2])', + $clicker,join(', ',@inclass)).'
". &mt("Failed to save data for student [_1]. Message when trying to save was: [_2]", "$username:$domain",$result)."
' .&mt('Unable to accept last correction, an error occurred: [_1]', $errmsg) @@ -7497,7 +7147,7 @@ sub scantron_validate_file { while (!$stop && $currentphase < scalar(@validate_phases)) { $r->print(&mt('Validating '.$validate_phases[$currentphase]).''); $r->rflush(); - + my $which="scantron_validate_".$validate_phases[$currentphase]; { no strict 'refs'; @@ -7527,7 +7177,7 @@ sub scantron_validate_file { $r->print(''); $r->print(' '.&mt('this error').' '); - $r->print('
'.&mt('Or return to [_1]Grade/Manage/Review Bubblesheets[_2] to start over.','','').'
' + $r->print( + '
' .&mt('Some resources in the sequence currently are not set to' - .' exam mode. Grading these resources currently may not' + .' bubblesheet exam mode. Grading these resources currently may not' .' work correctly.') .'
'.&mt("The encoded ID is not in the classlist"). + $r->print('
'.&mt("The encoded ID is not in the classlist"). "
'.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
".&mt("How should I handle this?")." \n"); @@ -8053,8 +7704,8 @@ sub scantron_get_correction { } elsif ($error eq 'duplicateCODE') { $r->print('
'.&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
".&mt('The CODE on the form is [_1]', - "'$$scan_record{'scantron.CODE'}'") + $r->print("
".&mt('The CODE on the form is [_1]', + "'$$scan_record{'scantron.CODE'}'") ."
".&mt("How should I handle this?")."
'.&mt("Uploading file to [_1]",$coursedata{'description'}).'
'.&mt('Uploading file to [_1]','"'.$coursedata{'description'}.'"').'
'. - &mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([quant,_4,bubblesheet line] per student).', - '', - $numstudents, - '', - $env{'form.scantron_maxbubble'}). - '
' + .&mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([quant,_4,bubblesheet line] per student).', + '', + $numstudents, + '', + $env{'form.scantron_maxbubble'}) + .'
' .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,'') .'' .&mt('Discrepancies detected for [_1][quant,_2,student][_3].','',$failed,'') - .'
'.&mt('Access Denied ([_1])',$command).'