');
- pDoc.write("$lt{'type'}<\\/b><\\/td> | $lt{'incl'}<\\/b><\\/td> | $lt{'mesa'}<\\/td><\\/tr>");
+ pDoc.write('
- '.&mt('If this information is correct, please click on \'[_1]\'.',&mt($button_text)).'
+ '.&mt("If this information is correct, please click on '[_1]'.",&mt($button_text)).'
'.&mt('If something is incorrect, please return to [_1]Grade/Manage/Review Bubblesheets[_2] to start over.','','').'
@@ -6322,9 +6663,11 @@ SCANTRONFORM
''."\n";
$chunk .=
''."\n";
+ $chunk .=
+ ''."\n";
$result .= $chunk;
$line++;
- }
+ }
return $result;
}
@@ -6396,6 +6739,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';
@@ -6804,7 +7148,13 @@ sub scantron_validate_sequence {
my @resources=
$navmap->retrieveResources($map,\&scantron_filter_not_exam,1,0);
if (@resources) {
- $r->print("".&mt('Some resources in the sequence currently are not set to exam mode. Grading these resources currently may not work correctly.')." ");
+ $r->print(
+ ''
+ .&mt('Some resources in the sequence currently are not set to'
+ .' bubblesheet exam mode. Grading these resources currently may not'
+ .' work correctly.')
+ .' '
+ );
return (1,$currentphase);
}
}
@@ -6885,7 +7235,8 @@ sub scantron_validate_ID {
sub scantron_get_correction {
- my ($r,$i,$scan_record,$scan_config,$line,$error,$arg)=@_;
+ my ($r,$i,$scan_record,$scan_config,$line,$error,$arg,
+ $randomorder,$randompick,$respnumlookup,$startline)=@_;
#FIXME in the case of a duplicated ID the previous line, probably need
#to show both the current line and the previous one and allow skipping
#the previous one or the current one
@@ -6909,7 +7260,7 @@ sub scantron_get_correction {
.&mt('The ID on the form is [_1]',
"$$scan_record{'scantron.ID'}")
.' '
- .&mt('The name on the paper is [_2], [_3]',
+ .&mt('The name on the paper is [_1], [_2]',
$$scan_record{'scantron.LastName'},
$$scan_record{'scantron.FirstName'})
.'';
@@ -6935,7 +7286,7 @@ sub scantron_get_correction {
$r->print(&Apache::loncommon::selectstudent_link('scantronupload',
'scantron_username','scantron_domain'));
$r->print(": ");
- $r->print("\n@".
+ $r->print("\n:\n".
&Apache::loncommon::select_dom_form($env{'request.role.domain'},'scantron_domain'));
$r->print('');
@@ -7019,7 +7370,8 @@ ENDSCRIPT
# The form field scantron_questions is acutally a list of line numbers.
# represented by this form so:
- my $line_list = &questions_to_line_list($arg);
+ my $line_list = &questions_to_line_list($arg,$randomorder,$randompick,
+ $respnumlookup,$startline);
$r->print('');
@@ -7027,7 +7379,9 @@ ENDSCRIPT
$r->print("".&mt("Please indicate which bubble should be used for grading")." ");
foreach my $question (@{$arg}) {
my @linenums = &prompt_for_corrections($r,$question,$scan_config,
- $scan_record, $error);
+ $scan_record, $error,
+ $randomorder,$randompick,
+ $respnumlookup,$startline);
push(@lines_to_correct,@linenums);
}
$r->print(&verify_bubbles_checked(@lines_to_correct));
@@ -7040,14 +7394,17 @@ ENDSCRIPT
# The form field scantron_questions is actually a list of line numbers not
# a list of question numbers. Therefore:
#
-
- my $line_list = &questions_to_line_list($arg);
+
+ my $line_list = &questions_to_line_list($arg,$randomorder,$randompick,
+ $respnumlookup,$startline);
$r->print('');
foreach my $question (@{$arg}) {
my @linenums = &prompt_for_corrections($r,$question,$scan_config,
- $scan_record, $error);
+ $scan_record, $error,
+ $randomorder,$randompick,
+ $respnumlookup,$startline);
push(@lines_to_correct,@linenums);
}
$r->print(&verify_bubbles_checked(@lines_to_correct));
@@ -7098,12 +7455,20 @@ used to fill in the scantron_questions f
Arguments:
questions - Reference to an array of questions.
+ randomorder - True if randomorder in use.
+ randompick - True if randompick in use.
+ 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 key is number of first bubble line for current student
+ or code-based randompick and/or randomorder.
=cut
sub questions_to_line_list {
- my ($questions) = @_;
+ my ($questions,$randomorder,$randompick,$respnumlookup,$startline) = @_;
my @lines;
foreach my $item (@{$questions}) {
@@ -7112,8 +7477,16 @@ sub questions_to_line_list {
if ($item =~ /^(\d+)\.(\d+)$/) {
$question = $1;
my $subquestion = $2;
- $first = $first_bubble_line{$question-1} + 1;
- my @subans = split(/,/,$subdivided_bubble_lines{$question-1});
+ my $responsenum = $question-1;
+ if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH')) {
+ $responsenum = $respnumlookup->{$question-1};
+ if (ref($startline) eq 'HASH') {
+ $first = $startline->{$question-1} + 1;
+ }
+ } else {
+ $first = $first_bubble_line{$responsenum} + 1;
+ }
+ my @subans = split(/,/,$subdivided_bubble_lines{$responsenum});
my $subcount = 1;
while ($subcount<$subquestion) {
$first += $subans[$subcount-1];
@@ -7121,8 +7494,16 @@ sub questions_to_line_list {
}
$count = $subans[$subquestion-1];
} else {
- $first = $first_bubble_line{$question-1} + 1;
- $count = $bubble_lines_per_response{$question-1};
+ my $responsenum = $question-1;
+ if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH')) {
+ $responsenum = $respnumlookup->{$question-1};
+ if (ref($startline) eq 'HASH') {
+ $first = $startline->{$question-1} + 1;
+ }
+ } else {
+ $first = $first_bubble_line{$responsenum} + 1;
+ }
+ $count = $bubble_lines_per_response{$responsenum};
}
$last = $first+$count-1;
push(@lines, ($first..$last));
@@ -7144,6 +7525,15 @@ for multi and missing bubble cases).
$scan_config - The scantron file configuration hash.
$scan_record - Reference to the hash that has the the parsed scanlines.
$error - Type of error
+ $randomorder - True if randomorder in use.
+ $randompick - True if randompick in use.
+ $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.
+
Implicit inputs:
%bubble_lines_per_response - Starting line numbers for each question.
@@ -7168,15 +7558,26 @@ for multi and missing bubble cases).
=cut
sub prompt_for_corrections {
- my ($r, $question, $scan_config, $scan_record, $error) = @_;
+ my ($r, $question, $scan_config, $scan_record, $error, $randomorder,
+ $randompick, $respnumlookup, $startline) = @_;
my ($current_line,$lines);
my @linenums;
my $questionnum = $question;
+ my ($first,$responsenum);
if ($question =~ /^(\d+)\.(\d+)$/) {
$question = $1;
- $current_line = $first_bubble_line{$question-1} + 1 ;
my $subquestion = $2;
- my @subans = split(/,/,$subdivided_bubble_lines{$question-1});
+ if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH')) {
+ $responsenum = $respnumlookup->{$question-1};
+ if (ref($startline) eq 'HASH') {
+ $first = $startline->{$question-1};
+ }
+ } else {
+ $responsenum = $question-1;
+ $first = $first_bubble_line{$responsenum} + 1;
+ }
+ $current_line = $first + 1 ;
+ my @subans = split(/,/,$subdivided_bubble_lines{$responsenum});
my $subcount = 1;
while ($subcount<$subquestion) {
$current_line += $subans[$subcount-1];
@@ -7184,25 +7585,43 @@ sub prompt_for_corrections {
}
$lines = $subans[$subquestion-1];
} else {
- $current_line = $first_bubble_line{$question-1} + 1 ;
- $lines = $bubble_lines_per_response{$question-1};
+ if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH')) {
+ $responsenum = $respnumlookup->{$question-1};
+ if (ref($startline) eq 'HASH') {
+ $first = $startline->{$question-1};
+ }
+ } else {
+ $responsenum = $question-1;
+ $first = $first_bubble_line{$responsenum};
+ }
+ $current_line = $first + 1;
+ $lines = $bubble_lines_per_response{$responsenum};
}
if ($lines > 1) {
$r->print(&mt('The group of bubble lines below responds to a single question.').' ');
- if (($responsetype_per_response{$question-1} eq 'essayresponse') ||
- ($responsetype_per_response{$question-1} eq 'formularesponse') ||
- ($responsetype_per_response{$question-1} eq 'stringresponse') ||
- ($responsetype_per_response{$question-1} eq 'imageresponse') ||
- ($responsetype_per_response{$question-1} eq 'reactionresponse') ||
- ($responsetype_per_response{$question-1} eq 'organicresponse')) {
- $r->print(&mt("Although this particular question type requires handgrading, the instructions for this question in the exam directed students to leave [quant,_1,line] blank on their bubblesheets.",$lines).'
'.&mt('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.').' '.&mt('The score for this question will be a sum of the numeric values for the selected bubbles from each line, where A=1 point, B=2 points etc.').' '.&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.").'
');
+ if (($responsetype_per_response{$responsenum} eq 'essayresponse') ||
+ ($responsetype_per_response{$responsenum} eq 'formularesponse') ||
+ ($responsetype_per_response{$responsenum} eq 'stringresponse') ||
+ ($responsetype_per_response{$responsenum} eq 'imageresponse') ||
+ ($responsetype_per_response{$responsenum} eq 'reactionresponse') ||
+ ($responsetype_per_response{$responsenum} eq 'organicresponse')) {
+ $r->print(
+ &mt("Although this particular question type requires handgrading, the instructions for this question in the bubblesheet exam directed students to leave [quant,_1,line] blank on their bubblesheets.",$lines)
+ .'
'
+ .&mt('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.')
+ .' '
+ .&mt('The score for this question will be a sum of the numeric values for the selected bubbles from each line, where A=1 point, B=2 points etc.')
+ .' '
+ .&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.")
+ .'
'
+ );
} else {
$r->print(&mt("Select at most one bubble in a single line and select 'No Bubble' in all the other lines. ")." ");
}
}
for (my $i =0; $i < $lines; $i++) {
my $selected = $$scan_record{"scantron.$current_line.answer"};
- &scantron_bubble_selector($r,$scan_config,$current_line,
+ &scantron_bubble_selector($r,$scan_config,$current_line,
$questionnum,$error,split('', $selected));
push(@linenums,$current_line);
$current_line++;
@@ -7456,11 +7875,42 @@ sub scantron_validate_doublebubble {
#get student info
my $classlist=&Apache::loncoursedata::get_classlist();
my %idmap=&username_to_idmap($classlist);
+ my (undef,undef,$sequence)=
+ &Apache::lonnet::decode_symb($env{'form.selectpage'});
#get scantron line setup
my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
+
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ unless (ref($navmap)) {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+ my $map=$navmap->getResourceByUrl($sequence);
+ my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
+ my ($randomorder,$randompick,@master_seq,%symb_to_resource,%grader_partids_by_symb,
+ %grader_randomlists_by_symb,%orderedforcode,%respnumlookup,%startline);
+ my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
+
my $nav_error;
+ if (ref($map)) {
+ $randomorder = $map->randomorder();
+ $randompick = $map->randompick();
+ if ($randomorder || $randompick) {
+ $nav_error = &get_master_seq(\@resources,\@master_seq,\%symb_to_resource);
+ if ($nav_error) {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+ &graders_resources_pass(\@resources,\%grader_partids_by_symb,
+ \%grader_randomlists_by_symb,$bubbles_per_row);
+ }
+ } else {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+
&scantron_get_maxbubble(\$nav_error,\%scantron_config); # parse needs the bubble line array.
if ($nav_error) {
$r->print(&navmap_errormsg());
@@ -7471,11 +7921,15 @@ sub scantron_validate_doublebubble {
my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
- $scan_data);
+ $scan_data,undef,\%idmap,$randomorder,
+ $randompick,$sequence,\@master_seq,
+ \%symb_to_resource,\%grader_partids_by_symb,
+ \%orderedforcode,\%respnumlookup,\%startline);
if (!defined($$scan_record{'scantron.doubleerror'})) { next; }
&scantron_get_correction($r,$i,$scan_record,\%scantron_config,$line,
'doublebubble',
- $$scan_record{'scantron.doubleerror'});
+ $$scan_record{'scantron.doubleerror'},
+ $randomorder,$randompick,\%respnumlookup,\%startline);
return (1,$currentphase);
}
return (0,$currentphase+1);
@@ -7514,11 +7968,14 @@ sub scantron_get_maxbubble {
%first_bubble_line = ();
%subdivided_bubble_lines = ();
%responsetype_per_response = ();
+ %masterseq_id_responsenum = ();
my $response_number = 0;
my $bubble_line = 0;
foreach my $resource (@resources) {
- my ($analysis,$parts) = &scantron_partids_tograde($resource,$cid,$uname,$udom,undef,$bubbles_per_row);
+ my $resid = $resource->id();
+ my ($analysis,$parts) = &scantron_partids_tograde($resource,$cid,$uname,
+ $udom,undef,$bubbles_per_row);
if ((ref($analysis) eq 'HASH') && (ref($parts) eq 'ARRAY')) {
foreach my $part_id (@{$parts}) {
my $lines;
@@ -7567,6 +8024,7 @@ sub scantron_get_maxbubble {
$bubble_lines_per_response{$response_number} = $lines;
$responsetype_per_response{$response_number} =
$analysis->{$part_id.'.type'};
+ $masterseq_id_responsenum{$resid.'_'.$part_id} = $response_number;
$response_number++;
$bubble_line += $lines;
@@ -7599,21 +8057,59 @@ sub scantron_validate_missingbubbles {
#get student info
my $classlist=&Apache::loncoursedata::get_classlist();
my %idmap=&username_to_idmap($classlist);
+ my (undef,undef,$sequence)=
+ &Apache::lonnet::decode_symb($env{'form.selectpage'});
#get scantron line setup
my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
+
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ unless (ref($navmap)) {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+
+ my $map=$navmap->getResourceByUrl($sequence);
+ my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
+ my ($randomorder,$randompick,@master_seq,%symb_to_resource,%grader_partids_by_symb,
+ %grader_randomlists_by_symb,%orderedforcode,%respnumlookup,%startline);
+ my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
+
my $nav_error;
+ if (ref($map)) {
+ $randomorder = $map->randomorder();
+ $randompick = $map->randompick();
+ if ($randomorder || $randompick) {
+ $nav_error = &get_master_seq(\@resources,\@master_seq,\%symb_to_resource);
+ if ($nav_error) {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+ &graders_resources_pass(\@resources,\%grader_partids_by_symb,
+ \%grader_randomlists_by_symb,$bubbles_per_row);
+ }
+ } else {
+ $r->print(&navmap_errormsg());
+ return(1,$currentphase);
+ }
+
+
my $max_bubble=&scantron_get_maxbubble(\$nav_error,\%scantron_config);
if ($nav_error) {
+ $r->print(&navmap_errormsg());
return(1,$currentphase);
}
+
if (!$max_bubble) { $max_bubble=2**31; }
for (my $i=0;$i<=$scanlines->{'count'};$i++) {
my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
- my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
- $scan_data);
+ my $scan_record =
+ &scantron_parse_scanline($line,$i,\%scantron_config,$scan_data,undef,\%idmap,
+ $randomorder,$randompick,$sequence,\@master_seq,
+ \%symb_to_resource,\%grader_partids_by_symb,
+ \%orderedforcode,\%respnumlookup,\%startline);
if (!defined($$scan_record{'scantron.missingerror'})) { next; }
my @to_correct;
@@ -7624,9 +8120,16 @@ sub scantron_validate_missingbubbles {
if ($missing =~ /^(\d+)\.(\d+)$/) {
my $question = $1;
my $subquestion = $2;
- if (!defined($first_bubble_line{$question -1})) { next; }
- my $first = $first_bubble_line{$question-1};
- my @subans = split(/,/,$subdivided_bubble_lines{$question-1});
+ my ($first,$responsenum);
+ if ($randomorder || $randompick) {
+ $responsenum = $respnumlookup{$question-1};
+ $first = $startline{$question-1};
+ } else {
+ $responsenum = $question-1;
+ $first = $first_bubble_line{$responsenum};
+ }
+ if (!defined($first)) { next; }
+ my @subans = split(/,/,$subdivided_bubble_lines{$responsenum});
my $subcount = 1;
while ($subcount<$subquestion) {
$first += $subans[$subcount-1];
@@ -7635,15 +8138,25 @@ sub scantron_validate_missingbubbles {
my $count = $subans[$subquestion-1];
$lastbubble = $first + $count;
} else {
- if (!defined($first_bubble_line{$missing - 1})) { next; }
- $lastbubble = $first_bubble_line{$missing - 1} + $bubble_lines_per_response{$missing - 1};
+ my ($first,$responsenum);
+ if ($randomorder || $randompick) {
+ $responsenum = $respnumlookup{$missing-1};
+ $first = $startline{$missing-1};
+ } else {
+ $responsenum = $missing-1;
+ $first = $first_bubble_line{$responsenum};
+ }
+ if (!defined($first)) { next; }
+ $lastbubble = $first + $bubble_lines_per_response{$responsenum};
}
if ($lastbubble > $max_bubble) { next; }
push(@to_correct,$missing);
}
if (@to_correct) {
&scantron_get_correction($r,$i,$scan_record,\%scantron_config,
- $line,'missingbubble',\@to_correct);
+ $line,'missingbubble',\@to_correct,
+ $randomorder,$randompick,\%respnumlookup,
+ \%startline);
return (1,$currentphase);
}
@@ -7697,8 +8210,7 @@ sub scantron_process_students {
my $default_form_data=&defaultFormData($symb);
my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
- my $bubbles_per_row =
- &bubblesheet_bubbles_per_row(\%scantron_config);
+ my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
my ($scanlines,$scan_data)=&scantron_getfile();
my $classlist=&Apache::loncoursedata::get_classlist();
my %idmap=&username_to_idmap($classlist);
@@ -7706,36 +8218,28 @@ sub scantron_process_students {
unless (ref($navmap)) {
$r->print(&navmap_errormsg());
return '';
- }
- my $map=$navmap->getResourceByUrl($sequence);
- my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
- my (%grader_partids_by_symb,%grader_randomlists_by_symb);
- &graders_resources_pass(\@resources,\%grader_partids_by_symb,
- \%grader_randomlists_by_symb,$bubbles_per_row);
- my $resource_error;
- foreach my $resource (@resources) {
- my $ressymb;
- if (ref($resource)) {
- $ressymb = $resource->symb();
- } else {
- $resource_error = 1;
- last;
- }
- my ($analysis,$parts) =
- &scantron_partids_tograde($resource,$env{'request.course.id'},
- $env{'user.name'},$env{'user.domain'},1,$bubbles_per_row);
- $grader_partids_by_symb{$ressymb} = $parts;
- if (ref($analysis) eq 'HASH') {
- if (ref($analysis->{'parts_withrandomlist'}) eq 'ARRAY') {
- $grader_randomlists_by_symb{$ressymb} =
- $analysis->{'parts_withrandomlist'};
- }
- }
}
- if ($resource_error) {
+ my $map=$navmap->getResourceByUrl($sequence);
+ my ($randomorder,$randompick,@master_seq,%symb_to_resource,%grader_partids_by_symb,
+ %grader_randomlists_by_symb);
+ if (ref($map)) {
+ $randomorder = $map->randomorder();
+ $randompick = $map->randompick();
+ } else {
$r->print(&navmap_errormsg());
return '';
}
+ my $nav_error;
+ my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
+ if ($randomorder || $randompick) {
+ $nav_error = &get_master_seq(\@resources,\@master_seq,\%symb_to_resource);
+ if ($nav_error) {
+ $r->print(&navmap_errormsg());
+ return '';
+ }
+ }
+ &graders_resources_pass(\@resources,\%grader_partids_by_symb,
+ \%grader_randomlists_by_symb,$bubbles_per_row);
my ($uname,$udom);
my $result= <print(' ');
my $start=&Time::HiRes::time();
my $i=-1;
my $started;
- my $nav_error;
&scantron_get_maxbubble(\$nav_error,\%scantron_config); # Need the bubble lines array to parse.
if ($nav_error) {
$r->print(&navmap_errormsg());
@@ -7779,6 +8279,7 @@ SCANTRONFORM
my %lettdig = &letter_to_digits();
my $numletts = scalar(keys(%lettdig));
+ my %orderedforcode;
while ($i<$scanlines->{'count'}) {
($uname,$udom)=('','');
@@ -7786,12 +8287,18 @@ SCANTRONFORM
my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
if ($started) {
- &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student');
+ &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');
}
$started=1;
+ my %respnumlookup = ();
+ my %startline = ();
+ my $total;
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
- $scan_data);
+ $scan_data,undef,\%idmap,$randomorder,
+ $randompick,$sequence,\@master_seq,
+ \%symb_to_resource,\%grader_partids_by_symb,
+ \%orderedforcode,\%respnumlookup,\%startline,
+ \$total);
unless ($uname=&scantron_find_student($scan_record,$scan_data,
\%idmap,$i)) {
&scantron_add_delay(\@delayqueue,$line,
@@ -7803,10 +8310,26 @@ SCANTRONFORM
'Student '.$uname.' has multiple sheets',2);
next;
}
+ my $usec = $classlist->{$uname}->[&Apache::loncoursedata::CL_SECTION];
+ my $user = $uname.':'.$usec;
($uname,$udom)=split(/:/,$uname);
+ my $scancode;
+ if ((exists($scan_record->{'scantron.CODE'})) &&
+ (&Apache::lonnet::validCODE($scan_record->{'scantron.CODE'}))) {
+ $scancode = $scan_record->{'scantron.CODE'};
+ } else {
+ $scancode = '';
+ }
+
+ my @mapresources = @resources;
+ if ($randomorder || $randompick) {
+ @mapresources =
+ &users_order($user,$scancode,$sequence,\@master_seq,\%symb_to_resource,
+ \%orderedforcode);
+ }
my (%partids_by_symb,$res_error);
- foreach my $resource (@resources) {
+ foreach my $resource (@mapresources) {
my $ressymb;
if (ref($resource)) {
$ressymb = $resource->symb();
@@ -7817,7 +8340,8 @@ SCANTRONFORM
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
my ($analysis,$parts) =
- &scantron_partids_tograde($resource,$env{'request.course.id'},$uname,$udom,undef,$bubbles_per_row);
+ &scantron_partids_tograde($resource,$env{'request.course.id'},
+ $uname,$udom,undef,$bubbles_per_row);
$partids_by_symb{$ressymb} = $parts;
} else {
$partids_by_symb{$ressymb} = $grader_partids_by_symb{$ressymb};
@@ -7837,17 +8361,11 @@ SCANTRONFORM
&scantron_putfile($scanlines,$scan_data);
}
- my $scancode;
- if ((exists($scan_record->{'scantron.CODE'})) &&
- (&Apache::lonnet::validCODE($scan_record->{'scantron.CODE'}))) {
- $scancode = $scan_record->{'scantron.CODE'};
- } else {
- $scancode = '';
- }
-
if (&grade_student_bubbles($r,$uname,$udom,$scan_record,$scancode,
- \@resources,\%partids_by_symb,
- $bubbles_per_row) eq 'ssi_error') {
+ \@mapresources,\%partids_by_symb,
+ $bubbles_per_row,$randomorder,$randompick,
+ \%respnumlookup,\%startline)
+ eq 'ssi_error') {
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
@@ -7855,27 +8373,43 @@ SCANTRONFORM
return ''; # Why return ''? Beats me.
}
+ if (($scancode) && ($randomorder || $randompick)) {
+ my $parmresult =
+ &Apache::lonparmset::storeparm_by_symb($symb,
+ '0_examcode',2,$scancode,
+ 'string_examcode',$uname,
+ $udom);
+ }
$completedstudents{$uname}={'line'=>$line};
if ($env{'form.verifyrecord'}) {
my $lastpos = $env{'form.scantron_maxbubble'}*$scantron_config{'Qlength'};
+ if ($randompick) {
+ if ($total) {
+ $lastpos = $total*$scantron_config{'Qlength'};
+ }
+ }
+
my $studentdata = substr($line,$scantron_config{'Qstart'}-1,$lastpos);
chomp($studentdata);
$studentdata =~ s/\r$//;
my $studentrecord = '';
my $counter = -1;
- foreach my $resource (@resources) {
+ foreach my $resource (@mapresources) {
my $ressymb = $resource->symb();
($counter,my $recording) =
&verify_scantron_grading($resource,$udom,$uname,$env{'request.course.id'},
$counter,$studentdata,$partids_by_symb{$ressymb},
- \%scantron_config,\%lettdig,$numletts);
+ \%scantron_config,\%lettdig,$numletts,$randomorder,
+ $randompick,\%respnumlookup,\%startline);
$studentrecord .= $recording;
}
if ($studentrecord ne $studentdata) {
&Apache::lonxml::clear_problem_counter();
if (&grade_student_bubbles($r,$uname,$udom,$scan_record,$scancode,
- \@resources,\%partids_by_symb,
- $bubbles_per_row) eq 'ssi_error') {
+ \@mapresources,\%partids_by_symb,
+ $bubbles_per_row,$randomorder,$randompick,
+ \%respnumlookup,\%startline)
+ eq 'ssi_error') {
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
@@ -7885,12 +8419,14 @@ SCANTRONFORM
}
$counter = -1;
$studentrecord = '';
- foreach my $resource (@resources) {
+ foreach my $resource (@mapresources) {
my $ressymb = $resource->symb();
($counter,my $recording) =
&verify_scantron_grading($resource,$udom,$uname,$env{'request.course.id'},
$counter,$studentdata,$partids_by_symb{$ressymb},
- \%scantron_config,\%lettdig,$numletts);
+ \%scantron_config,\%lettdig,$numletts,
+ $randomorder,$randompick,\%respnumlookup,
+ \%startline);
$studentrecord .= $recording;
}
if ($studentrecord ne $studentdata) {
@@ -7946,7 +8482,8 @@ sub graders_resources_pass {
my $ressymb = $resource->symb();
my ($analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
- $env{'user.name'},$env{'user.domain'},1,$bubbles_per_row);
+ $env{'user.name'},$env{'user.domain'},
+ 1,$bubbles_per_row);
$grader_partids_by_symb->{$ressymb} = $parts;
if (ref($analysis) eq 'HASH') {
if (ref($analysis->{'parts_withrandomlist'}) eq 'ARRAY') {
@@ -7959,9 +8496,67 @@ sub graders_resources_pass {
return;
}
+=pod
+
+=item users_order
+
+ Returns array of resources in current map, ordered based on either CODE,
+ if this is a CODEd exam, or based on student's identity if this is a
+ "NAMEd" exam.
+
+ Should be used when randomorder and/or randompick applied when the
+ corresponding exam was printed, prior to students completing bubblesheets
+ for the version of the exam the student received.
+
+=cut
+
+sub users_order {
+ my ($user,$scancode,$mapurl,$master_seq,$symb_to_resource,$orderedforcode) = @_;
+ my @mapresources;
+ unless ((ref($master_seq) eq 'ARRAY') && (ref($symb_to_resource) eq 'HASH')) {
+ return @mapresources;
+ }
+ if ($scancode) {
+ if ((ref($orderedforcode) eq 'HASH') && (ref($orderedforcode->{$scancode}) eq 'ARRAY')) {
+ @mapresources = @{$orderedforcode->{$scancode}};
+ } else {
+ $env{'form.CODE'} = $scancode;
+ my $actual_seq =
+ &Apache::lonprintout::master_seq_to_person_seq($mapurl,
+ $master_seq,
+ $user,$scancode,1);
+ if (ref($actual_seq) eq 'ARRAY') {
+ @mapresources = map { $symb_to_resource->{$_}; } @{$actual_seq};
+ if (ref($orderedforcode) eq 'HASH') {
+ if (@mapresources > 0) {
+ $orderedforcode->{$scancode} = \@mapresources;
+ }
+ }
+ }
+ delete($env{'form.CODE'});
+ }
+ } else {
+ my $actual_seq =
+ &Apache::lonprintout::master_seq_to_person_seq($mapurl,
+ $master_seq,
+ $user,undef,1);
+ if (ref($actual_seq) eq 'ARRAY') {
+ @mapresources =
+ map { $symb_to_resource->{$_}; } @{$actual_seq};
+ }
+ }
+ return @mapresources;
+}
+
sub grade_student_bubbles {
- my ($r,$uname,$udom,$scan_record,$scancode,$resources,$parts,$bubbles_per_row) = @_;
-# Walk folder as student here to get resources in order student sees.
+ my ($r,$uname,$udom,$scan_record,$scancode,$resources,$parts,$bubbles_per_row,
+ $randomorder,$randompick,$respnumlookup,$startline) = @_;
+ my $uselookup = 0;
+ if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH') &&
+ (ref($startline) eq 'HASH')) {
+ $uselookup = 1;
+ }
+
if (ref($resources) eq 'ARRAY') {
my $count = 0;
foreach my $resource (@{$resources}) {
@@ -7983,8 +8578,12 @@ sub grade_student_bubbles {
if (ref($parts) eq 'HASH') {
if (ref($parts->{$ressymb}) eq 'ARRAY') {
foreach my $part (@{$parts->{$ressymb}}) {
- $form{'scantron_questnum_start.'.$part} =
- 1+$env{'form.scantron.first_bubble_line.'.$count};
+ if ($uselookup) {
+ $form{'scantron_questnum_start.'.$part} = $startline->{$count} + 1;
+ } else {
+ $form{'scantron_questnum_start.'.$part} =
+ 1+$env{'form.scantron.first_bubble_line.'.$count};
+ }
$count++;
}
}
@@ -8215,7 +8814,7 @@ sub scantron_download_scantron_data {
if (! &valid_file($file)) {
$r->print('
- '.&mt('The requested file name was invalid.').'
+ '.&mt('The requested filename was invalid.').'
');
return;
@@ -8265,10 +8864,20 @@ sub checkscantron_results {
return '';
}
my $map=$navmap->getResourceByUrl($sequence);
+ my ($randomorder,$randompick,@master_seq,%symb_to_resource,%grader_partids_by_symb,
+ %grader_randomlists_by_symb,%orderedforcode);
+ if (ref($map)) {
+ $randomorder=$map->randomorder();
+ $randompick=$map->randompick();
+ }
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
- my (%grader_partids_by_symb,%grader_randomlists_by_symb);
- &graders_resources_pass(\@resources,\%grader_partids_by_symb, \%grader_randomlists_by_symb);
-
+ my $nav_error = &get_master_seq(\@resources,\@master_seq,\%symb_to_resource);
+ if ($nav_error) {
+ $r->print(&navmap_errormsg());
+ return '';
+ }
+ &graders_resources_pass(\@resources,\%grader_partids_by_symb,
+ \%grader_randomlists_by_symb,$bubbles_per_row);
my ($uname,$udom);
my (%scandata,%lastname,%bylast);
$r->print('
@@ -8277,20 +8886,16 @@ sub checkscantron_results {
my @delayqueue;
my %completedstudents;
- my $count=&Apache::grades::get_todo_count($scanlines,$scan_data);
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Bubblesheet/Submissions Comparison Status',
- 'Progress of Bubblesheet Data/Submission Records Comparison',$count,
- 'inline',undef,'checkscantron');
- my ($username,$domain,$started);
- my $nav_error;
+ my $count=&get_todo_count($scanlines,$scan_data);
+ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$count);
+ my ($username,$domain,$started,%ordered);
&scantron_get_maxbubble(\$nav_error,\%scantron_config); # Need the bubble lines array to parse.
if ($nav_error) {
$r->print(&navmap_errormsg());
return '';
}
- &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
- 'Processing first student');
+ &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,'Processing first student');
my $start=&Time::HiRes::time();
my $i=-1;
@@ -8300,15 +8905,14 @@ sub checkscantron_results {
my $line=&Apache::grades::scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
if ($started) {
- &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student');
+ &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');
}
$started=1;
my $scan_record=
&Apache::grades::scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
- unless ($uname=&Apache::grades::scantron_find_student($scan_record,$scan_data,
- \%idmap,$i)) {
+ unless ($uname=&scantron_find_student($scan_record,$scan_data,
+ \%idmap,$i)) {
&Apache::grades::scantron_add_delay(\@delayqueue,$line,
'Unable to find a student that matches',1);
next;
@@ -8321,26 +8925,57 @@ sub checkscantron_results {
my $pid = $scan_record->{'scantron.ID'};
$lastname{$pid} = $scan_record->{'scantron.LastName'};
push(@{$bylast{$lastname{$pid}}},$pid);
+ my $usec = $classlist->{$uname}->[&Apache::loncoursedata::CL_SECTION];
+ my $user = $uname.':'.$usec;
+ ($username,$domain)=split(/:/,$uname);
+
+ my $scancode;
+ if ((exists($scan_record->{'scantron.CODE'})) &&
+ (&Apache::lonnet::validCODE($scan_record->{'scantron.CODE'}))) {
+ $scancode = $scan_record->{'scantron.CODE'};
+ } else {
+ $scancode = '';
+ }
+
+ my @mapresources = @resources;
my $lastpos = $env{'form.scantron_maxbubble'}*$scantron_config{'Qlength'};
+ my %respnumlookup=();
+ my %startline=();
+ if ($randomorder || $randompick) {
+ @mapresources =
+ &users_order($user,$scancode,$sequence,\@master_seq,\%symb_to_resource,
+ \%orderedforcode);
+ my $total = &get_respnum_lookups($sequence,$scan_data,\%idmap,$line,
+ $scan_record,\@master_seq,\%symb_to_resource,
+ \%grader_partids_by_symb,\%orderedforcode,
+ \%respnumlookup,\%startline);
+ if ($randompick && $total) {
+ $lastpos = $total*$scantron_config{'Qlength'};
+ }
+ }
$scandata{$pid} = substr($line,$scantron_config{'Qstart'}-1,$lastpos);
chomp($scandata{$pid});
$scandata{$pid} =~ s/\r$//;
- ($username,$domain)=split(/:/,$uname);
+
my $counter = -1;
- foreach my $resource (@resources) {
+ foreach my $resource (@mapresources) {
my $parts;
my $ressymb = $resource->symb();
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
(my $analysis,$parts) =
- &scantron_partids_tograde($resource,$env{'request.course.id'},$username,$domain,undef,$bubbles_per_row);
+ &scantron_partids_tograde($resource,$env{'request.course.id'},
+ $username,$domain,undef,
+ $bubbles_per_row);
} else {
$parts = $grader_partids_by_symb{$ressymb};
}
($counter,my $recording) =
&verify_scantron_grading($resource,$domain,$username,$cid,$counter,
$scandata{$pid},$parts,
- \%scantron_config,\%lettdig,$numletts);
+ \%scantron_config,\%lettdig,$numletts,
+ $randomorder,$randompick,
+ \%respnumlookup,\%startline);
$record{$pid} .= $recording;
}
}
@@ -8387,7 +9022,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".
@@ -8413,7 +9053,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());
@@ -8422,15 +9063,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;
@@ -8526,7 +9173,7 @@ sub verify_scantron_grading {
return ($counter,$record);
}
-sub letter_to_digits {
+sub letter_to_digits {
my %lettdig = (
A => 1,
B => 2,
@@ -8553,7 +9200,7 @@ sub letter_to_digits {
sub href_symb_cmd {
my ($symb,$cmd)=@_;
- return '/adm/grades?symb='.&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb),'<>&"').'&command='.$cmd;
+ return '/adm/grades?symb='.&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb),'<>&"').'&command='.$cmd;
}
sub grading_menu {
@@ -8816,6 +9463,21 @@ sub init_perm {
}
}
+sub init_old_essays {
+ my ($symb,$apath,$adom,$aname) = @_;
+ if ($symb ne '') {
+ my %essays = &Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname);
+ if (keys(%essays) > 0) {
+ $old_essays{$symb} = \%essays;
+ }
+ }
+ return;
+}
+
+sub reset_old_essays {
+ undef(%old_essays);
+}
+
sub gather_clicker_ids {
my %clicker_ids;
@@ -8913,7 +9575,8 @@ sub process_clicker {
my $pincorrect=&mt("Percentage points for incorrect solution");
my $selectform=&Apache::loncommon::select_form($env{'form.upfiletype'},'upfiletype',
{'iclicker' => 'i>clicker',
- 'interwrite' => 'interwrite PRS'});
+ 'interwrite' => 'interwrite PRS',
+ 'turning' => 'Turning Technologies'});
$symb = &Apache::lonenc::check_encrypt($symb);
$result.= &Apache::lonhtmlcommon::scripttag(<'.&mt('Found [_1] question(s)',$number).' '.
''.
&mt('Awarding [_1] percent for correct and [_2] percent for incorrect responses',
@@ -9145,7 +9811,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).'';
}
@@ -9223,6 +9889,32 @@ sub interwrite_eval {
return ($errormsg,$number);
}
+sub turning_eval {
+ my ($questiontitles,$responses)=@_;
+ my $number=0;
+ my $errormsg='';
+ foreach my $line (split(/[\n\r]/,$env{'form.upfile'})) {
+ my %components=&Apache::loncommon::record_sep($line);
+ my @entries=map {$components{$_}} (sort(keys(%components)));
+ if ($#entries>$number) { $number=$#entries; }
+ my $id=$entries[0];
+ my @idresponses;
+ $id=~s/^[\#0]+//;
+ unless ($id) { next; }
+ for (my $idx=1;$idx<=$#entries;$idx++) {
+ $entries[$idx]=~s/\,/\;/g;
+ $entries[$idx]=~s/[^a-zA-Z0-9\.\*\-\+\;]+//g;
+ push(@idresponses,$entries[$idx]);
+ }
+ $$responses{$id}=join(',',@idresponses);
+ }
+ for (my $i=1; $i<=$number; $i++) {
+ $$questiontitles[$i]=&mt('Question [_1]',$i);
+ }
+ return ($errormsg,$number);
+}
+
+
sub assign_clicker_grades {
my ($r,$symb)=@_;
if (!$symb) {return '';}
@@ -9291,7 +9983,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;
@@ -9360,13 +10052,17 @@ sub navmap_errormsg {
}
sub startpage {
- my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag) = @_;
- unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"});
- $r->print(&Apache::loncommon::start_page('Grading',undef,
- {'bread_crumbs' => $crumbs}));
- &Apache::lonquickgrades::startGradeScreen($r,($env{'form.symb'}?'probgrading':'grading'));
+ my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag,$stuvcurrent,$stuvdisp,$nomenu,$js) = @_;
+ if ($nomenu) {
+ $r->print(&Apache::loncommon::start_page("Student's Version",$js,{'only_body' => '1'}));
+ } else {
+ unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"});
+ $r->print(&Apache::loncommon::start_page('Grading',$js,
+ {'bread_crumbs' => $crumbs}));
+ &Apache::lonquickgrades::startGradeScreen($r,($env{'form.symb'}?'probgrading':'grading'));
+ }
unless ($nodisplayflag) {
- $r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag));
+ $r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp));
}
}
@@ -9403,6 +10099,7 @@ sub handler {
}
} elsif (!%perm) {
$request->internal_redirect('/adm/quickgrades');
+ return OK;
}
&Apache::loncommon::content_type($request,'text/html');
$request->send_http_header;
@@ -9429,8 +10126,29 @@ sub handler {
&select_problem($request);
} else {
if ($command eq 'submission' && $perm{'vgr'}) {
- &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]);
+ my ($stuvcurrent,$stuvdisp,$versionform,$js);
+ if (($env{'form.student'} ne '') && ($env{'form.userdom'} ne '')) {
+ ($stuvcurrent,$stuvdisp,$versionform,$js) =
+ &choose_task_version_form($symb,$env{'form.student'},
+ $env{'form.userdom'});
+ }
+ &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}],undef,undef,$stuvcurrent,$stuvdisp,undef,$js);
+ if ($versionform) {
+ $request->print($versionform);
+ }
+ $request->print(' ');
($env{'form.student'} eq '' ? &listStudents($request,$symb) : &submission($request,0,0,$symb));
+ } elsif ($command eq 'versionsub' && $perm{'vgr'}) {
+ my ($stuvcurrent,$stuvdisp,$versionform,$js) =
+ &choose_task_version_form($symb,$env{'form.student'},
+ $env{'form.userdom'},
+ $env{'form.inhibitmenu'});
+ &startpage($request,$symb,[{href=>"", text=>"Previous Student Version"}],undef,undef,$stuvcurrent,$stuvdisp,$env{'form.inhibitmenu'},$js);
+ if ($versionform) {
+ $request->print($versionform);
+ }
+ $request->print(' ');
+ $request->print(&show_previous_task_version($request,$symb));
} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
&startpage($request,$symb,[{href=>&href_symb_cmd($symb,'all_for_one'),text=>'Grade page/folder for one student'},
{href=>'',text=>'Select student'}],1,1);
@@ -9568,8 +10286,11 @@ sub handler {
if ($ssi_error) {
&ssi_print_error($request);
}
- &Apache::lonquickgrades::endGradeScreen($request);
- $request->print(&Apache::loncommon::end_page());
+ if ($env{'form.inhibitmenu'}) {
+ $request->print(&Apache::loncommon::end_page());
+ } else {
+ &Apache::lonquickgrades::endGradeScreen($request);
+ }
&reset_caches();
return OK;
}
@@ -9640,6 +10361,75 @@ ssi_with_retries()
=over
+=head1 Routines to display previous version of a Task for a specific student
+
+Tasks are graded pass/fail. Students who have yet to pass a particular Task
+can receive another opportunity. Access to tasks is slot-based. If a slot
+requires a proctor to check-in the student, a new version of the Task will
+be created when the student is checked in to the new opportunity.
+
+If a particular student has tried two or more versions of a particular task,
+the submission screen provides a user with vgr privileges (e.g., a Course
+Coordinator) the ability to display a previous version worked on by the
+student. By default, the current version is displayed. If a previous version
+has been selected for display, submission data are only shown that pertain
+to that particular version, and the interface to submit grades is not shown.
+
+=over 4
+
+=item show_previous_task_version()
+
+Displays a specified version of a student's Task, as the student sees it.
+
+Inputs: 2
+ request - request object
+ symb - unique symb for current instance of resource
+
+Output: None.
+
+Side Effects: calls &show_problem() to print version of Task, with
+ version contained in form item: $env{'form.previousversion'}
+
+=item choose_task_version_form()
+
+Displays a web form used to select which version of a student's view of a
+Task should be displayed. Either launches a pop-up window, or replaces
+content in existing pop-up, or replaces page in main window.
+
+Inputs: 4
+ symb - unique symb for current instance of resource
+ uname - username of student
+ udom - domain of student
+ nomenu - 1 if display is in a pop-up window, and hence no menu
+ breadcrumbs etc., are displayed
+
+Output: 4
+ current - student's current version
+ displayed - student's version being displayed
+ result - scalar containing HTML for web form used to switch to
+ a different version (or a link to close window, if pop-up).
+ js - javascript for processing selection in versions web form
+
+Side Effects: None.
+
+=item previous_display_javascript()
+
+Inputs: 2
+ nomenu - 1 if display is in a pop-up window, and hence no menu
+ breadcrumbs etc., are displayed.
+ current - student's current version number.
+
+Output: 1
+ js - javascript for processing selection in versions web form.
+
+Side Effects: None.
+
+=back
+
+=head1 Routines to process bubblesheet data.
+
+=over 4
+
=item scantron_get_correction() :
Builds the interface screen to interact with the operator to fix a
@@ -9666,6 +10456,17 @@ ssi_with_retries()
- 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:
@@ -9686,7 +10487,7 @@ ssi_with_retries()
$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.
@@ -9745,7 +10546,9 @@ ssi_with_retries()
=item navmap_errormsg() :
Returns HTML mark-up inside a with a link to re-initialize the course.
- Should be called whenever the request to instantiate a navmap object fails.
+ Should be called whenever the request to instantiate a navmap object fails.
+
+=back
=back
|