';
return $result;
}
@@ -1959,10 +1959,11 @@ KEYWORDS
}
# This is where output for one specific student would start
- my $bgcolor='#DDEEDD';
- if (int($counter/2) eq $counter) { $bgcolor='#DDDDEE'; }
+ my $add_class = ($counter%2) ? 'LC_grade_show_user_odd_row' : '';
$request->print("\n\n".
- '
'."\n");
# print student answer/submission
# Options are (1) Handgaded submission only
# (2) Last submission, includes submission that is not handgraded
@@ -2055,12 +2009,14 @@ KEYWORDS
# (4) The whole record for this student
if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) {
my ($string,$timestamp)= &get_last_submission(\%record);
- my $lastsubonly=''.
- ($$timestamp eq '' ? '' : 'Date Submitted: '.
- $$timestamp)."
\n";
+
+ my $lastsubonly;
+
if ($$timestamp eq '') {
- $lastsubonly.='
'.$$string[0];
+ $lastsubonly.='
'.$$string[0].'
';
} else {
+ $lastsubonly = '
Date Submitted: '.$$timestamp."\n";
+
my %seenparts;
my @part_response_id = &flatten_responseType($responseType);
foreach my $part (@part_response_id) {
@@ -2083,16 +2039,16 @@ KEYWORDS
}
my $responsetype = $responseType->{$partid}->{$respid};
if (!exists($record{"resource.$partid.$respid.submission"})) {
- $lastsubonly.='
Part: '.
+ $lastsubonly.="\n".'
Part: '.
$display_part.' ( ID '.$respid.
' ) '.
- 'Nothing submitted - no attempts
';
+ ''.&mt('Nothing submitted - no attempts').'
';
next;
}
- foreach (@$string) {
- my ($partid,$respid) = /^resource\.([^\.]*)\.([^\.]*)\.submission/;
+ foreach my $submission (@$string) {
+ my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/);
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; }
- my ($ressub,$subval) = split(/:/,$_,2);
+ my ($ressub,$subval) = split(/:/,$submission,2);
# Similarity check
my $similar='';
if($env{'form.checkPlag'}){
@@ -2122,31 +2078,32 @@ KEYWORDS
($env{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
my $display_part=&get_display_part($partid,$symb);
- $lastsubonly.='
Part: '.
+ $lastsubonly.='
Part: '.
$display_part.' ( ID '.$respid.
' ) ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
if (@$files) {
- $lastsubonly.=' Like all files provided by users, this file may contain virusses ';
+ $lastsubonly.=' '.&mt('Like all files provided by users, this file may contain virusses').' ';
my $file_counter = 0;
foreach my $file (@$files) {
- $file_counter ++;
+ $file_counter++;
&Apache::lonnet::allowuploaded('/adm/grades',$file);
$lastsubonly.=' '.$file.'';
}
$lastsubonly.=' ';
}
- $lastsubonly.='Submitted Answer: '.
+ $lastsubonly.=''.&mt('Submitted Answer:').' '.
&cleanRecord($subval,$responsetype,$symb,$partid,
$respid,\%record,$order);
if ($similar) {$lastsubonly.="
';
+ $result .= &mt('This student has submitted too many '.
+ 'collaborators. Maximum is [_1].',$ncol);
+ $result .= '
';
+ }
+ }
+ return ($result,$fullname,\@col_fullnames);
+}
+
#--- Retrieve the last submission for all the parts
sub get_last_submission {
my ($returnhash)=@_;
@@ -3912,7 +3940,8 @@ sub csvuploadassign {
if ($wgt) {
$entries{$fields{$dest}}=~s/\s//g;
my $pcr=$entries{$fields{$dest}} / $wgt;
- my $award='correct_by_override';
+ my $award=($pcr == 0) ? 'incorrect_by_override'
+ : 'correct_by_override';
$grades{"resource.$part.awarded"}=$pcr;
$grades{"resource.$part.solved"}=$award;
$points{$part}=1;
@@ -4263,30 +4292,33 @@ sub displaySubByDates {
my $isCODE=0;
my $isTask = ($symb =~/\.task$/);
if (exists($record->{'resource.CODE'})) { $isCODE=1; }
- my $studentTable='
'.
- '
'.
- '
Date/Time
'.
- ($isCODE?'
CODE
':'').
- '
Submission
'.
- '
Status
';
+ my $studentTable=&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ '
'.&mt('Date/Time').'
'.
+ ($isCODE?'
'.&mt('CODE').'
':'').
+ '
'.&mt('Submission').'
'.
+ '
'.&mt('Status').'
'.
+ &Apache::loncommon::end_data_table_header_row();
my ($version);
my %mark;
my %orders;
$mark{'correct_by_student'} = $checkIcon;
if (!exists($$record{'1:timestamp'})) {
- return ' Nothing submitted - no attempts ';
+ return ' '.&mt('Nothing submitted - no attempts').' ';
}
my $interaction;
for ($version=1;$version<=$$record{'version'};$version++) {
- my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
+ my $timestamp =
+ &Apache::lonlocal::locallocaltime($$record{$version.':timestamp'});
if (exists($$record{$version.':resource.0.version'})) {
$interaction = $$record{$version.':resource.0.version'};
}
my $where = ($isTask ? "$version:resource.$interaction"
: "$version:resource");
- $studentTable.='
';
+ $studentTable.=&Apache::loncommon::end_data_table();
return $studentTable;
}
@@ -5312,7 +5344,7 @@ sub scantron_parse_scanline {
if ($bubble =~ /\d/) {
$record{"scantron.$ansnum.answer"} = $alphabet[$bubble];
} else {
- $record{"scantron.$ansnum.answer"}='';
+ $record{"scantron.$ansnum.answer"}=' ';
}
$ansnum++;
}
@@ -5383,20 +5415,22 @@ sub scantron_parse_scanline {
my $first_answer = $ansnum;
for (my $ans =0; $ans < $answers_needed; $ans++) {
- $record{"scantron.$ansnum.answer"} = '';
- $ans++;
+ my $item = $first_answer+$ans;
+ $record{"scantron.$item.answer"} = '';
}
my @ans=@array;
- my $i=length($ans[0]);shift(@ans);
+ my $i=0;
+ my $increment = 0;
while ($#ans) {
- $i+=length($ans[0])+1;
- my $line = $i/$$scantron_config{'Qlength'} + $first_answer;
+ $i+=length($ans[0]) + $increment;
+ my $line = int($i/$$scantron_config{'Qlength'} + $first_answer);
my $bubble = $i%$$scantron_config{'Qlength'};
-
$record{"scantron.$line.answer"}.=$alphabet[$bubble];
shift(@ans);
+ $increment = 1;
}
+ $ansnum += $answers_needed;
}
}
}
@@ -6432,7 +6466,7 @@ ENDSCRIPT
$r->print("
Please indicate which bubble should be used for grading
");
foreach my $question (@{$arg}) {
my $selected = &get_response_bubbles($scan_record, $question);
- my @select_array = split('',$selected);
+ my @select_array = split(/:/,$selected);
&scantron_bubble_selector($r,$scan_config,$question,
@select_array);
}
@@ -6465,17 +6499,18 @@ ENDSCRIPT
$r - Apache request object
$scan_config - hash from &get_scantron_config()
$quest - number of the bubble line to make a corrector for
- $selected - array of letters of previously selected bubbles
+ $lines - array of answer lines.
=cut
sub scantron_bubble_selector {
- my ($r,$scan_config,$quest,@selected)=@_;
+ my ($r,$scan_config,$quest,@lines)=@_;
my $max=$$scan_config{'Qlength'};
+
my $scmode=$$scan_config{'Qon'};
- my $bubble_length = scalar(@selected);
+ my $bubble_length = scalar(@lines);
if ($scmode eq 'number' || $scmode eq 'letter') { $max=10; }
@@ -6491,7 +6526,7 @@ sub scantron_bubble_selector {
if ($l != 0) {
$r->print('
');
}
-
+ my @selected = split(//,$lines[$l]);
for (my $i=0;$i<$max;$i++) {
$r->print("\n".'
');
if ($selected[0] eq $alphabet[$i]) {
@@ -7191,10 +7226,6 @@ sub grading_menu {
my $probTitle = &Apache::lonnet::gettitle($symb);
my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle);
- #
- # Define menu data
- $env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
- my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
$request->print($table);
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb),
'handgrade'=>$hdgrade,