');
- hDoc.write('');
- hDoc.write("$lt{'txtc'}<\\/b><\\/td> | $lt{'font'}<\\/b><\\/td> | $lt{'fnst'}<\\/td><\\/tr>");
+ hDoc.write('');
+ hDoc.write("$lt{'txtc'}<\\/th> | $lt{'font'}<\\/th> | $lt{'fnst'}<\\/th><\\/tr>");
}
function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) {
var hDoc = hwdWin.document;
- hDoc.write(" | ");
+ hDoc.write(" ");
hDoc.write("");
- hDoc.write(" "+clrtxt+"<\\/td>");
+ hDoc.write(" "+clrtxt+"<\\/td>");
hDoc.write(" | ");
- hDoc.write(" "+sztxt+"<\\/td>");
+ hDoc.write(" "+sztxt+"<\\/td>");
hDoc.write(" | ");
- hDoc.write(" "+sytxt+"<\\/td>");
+ hDoc.write(" "+sytxt+"<\\/td>");
hDoc.write("<\\/tr>");
}
function highlightend() {
var hDoc = hwdWin.document;
- hDoc.write("<\\/table>");
- hDoc.write("<\\/td><\\/tr><\\/table> ");
- hDoc.write(" ");
- hDoc.write("
");
+ hDoc.write("<\\/table> ");
+ hDoc.write(" ");
+ hDoc.write("
");
hDoc.write("<\\/form>");
hDoc.write('$end_page_highlight_central');
hDoc.close();
@@ -1702,7 +1728,7 @@ sub gradeBox {
$wgt = ($wgt > 0 ? $wgt : '1');
my $score = ($$record{'resource.'.$partid.'.awarded'} eq '' ?
'' : &compute_points($$record{'resource.'.$partid.'.awarded'},$wgt));
- my $result=''."\n";
+ my $data_WGT=''."\n";
my $display_part= &get_display_part($partid,$symb);
my %last_resets = &get_last_resets($symb,$env{'request.course.id'},
[$partid]);
@@ -1710,7 +1736,7 @@ sub gradeBox {
if ($last_resets{$partid}) {
$aggtries = &get_num_tries($record,$last_resets{$partid},$partid);
}
- $result.=&Apache::loncommon::start_data_table_row();
+ my $result=&Apache::loncommon::start_data_table_row();
my $ctr = 0;
my $thisweight = 0;
my $increment = &get_increment();
@@ -1747,8 +1773,9 @@ sub gradeBox {
$result .=
- ' | '.$display_part.' | '.$radio.' | '.&mt('or').' | '.$line.' | ';
+ ''.$data_WGT.$display_part.' | '.$radio.' | '.&mt('or').' | '.$line.' | ';
$result.=&Apache::loncommon::end_data_table_row();
+ $result.=&Apache::loncommon::start_data_table_row().'';
$result.=''."\n".
''."\n".
''."\n";
my $res_error;
$result.=&handback_box($symb,$uname,$udom,$counter,$partid,$record,\$res_error);
+ $result.=' | '.&Apache::loncommon::end_data_table_row();
if ($res_error) {
return &navmap_errormsg();
}
@@ -1940,9 +1968,12 @@ sub submission {
if ($symb eq '') { $request->print("Unable to handle ambiguous references:."); return ''; }
if (!&canview($usec)) {
- $request->print('Unable to view requested student.('.
- $uname.':'.$udom.' in section '.$usec.' in course id '.
- $env{'request.course.id'}.')');
+ $request->print(
+ ''.
+ &mt('Unable to view requested student.').
+ ' '.&mt('([_1] in section [_2] in course id [_3])',
+ $uname.':'.$udom,$usec,$env{'request.course.id'}).
+ '');
return;
}
@@ -1974,7 +2005,7 @@ sub submission {
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode));
}
- # kwclr is the only variable that is guaranteed to be non blank
+ # kwclr is the only variable that is guaranteed not to be blank
# if this subroutine has been called once.
my %keyhash = ();
# if ($env{'form.kwclr'} eq '' && $env{'form.handgrade'} eq 'yes') {
@@ -2039,6 +2070,7 @@ sub submission {
if (1) {
my %lt = &Apache::lonlocal::texthash(
+ keyh => 'Keyword Highlighting for Essays',
keyw => 'Keyword Options',
list => 'List',
past => 'Paste Selection to List',
@@ -2047,13 +2079,18 @@ sub submission {
#
# Print out the keyword options line
#
- $request->print(<$lt{'keyw'}:
-$lt{'list'}
-$lt{'past'}
-$lt{'high'}
-KEYWORDS
+ $request->print(
+ ''
+ );
+
#
# Load the other essays for similarity check
#
@@ -2078,7 +2115,7 @@ KEYWORDS
if ($perm{'vgr'}) {
$request->print(
&Apache::loncommon::track_student_link(
- &mt('View recent activity'),
+ 'View recent activity',
$uname,$udom,'check')
.' '
);
@@ -2137,137 +2174,147 @@ KEYWORDS
$result.=$sub_result;
}
$request->print($result."\n");
-
+
# print student answer/submission
# Options are (1) Handgraded submission only
# (2) Last submission, includes submission that is not handgraded
# (for multi-response type part)
# (3) Last submission plus the parts info
# (4) The whole record for this student
- if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) {
- my ($string,$timestamp)= &get_last_submission(\%record);
+
+ my ($string,$timestamp)= &get_last_submission(\%record);
- my $lastsubonly;
+ my $lastsubonly;
- if ($$timestamp eq '') {
- $lastsubonly.=''.$$string[0].' ';
- } else {
- $lastsubonly =
- ''
- .' '.&mt('Date Submitted:').' '.$$timestamp."\n";
-
- my %seenparts;
- my @part_response_id = &flatten_responseType($responseType);
- foreach my $part (@part_response_id) {
- next if ($env{'form.lastSub'} eq 'hdgrade'
+ if ($$timestamp eq '') {
+ $lastsubonly.=' '.$$string[0].' ';
+ } else {
+ $lastsubonly =
+ ' '
+ .' '.&mt('Date Submitted:').' '.$$timestamp."\n";
+
+ my %seenparts;
+ my @part_response_id = &flatten_responseType($responseType);
+ foreach my $part (@part_response_id) {
+ next if ($env{'form.lastSub'} eq 'hdgrade'
&& $$handgrade{$$part[0].'_'.$$part[1]} ne 'yes');
- my ($partid,$respid) = @{ $part };
- my $display_part=&get_display_part($partid,$symb);
- if ($env{"form.$uname:$udom:$partid:submitted_by"}) {
- if (exists($seenparts{$partid})) { next; }
- $seenparts{$partid}=1;
- my $submitby=' Part: '.$display_part.
- ' Collaborative submission by: '.
- ' '.
- $$fullname{$env{"form.$uname:$udom:$partid:submitted_by"}}.'';
- $request->print($submitby);
- next;
- }
- my $responsetype = $responseType->{$partid}->{$respid};
- if (!exists($record{"resource.$partid.$respid.submission"})) {
- $lastsubonly.="\n".' '.
- ''.&mt('Part: [_1]',$display_part).''.
- ' '.
- '('.&mt('Response ID: [_1]',$respid).')'.
- ' '.
- ''.&mt('Nothing submitted - no attempts.').'
';
- next;
- }
- foreach my $submission (@$string) {
- my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/);
- if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; }
- my ($ressub,$hide,$subval) = split(/:/,$submission,3);
- # Similarity check
- my $similar='';
- my ($type,$trial,$rndseed);
- if ($hide eq 'rand') {
- $type = 'randomizetry';
- $trial = $record{"resource.$partid.tries"};
- $rndseed = $record{"resource.$partid.rndseed"};
- }
- if($env{'form.checkPlag'}){
- my ($oname,$odom,$ocrsid,$oessay,$osim)=
- &most_similar($uname,$udom,$symb,$subval);
- if ($osim) {
- $osim=int($osim*100.0);
- my %old_course_desc =
- &Apache::lonnet::coursedescription($ocrsid,
- {'one_time' => 1});
-
- if ($hide eq 'anon') {
- $similar=' '.&mt("Essay was found to be similar to another essay submitted for this assignment.").' '.
- &mt('As the current submission is for an anonymous survey, no other details are available.').'
';
- } else {
- $similar="
".
- &mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])',
- $osim,
- &Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')',
+ my ($partid,$respid) = @{ $part };
+ my $display_part=&get_display_part($partid,$symb);
+ if ($env{"form.$uname:$udom:$partid:submitted_by"}) {
+ if (exists($seenparts{$partid})) { next; }
+ $seenparts{$partid}=1;
+ $request->print(
+ ''.&mt('Part: [_1]',$display_part).''.
+ ' '.&mt('Collaborative submission by: [_1]',
+ ''.
+ $$fullname{$env{"form.$uname:$udom:$partid:submitted_by"}}.'').
+ ' ');
+ next;
+ }
+ my $responsetype = $responseType->{$partid}->{$respid};
+ if (!exists($record{"resource.$partid.$respid.submission"})) {
+ $lastsubonly.="\n".''.
+ ''.&mt('Part: [_1]',$display_part).''.
+ ' '.
+ '('.&mt('Response ID: [_1]',$respid).')'.
+ ' '.
+ ''.&mt('Nothing submitted - no attempts.').'
';
+ next;
+ }
+ foreach my $submission (@$string) {
+ my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/);
+ if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; }
+ my ($ressub,$hide,$subval) = split(/:/,$submission,3);
+ # Similarity check
+ my $similar='';
+ my ($type,$trial,$rndseed);
+ if ($hide eq 'rand') {
+ $type = 'randomizetry';
+ $trial = $record{"resource.$partid.tries"};
+ $rndseed = $record{"resource.$partid.rndseed"};
+ }
+ if ($env{'form.checkPlag'}) {
+ my ($oname,$odom,$ocrsid,$oessay,$osim)=
+ &most_similar($uname,$udom,$symb,$subval);
+ if ($osim) {
+ $osim=int($osim*100.0);
+ my %old_course_desc =
+ &Apache::lonnet::coursedescription($ocrsid,
+ {'one_time' => 1});
+
+ if ($hide eq 'anon') {
+ $similar=' '.&mt("Essay was found to be similar to another essay submitted for this assignment.").' '.
+ &mt('As the current submission is for an anonymous survey, no other details are available.').' ';
+ } else {
+ $similar="
".
+ &mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])',
+ $osim,
+ &Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')',
$old_course_desc{'description'},
$old_course_desc{'num'},
$old_course_desc{'domain'}).
''.
&keywords_highlight($oessay).
' ';
- }
- }
- }
- my $order=&get_order($partid,$respid,$symb,$uname,$udom,
- undef,$type,$trial,$rndseed);
- if ($env{'form.lastSub'} eq 'lastonly' ||
- ($env{'form.lastSub'} eq 'hdgrade' &&
+ }
+ }
+ }
+ my $order=&get_order($partid,$respid,$symb,$uname,$udom,
+ undef,$type,$trial,$rndseed);
+ if ($env{'form.lastSub'} eq 'lastonly' || $env{'form.lastSub'} eq 'datesub' || $env{'form.lastSub'} =~ /^(last|all)$/ || ($env{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
- my $display_part=&get_display_part($partid,$symb);
- $lastsubonly.=''.
- ' '.&mt('Part: [_1]',$display_part).''.
- ' '.
- '('.&mt('Response ID: [_1]',$respid).')'.
- ' ';
- my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
- if (@$files) {
- if ($hide eq 'anon') {
- $lastsubonly.=' '.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files}));
- } else {
- $lastsubonly.=' '.&mt('Like all files provided by users, this file may contain viruses').'';
- foreach my $file (@$files) {
- &Apache::lonnet::allowuploaded('/adm/grades',$file);
- $lastsubonly.=' '.$file.'';
- }
- }
- $lastsubonly.=' ';
- }
+ my $display_part=&get_display_part($partid,$symb);
+ $lastsubonly.=' '.
+ ' '.&mt('Part: [_1]',$display_part).''.
+ ' '.
+ '('.&mt('Response ID: [_1]',$respid).')'.
+ ' ';
+ my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
+
+ if (@$files) {
if ($hide eq 'anon') {
- $lastsubonly.=' '.&mt('Anonymous Survey').'';
+ $lastsubonly.=' '.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files}));
} else {
- $lastsubonly.=' '.&mt('Submitted Answer:').' '.
- &cleanRecord($subval,$responsetype,$symb,$partid,
- $respid,\%record,$order,undef,$uname,$udom,$type,$trial,$rndseed);
+ $lastsubonly.=' '.' '.&mt('Submitted Files:').''
+ .' ';
+ if(@$files == 1) {
+ $lastsubonly .= &mt('Like all files provided by users, this file may contain viruses!');
+ } else {
+ $lastsubonly .= &mt('Like all files provided by users, these files may contain viruses!');
+ }
+ $lastsubonly .= '';
+ foreach my $file (@$files) {
+ &Apache::lonnet::allowuploaded('/adm/grades',$file);
+ $lastsubonly.=' '.$file.'';
+ }
}
- if ($similar) {$lastsubonly.=" $similar\n";}
- $lastsubonly.=' ';
- }
+ $lastsubonly.=' ';
+ }
+ if ($hide eq 'anon') {
+ $lastsubonly.=' '.&mt('Anonymous Survey').'';
+ } else {
+ $lastsubonly.=' '.&mt('Submitted Answer:').' '.
+ &cleanRecord($subval,$responsetype,$symb,$partid,
+ $respid,\%record,$order,undef,$uname,$udom,$type,$trial,$rndseed);
+ }
+ if ($similar) {$lastsubonly.=" $similar\n";}
+ $lastsubonly.=' ';
}
- }
- $lastsubonly.=''."\n"; # End: LC_grade_submissions_body
+ }
}
- $request->print($lastsubonly);
- } elsif ($env{'form.lastSub'} eq 'datesub') {
+ $lastsubonly.=' '."\n"; # End: LC_grade_submissions_body
+ }
+ $request->print($lastsubonly);
+ if ($env{'form.lastSub'} eq 'datesub') {
my ($parts,$handgrade,$responseType) = &response_type($symb,\$res_error);
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom));
- } elsif ($env{'form.lastSub'} =~ /^(last|all)$/) {
- $request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
+
+ }
+ if ($env{'form.lastSub'} =~ /^(last|all)$/) {
+ $request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
$env{'request.course.id'},
$last,'.submission',
'Apache::grades::keywords_highlight'));
@@ -2300,10 +2347,10 @@ KEYWORDS
''."\n";
$result.=' '.
- &mt('Compose message to student').(scalar(@$col_fullnames) >= 1 ? 's' : '').' '."\n".
''."\n".
-'Submissions | '.$showrecord.' | '."\n";
+''.&mt('Submissions').' | '.$showrecord.' | '."\n";
$passed ++;
} else {
my $css_class = ($failed % 2)?'LC_odd_row':'LC_even_row';
$badstudents .= ''.&mt('Bubblesheet').' | '.$scandata{$pid}.' | '.$last.' | '.$pid.' | '."\n".
' '."\n".
''."\n".
-'Submissions | '.$record{$pid}.' | '."\n".
+''.&mt('Submissions').' | '.$record{$pid}.' | '."\n".
' '."\n";
$failed ++;
}
@@ -8678,7 +9109,12 @@ sub checkscantron_results {
$env{'form.scantron_maxbubble'})
.''
);
- $r->print(''.&mt('Exact matches for [quant,_1,student].',$passed).' '.&mt('Discrepancies detected for [quant,_1,student].',$failed).' ');
+ $r->print(''
+ .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,'')
+ .' '
+ .&mt('Discrepancies detected for [_1][quant,_2,student][_3].','',$failed,'')
+ .' '
+ );
if ($passed) {
$r->print(&mt('Students with exact correspondence between bubblesheet data and submissions are as follows:').'
');
$r->print(&Apache::loncommon::start_data_table()."\n".
@@ -8704,7 +9140,8 @@ sub checkscantron_results {
sub verify_scantron_grading {
my ($resource,$domain,$username,$cid,$counter,$scandata,$partids,
- $scantron_config,$lettdig,$numletts) = @_;
+ $scantron_config,$lettdig,$numletts,$randomorder,$randompick,
+ $respnumlookup,$startline) = @_;
my ($record,%expected,%startpos);
return ($counter,$record) if (!ref($resource));
return ($counter,$record) if (!$resource->is_problem());
@@ -8713,15 +9150,21 @@ sub verify_scantron_grading {
foreach my $part_id (@{$partids}) {
$counter ++;
$expected{$part_id} = 0;
- if ($env{"form.scantron.sub_bubblelines.$counter"}) {
- my @sub_lines = split(/,/,$env{"form.scantron.sub_bubblelines.$counter"});
+ my $respnum = $counter;
+ if ($randomorder || $randompick) {
+ $respnum = $respnumlookup->{$counter};
+ $startpos{$part_id} = $startline->{$counter} + 1;
+ } else {
+ $startpos{$part_id} = $env{"form.scantron.first_bubble_line.$counter"};
+ }
+ if ($env{"form.scantron.sub_bubblelines.$respnum"}) {
+ my @sub_lines = split(/,/,$env{"form.scantron.sub_bubblelines.$respnum"});
foreach my $item (@sub_lines) {
$expected{$part_id} += $item;
}
} else {
- $expected{$part_id} = $env{"form.scantron.bubblelines.$counter"};
+ $expected{$part_id} = $env{"form.scantron.bubblelines.$respnum"};
}
- $startpos{$part_id} = $env{"form.scantron.first_bubble_line.$counter"};
}
if ($symb) {
my %recorded;
@@ -8817,7 +9260,7 @@ sub verify_scantron_grading {
return ($counter,$record);
}
-sub letter_to_digits {
+sub letter_to_digits {
my %lettdig = (
A => 1,
B => 2,
@@ -9351,16 +9794,18 @@ sub process_clicker_file {
$number++;
}
$result.="\n";
- if ($number==0) {
- $result.=''.&mt('No IDs found to determine correct answer').'';
- return $result;
- }
+ if ($number==0) {
+ $result .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('No IDs found to determine correct answer'),1);
+ return $result;
+ }
}
if (length($env{'form.upfile'}) < 2) {
- $result.=&mt('[_1] Error: [_2] The file you attempted to upload, [_3] contained no information. Please check that you entered the correct filename.',
- '',
- '',
- ''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').'');
+ $result .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('The file: [_1] you attempted to upload contained no information. Please check that you entered the correct filename.',
+ ''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').''),1);
return $result;
}
@@ -9455,7 +9900,7 @@ ENDHEADER
&mt('Found [_1] registered and [_2] unregistered clickers.',$student_count,$unknown_count);
if (($env{'form.gradingmechanism'} ne 'attendance') && ($env{'form.gradingmechanism'} ne 'given')) {
if ($correct_count==0) {
- $errormsg.="Found no correct answers answers for grading!";
+ $errormsg.="Found no correct answers for grading!";
} elsif ($correct_count>1) {
$result.=' '.&mt("Found [_1] entries for grading!",$correct_count).'';
}
@@ -9627,7 +10072,7 @@ sub assign_clicker_grades {
if ($user) {
if ($users{$user}) {
$result.=' '.
- &mt("More than one entry found for [_1]!",$user).
+ &mt('More than one entry found for [_1]!',''.$user.'').
' ';
}
$users{$user}=1;
@@ -9743,6 +10188,7 @@ sub handler {
}
} elsif (!%perm) {
$request->internal_redirect('/adm/quickgrades');
+ return OK;
}
&Apache::loncommon::content_type($request,'text/html');
$request->send_http_header;
@@ -9957,7 +10403,7 @@ described at http://www.lon-capa.org.
=head1 OVERVIEW
Do an ssi with retries:
-While I'd love to factor out this with the vesrion in lonprintout,
+While I'd love to factor out this with the version in lonprintout,
that would either require a data coupling between modules, which I refuse to perpetuate (there's quite enough of that already), or would require the invention of another infrastructure
I'm not quite ready to invent (e.g. an ssi_with_retry object).
@@ -9968,11 +10414,11 @@ At least the logic that drives this has
ssi_with_retries - Does the server side include of a resource.
if the ssi call returns an error we'll retry it up to
the number of times requested by the caller.
- If we still have a proble, no text is appended to the
+ If we still have a problem, no text is appended to the
output and we set some global variables.
to indicate to the caller an SSI error occurred.
All of this is supposed to deal with the issues described
- in LonCAPA BZ 5631 see:
+ in LON-CAPA BZ 5631 see:
http://bugs.lon-capa.org/show_bug.cgi?id=5631
by informing the user that this happened.
@@ -10099,6 +10545,17 @@ Side Effects: None.
- missingbubble - array ref of the bubble lines that have missing
bubble errors
+ $randomorder - True if exam folder has randomorder set
+ $randompick - True if exam folder has randompick set
+ $respnumlookup - Reference to HASH mapping question numbers in bubble lines
+ for current line to question number used for same question
+ in "Master Seqence" (as seen by Course Coordinator).
+ $startline - Reference to hash where key is question number (0 is first)
+ and value is number of first bubble line for current student
+ or code-based randompick and/or randomorder.
+
+
+
=item scantron_get_maxbubble() :
Arguments:
@@ -10119,7 +10576,7 @@ Side Effects: None.
$env{'form.scantron.bubble_lines.n'},
$env{'form.scantron.first_bubble_line.n'} and
$env{"form.scantron.sub_bubblelines.n"}
- which are the total number of bubble, lines, the number of bubble
+ which are the total number of bubble lines, the number of bubble
lines for response n and number of the first bubble line for response n,
and a comma separated list of numbers of bubble lines for sub-questions
(for optionresponse, matchresponse, and rankresponse items), for response n.
|
|