');
- pDoc.write('');
- pDoc.write("$html_js_lt{'type'}<\\/b><\\/td> $html_js_lt{'incl'}<\\/b><\\/td> $html_js_lt{'mesa'}<\\/td><\\/tr>");
+ pDoc.write('
-
- '.&mt("If this information is correct, please click on '[_1]'.",&mt($button_text)).'
- '.&mt("If something is incorrect, please click the 'Grading Menu' button to start over.").'
+ '.&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.','',' ').'
');
@@ -6917,8 +6713,7 @@ sub scantron_warning_screen {
=cut
sub scantron_do_warning {
- my ($r)=@_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
my $default_form_data=&defaultFormData($symb);
$r->print(&scantron_form_start().$default_form_data);
@@ -6936,7 +6731,7 @@ sub scantron_do_warning {
$r->print(''.&mt("You have not selected the format of the student's response data.").'
');
}
} else {
- my $warning=&scantron_warning_screen('Grading: Validate Records');
+ my $warning=&scantron_warning_screen('Grading: Validate Records',$symb);
my $bubbledbyhand=&hand_bubble_option();
$r->print('
'.$warning.$bubbledbyhand.'
@@ -6944,7 +6739,7 @@ sub scantron_do_warning {
');
}
- $r->print(" ".&show_grading_menu_form($symb));
+ $r->print(" ");
return '';
}
@@ -7002,8 +6797,7 @@ SCANTRONFORM
=cut
sub scantron_validate_file {
- my ($r) = @_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb) = @_;
if (!$symb) {return '';}
my $default_form_data=&defaultFormData($symb);
@@ -7031,7 +6825,7 @@ sub scantron_validate_file {
#get the student pick code ready
$r->print(&Apache::loncommon::studentbrowser_javascript());
my $nav_error;
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my $max_bubble=&scantron_get_maxbubble(\$nav_error,\%scantron_config);
if ($nav_error) {
$r->print(&navmap_errormsg());
@@ -7058,7 +6852,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';
@@ -7066,7 +6860,7 @@ sub scantron_validate_file {
}
}
if (!$stop) {
- my $warning=&scantron_warning_screen('Start Grading');
+ my $warning=&scantron_warning_screen('Start Grading',$symb);
$r->print(&mt('Validation process complete.').' '.
$warning.
&mt('Perform verification for each student after storage of submissions?').
@@ -7076,7 +6870,7 @@ sub scantron_validate_file {
' '.&mt('No').
' '.
&mt('Grading will take longer if you use verification.').' '.
- &mt("Alternatively, the 'Review bubblesheet data' utility (see grading menu) can be used for all students after grading is complete.").' '.
+ &mt('Otherwise, Grade/Manage/Review Bubblesheets [_1] Review bubblesheet data can be used once grading is complete.','»').' '.
' '.
' '."\n");
} else {
@@ -7088,7 +6882,7 @@ sub scantron_validate_file {
$r->print(' ');
$r->print(' '.&mt('this error').' ');
- $r->print(" ".&mt("Or click the 'Grading Menu' button to start over.")."
");
+ $r->print(''.&mt('Or return to [_1]Grade/Manage/Review Bubblesheets[_2] to start over.','',' ').'
');
} else {
if ($validate_phases[$currentphase] eq 'doublebubble' || $validate_phases[$currentphase] eq 'missingbubbles') {
$r->print(' ');
@@ -7100,7 +6894,7 @@ sub scantron_validate_file {
$r->print(" ".&mt("this scanline saving it for later."));
}
}
- $r->print(" ".&show_grading_menu_form($symb));
+ $r->print(" ");
return '';
}
@@ -7467,9 +7261,10 @@ sub scantron_validate_sequence {
my @resources=
$navmap->retrieveResources($map,\&scantron_filter_not_exam,1,0);
if (@resources) {
- $r->print(''
+ $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.')
.'
'
);
@@ -7490,7 +7285,7 @@ sub scantron_validate_ID {
my %idmap=&username_to_idmap($classlist);
#get scantron line setup
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
my $nav_error;
@@ -7591,10 +7386,10 @@ sub scantron_get_correction {
if ($error =~ /ID$/) {
if ($error eq 'incorrectID') {
- $r->print(''.&mt("The encoded ID is not in the classlist").
+ $r->print('
'.&mt("The encoded ID is not in the classlist").
"
\n");
} elsif ($error eq 'duplicateID') {
- $r->print(''.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n");
+ $r->print(''.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n");
}
$r->print($message);
$r->print("".&mt("How should I handle this?")." \n");
@@ -7614,8 +7409,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}))."
\n");
}
- $r->print("".&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'}' ")
."
\n");
$r->print($message);
$r->print("".&mt("How should I handle this?")."
\n");
@@ -7651,8 +7446,7 @@ sub scantron_get_correction {
$r->print("\n ");
}
- $r->print(<
+ $r->print(&Apache::lonhtmlcommon::scripttag(<
ENDSCRIPT
my $href="/adm/pickcode?".
"form=".&escape("scantronupload").
@@ -7714,7 +7507,7 @@ 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,$randomorder,$randompick,
$respnumlookup,$startline);
@@ -7738,9 +7531,7 @@ sub verify_bubbles_checked {
my (@ansnums) = @_;
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 = (<
+ my $output = &Apache::lonhtmlcommon::scripttag((<
ENDSCRIPT
return $output;
}
@@ -7826,7 +7616,7 @@ sub questions_to_line_list {
} else {
$first = $first_bubble_line{$responsenum} + 1;
}
- $count = $bubble_lines_per_response{$responsenum};
+ $count = $bubble_lines_per_response{$responsenum};
}
$last = $first+$count-1;
push(@lines, ($first..$last));
@@ -7857,6 +7647,7 @@ for multi and missing bubble cases).
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.
Numbered from 0 (but question numbers are from
@@ -7909,7 +7700,7 @@ sub prompt_for_corrections {
} else {
if (($randomorder || $randompick) && (ref($respnumlookup) eq 'HASH')) {
$responsenum = $respnumlookup->{$question-1};
- if (ref($startline) eq 'HASH') {
+ if (ref($startline) eq 'HASH') {
$first = $startline->{$question-1};
}
} else {
@@ -7927,7 +7718,16 @@ sub prompt_for_corrections {
($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'.").' ');
+ $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. ")." ");
}
@@ -7954,7 +7754,7 @@ sub prompt_for_corrections {
Arguments:
$r - Apache request object
- $scan_config - hash from &Apache::lonnet::get_scantron_config()
+ $scan_config - hash from &get_scantron_config()
$line - Number of the line being displayed.
$questionnum - Question number (may include subquestion)
$error - Type of error.
@@ -7967,7 +7767,7 @@ sub scantron_bubble_selector {
my $max=$$scan_config{'Qlength'};
my $scmode=$$scan_config{'Qon'};
- if ($scmode eq 'number' || $scmode eq 'letter') {
+ if ($scmode eq 'number' || $scmode eq 'letter') {
if (($$scan_config{'BubblesPerRow'} =~ /^\d+$/) &&
($$scan_config{'BubblesPerRow'} > 0)) {
$max=$$scan_config{'BubblesPerRow'};
@@ -8118,7 +7918,7 @@ sub get_codes {
sub scantron_validate_CODE {
my ($r,$currentphase) = @_;
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
if ($scantron_config{'CODElocation'} &&
$scantron_config{'CODEstart'} &&
$scantron_config{'CODElength'}) {
@@ -8192,7 +7992,7 @@ sub scantron_validate_doublebubble {
&Apache::lonnet::decode_symb($env{'form.selectpage'});
#get scantron line setup
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
my $navmap = Apache::lonnavmaps::navmap->new();
@@ -8286,7 +8086,7 @@ sub scantron_get_maxbubble {
my $response_number = 0;
my $bubble_line = 0;
foreach my $resource (@resources) {
- my $resid = $resource->id();
+ 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')) {
@@ -8337,7 +8137,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;
+ $masterseq_id_responsenum{$resid.'_'.$part_id} = $response_number;
$response_number++;
$bubble_line += $lines;
@@ -8374,7 +8174,7 @@ sub scantron_validate_missingbubbles {
&Apache::lonnet::decode_symb($env{'form.selectpage'});
#get scantron line setup
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
my $navmap = Apache::lonnavmaps::navmap->new();
@@ -8418,9 +8218,9 @@ sub scantron_validate_missingbubbles {
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 =
+ my $scan_record =
&scantron_parse_scanline($line,$i,\%scantron_config,$scan_data,undef,\%idmap,
- $randomorder,$randompick,$sequence,\@master_seq,
+ $randomorder,$randompick,$sequence,\@master_seq,
\%symb_to_resource,\%grader_partids_by_symb,
\%orderedforcode,\%respnumlookup,\%startline);
if (!defined($$scan_record{'scantron.missingerror'})) { next; }
@@ -8431,36 +8231,36 @@ sub scantron_validate_missingbubbles {
foreach my $missing (@{$$scan_record{'scantron.missingerror'}}) {
my $lastbubble;
if ($missing =~ /^(\d+)\.(\d+)$/) {
- my $question = $1;
- my $subquestion = $2;
- 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];
- $subcount ++;
- }
- my $count = $subans[$subquestion-1];
- $lastbubble = $first + $count;
+ my $question = $1;
+ my $subquestion = $2;
+ 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];
+ $subcount ++;
+ }
+ my $count = $subans[$subquestion-1];
+ $lastbubble = $first + $count;
} else {
- 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};
+ 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);
@@ -8503,7 +8303,7 @@ sub hand_bubble_option {
}
}
if ($needs_hand_bubbles) {
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
return &mt('The sequence to be graded contains response types which are handgraded.').''.
&mt('If you have already graded these by bubbling sheets to indicate points awarded, [_1]what point value is assigned to a filled last bubble in each row?',' ').
@@ -8514,17 +8314,16 @@ sub hand_bubble_option {
}
sub scantron_process_students {
- my ($r) = @_;
+ my ($r,$symb) = @_;
my (undef,undef,$sequence)=&Apache::lonnet::decode_symb($env{'form.selectpage'});
- my ($symb)=&get_symb($r);
if (!$symb) {
return '';
}
my $default_form_data=&defaultFormData($symb);
- my %scantron_config=&Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
- my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
+ 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);
@@ -8569,8 +8368,7 @@ SCANTRONFORM
my $lock=&Apache::lonnet::set_lock(&mt('Grading bubblesheet exam'));
my $count=&get_todo_count($scanlines,$scan_data);
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$count);
- &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
- 'Processing first student');
+ &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,'Processing first student');
$r->print(' ');
my $start=&Time::HiRes::time();
my $i=-1;
@@ -8588,12 +8386,11 @@ SCANTRONFORM
if ($ssi_error) {
$r->print("");
&ssi_print_error($r);
- $r->print(&show_grading_menu_form($symb));
&Apache::lonnet::remove_lock($lock);
return ''; # Dunno why the other returns return '' rather than just returning.
}
- my %lettdig = &Apache::lonnet::letter_to_digits();
+ my %lettdig = &letter_to_digits();
my $numletts = scalar(keys(%lettdig));
my %orderedforcode;
@@ -8603,15 +8400,14 @@ 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,undef,\%idmap,$randomorder,
+ $scan_data,undef,\%idmap,$randomorder,
$randompick,$sequence,\@master_seq,
\%symb_to_resource,\%grader_partids_by_symb,
\%orderedforcode,\%respnumlookup,\%startline,
@@ -8641,7 +8437,7 @@ SCANTRONFORM
my @mapresources = @resources;
if ($randomorder || $randompick) {
- @mapresources =
+ @mapresources =
&users_order($user,$scancode,$sequence,\@master_seq,\%symb_to_resource,
\%orderedforcode);
}
@@ -8656,14 +8452,9 @@ SCANTRONFORM
}
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
- my $currcode;
- if (exists($grader_randomlists_by_symb{$ressymb})) {
- $currcode = $scancode;
- }
my ($analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
- $uname,$udom,undef,$bubbles_per_row,
- $currcode);
+ $uname,$udom,undef,$bubbles_per_row);
$partids_by_symb{$ressymb} = $parts;
} else {
$partids_by_symb{$ressymb} = $grader_partids_by_symb{$ressymb};
@@ -8691,7 +8482,6 @@ SCANTRONFORM
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
- $r->print(&show_grading_menu_form($symb));
&Apache::lonnet::remove_lock($lock);
return ''; # Why return ''? Beats me.
}
@@ -8731,12 +8521,11 @@ SCANTRONFORM
if (&grade_student_bubbles($r,$uname,$udom,$scan_record,$scancode,
\@mapresources,\%partids_by_symb,
$bubbles_per_row,$randomorder,$randompick,
- \%respnumlookup,\%startline)
+ \%respnumlookup,\%startline)
eq 'ssi_error') {
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
- $r->print(&show_grading_menu_form($symb));
&Apache::lonnet::remove_lock($lock);
delete($completedstudents{$uname});
return '';
@@ -8794,7 +8583,6 @@ SCANTRONFORM
# $r->print("
took $lasttime
");
$r->print("");
- $r->print(&show_grading_menu_form($symb));
return '';
}
@@ -8826,7 +8614,7 @@ sub graders_resources_pass {
=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
+ 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
@@ -8853,7 +8641,7 @@ sub users_order {
if (ref($actual_seq) eq 'ARRAY') {
@mapresources = map { $symb_to_resource->{$_}; } @{$actual_seq};
if (ref($orderedforcode) eq 'HASH') {
- if (@mapresources > 0) {
+ if (@mapresources > 0) {
$orderedforcode->{$scancode} = \@mapresources;
}
}
@@ -8866,7 +8654,7 @@ sub users_order {
$master_seq,
$user,undef,1);
if (ref($actual_seq) eq 'ARRAY') {
- @mapresources =
+ @mapresources =
map { $symb_to_resource->{$_}; } @{$actual_seq};
}
}
@@ -8922,22 +8710,18 @@ sub grade_student_bubbles {
}
sub scantron_upload_scantron_data {
- my ($r)=@_;
+ my ($r,$symb)=@_;
my $dom = $env{'request.role.domain'};
- my ($formatoptions,$formattitle,$formatjs) = &scantron_upload_dataformat($dom);
my $domdesc = &Apache::lonnet::domain($dom,'description');
$r->print(&Apache::loncommon::coursebrowser_javascript($dom));
my $select_link=&Apache::loncommon::selectcourse_link('rules','courseid',
'domainid',
'coursename',$dom);
my $syllabuslink = ''.&mt('Syllabus').' '.
- (' 'x2).&mt('(shows course personnel)');
- my ($symb) = &get_symb($r,1);
+ (' 'x2).&mt('(shows course personnel)');
my $default_form_data=&defaultFormData($symb);
my $nofile_alert = &mt('Please use the browse button to select a file from your local directory.');
- &js_escape(\$nofile_alert);
my $nocourseid_alert = &mt("Please use the 'Select Course' link to open a separate window where you can search for a course to which a file can be uploaded.");
- &js_escape(\$nocourseid_alert);
$r->print(&Apache::lonhtmlcommon::scripttag('
function checkUpload(formname) {
if (formname.upfile.value == "") {
@@ -8965,7 +8749,6 @@ sub scantron_upload_scantron_data {
return;
}
- '.$formatjs.'
'));
$r->print('
'.&mt('Send bubblesheet data to a course').'
@@ -8981,12 +8764,7 @@ sub scantron_upload_scantron_data {
&Apache::lonhtmlcommon::row_closure().
&Apache::lonhtmlcommon::row_title(&mt('Domain')).
' '.$domdesc.
- &Apache::lonhtmlcommon::row_closure());
- if ($formatoptions) {
- $r->print(&Apache::lonhtmlcommon::row_title($formattitle).$formatoptions.
- &Apache::lonhtmlcommon::row_closure());
- }
- $r->print(
+ &Apache::lonhtmlcommon::row_closure().
&Apache::lonhtmlcommon::row_title(&mt('File to upload')).
' '.
&Apache::lonhtmlcommon::row_closure(1).
@@ -8999,88 +8777,9 @@ sub scantron_upload_scantron_data {
return '';
}
-sub scantron_upload_dataformat {
- my ($dom) = @_;
- my ($formatoptions,$formattitle,$formatjs);
- $formatjs = <<'END';
-function toggleScantab(form) {
- return;
-}
-END
- my %domconfig = &Apache::lonnet::get_dom('configuration',['scantron'],$dom);
- if (ref($domconfig{'scantron'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}) eq 'HASH') {
- if (keys(%{$domconfig{'scantron'}{'config'}}) > 1) {
- if (($domconfig{'scantron'}{'config'}{'dat'}) &&
- (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH')) {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}})) {
- my ($onclick,$formatextra,$singleline);
- my @lines = &Apache::lonnet::get_scantronformat_file();
- my $count = 0;
- foreach my $line (@lines) {
- next if ($line =~ /^#/);
- $singleline = $line;
- $count ++;
- }
- if ($count > 1) {
- $formatextra = ''.
- ''.
- &mt('Bubblesheet type:').' '.
- &scantron_scantab().'
';
- $onclick = ' onclick="toggleScantab(this.form);"';
- $formatjs = <<"END";
-function toggleScantab(form) {
- var divid = 'bubbletype';
- if (document.getElementById(divid)) {
- var radioname = 'fileformat';
- var num = form.elements[radioname].length;
- if (num) {
- for (var i=0; i ';
- }
- $formattitle = &mt('File format');
- $formatoptions = ' '.
- &mt('Plain Text (no delimiters)').
- ' '.(' 'x2).
- ' '.
- &mt('Comma separated values').' '.$formatextra;
- }
- }
- }
- } elsif (keys(%{$domconfig{'scantron'}{'config'}}) == 1) {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}})) {
- $formattitle = &mt('Bubblesheet type');
- $formatoptions = &scantron_scantab();
- }
- }
- }
- }
- }
- return ($formatoptions,$formattitle,$formatjs);
-}
sub scantron_upload_scantron_data_save {
- my($r)=@_;
- my ($symb)=&get_symb($r,1);
+ my($r,$symb)=@_;
my $doanotherupload=
''."\n".
' '."\n".
@@ -9090,56 +8789,24 @@ sub scantron_upload_scantron_data_save {
!&Apache::lonnet::allowed('usc',
$env{'form.domainid'}.'_'.$env{'form.courseid'})) {
$r->print(&mt("You are not allowed to upload bubblesheet data to the requested course.")." ");
- if ($symb) {
- $r->print(&show_grading_menu_form($symb));
- } else {
+ unless ($symb) {
$r->print($doanotherupload);
}
return '';
}
my %coursedata=&Apache::lonnet::coursedescription($env{'form.domainid'}.'_'.$env{'form.courseid'});
my $uploadedfile;
- $r->print(''.&mt("Uploading file to [_1]",$coursedata{'description'}).'
');
+ $r->print(''.&mt('Uploading file to [_1]','"'.$coursedata{'description'}.'"').'
');
if (length($env{'form.upfile'}) < 2) {
$r->print(
&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));
} else {
- my %domconfig = &Apache::lonnet::get_dom('configuration',['scantron'],$env{'form.domainid'});
- my $parser;
- if (ref($domconfig{'scantron'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}) eq 'HASH') {
- my $is_csv;
- my @possibles = keys(%{$domconfig{'scantron'}{'config'}});
- if (@possibles > 1) {
- if ($env{'form.fileformat'} eq 'csv') {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}}) > 1) {
- $is_csv = 1;
- }
- }
- }
- }
- } elsif (@possibles == 1) {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}}) > 1) {
- $is_csv = 1;
- }
- }
- }
- }
- if ($is_csv) {
- $parser = $domconfig{'scantron'}{'config'}{'csv'};
- }
- }
- }
- my $result =
- &Apache::lonnet::userfileupload('upfile','scantron','scantron',$parser,'','',
+ my $result =
+ &Apache::lonnet::userfileupload('upfile','','scantron','','','',
$env{'form.courseid'},$env{'form.domainid'});
- if ($result =~ m{^/uploaded/}) {
+ if ($result =~ m{^/uploaded/}) {
$r->print(
&Apache::lonhtmlcommon::confirm_success(&mt('Upload successful')).' '.
&mt('Uploaded [_1] bytes of data into location: [_2]',
@@ -9148,7 +8815,7 @@ sub scantron_upload_scantron_data_save {
($uploadedfile) = ($result =~ m{/([^/]+)$});
$r->print(&validate_uploaded_scantron_file($env{'form.domainid'},
$env{'form.courseid'},$uploadedfile));
- } else {
+ } else {
$r->print(
&Apache::lonhtmlcommon::confirm_success(&mt('Upload failed'),1).' '.
&mt('An error ([_1]) occurred when attempting to upload the file: [_2]',
@@ -9157,7 +8824,7 @@ sub scantron_upload_scantron_data_save {
}
}
if ($symb) {
- $r->print(&scantron_selectphase($r,$uploadedfile));
+ $r->print(&scantron_selectphase($r,$uploadedfile,$symb));
} else {
$r->print($doanotherupload);
}
@@ -9182,7 +8849,7 @@ sub validate_uploaded_scantron_file {
$idmap{$lckey} = $idmap{$key};
}
my %unique_formats;
- my @formatlines = &Apache::lonnet::get_scantronformat_file();
+ my @formatlines = &get_scantronformat_file();
foreach my $line (@formatlines) {
chomp($line);
my @config = split(/:/,$line);
@@ -9283,8 +8950,7 @@ sub valid_file {
}
sub scantron_download_scantron_data {
- my ($r)=@_;
- my ($symb) = &get_symb($r,1);
+ my ($r,$symb)=@_;
my $default_form_data=&defaultFormData($symb);
my $cname=$env{'course.'.$env{'request.course.id'}.'.num'};
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -9295,7 +8961,6 @@ sub scantron_download_scantron_data {
'.&mt('The requested filename was invalid.').'
');
- $r->print(&show_grading_menu_form($symb));
return;
}
my $orig='/uploaded/'.$cdom.'/'.$cname.'/scantron_orig_'.$file;
@@ -9306,7 +8971,7 @@ sub scantron_download_scantron_data {
&Apache::lonnet::allowuploaded('/adm/grades',$skipped);
$r->print('
- '.&mt('[_1]Original[_2] file as uploaded by bubblesheet scanning office.',
+ '.&mt('[_1]Original[_2] file as uploaded by the bubblesheet scanning office.',
'',' ').'
@@ -9318,24 +8983,21 @@ sub scantron_download_scantron_data {
'',' ').'
');
- $r->print(&show_grading_menu_form($symb));
return '';
}
sub checkscantron_results {
- my ($r) = @_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb) = @_;
if (!$symb) {return '';}
- my $grading_menu_button=&show_grading_menu_form($symb);
my $cid = $env{'request.course.id'};
- my %lettdig = &Apache::lonnet::letter_to_digits();
+ my %lettdig = &letter_to_digits();
my $numletts = scalar(keys(%lettdig));
my $cnum = $env{'course.'.$cid.'.num'};
my $cdom = $env{'course.'.$cid.'.domain'};
my (undef, undef, $sequence) = &Apache::lonnet::decode_symb($env{'form.selectpage'});
my %record;
my %scantron_config =
- &Apache::lonnet::get_scantron_config($env{'form.scantron_format'});
+ &Apache::grades::get_scantron_config($env{'form.scantron_format'});
my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
my ($scanlines,$scan_data)=&Apache::grades::scantron_getfile();
my $classlist=&Apache::loncoursedata::get_classlist();
@@ -9348,7 +9010,7 @@ sub checkscantron_results {
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)) {
+ if (ref($map)) {
$randomorder=$map->randomorder();
$randompick=$map->randompick();
}
@@ -9377,8 +9039,7 @@ sub checkscantron_results {
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;
@@ -9388,8 +9049,7 @@ 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=
@@ -9447,14 +9107,10 @@ sub checkscantron_results {
my $ressymb = $resource->symb();
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
- my $currcode;
- if (exists($grader_randomlists_by_symb{$ressymb})) {
- $currcode = $scancode;
- }
(my $analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
$username,$domain,undef,
- $bubbles_per_row,$currcode);
+ $bubbles_per_row);
} else {
$parts = $grader_partids_by_symb{$ressymb};
}
@@ -9501,19 +9157,21 @@ sub checkscantron_results {
}
}
}
- $r->print(''.
- &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'}).
- '
'
+ $r->print(
+ ''
+ .&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'})
+ .'
'
);
$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".
@@ -9533,7 +9191,7 @@ sub checkscantron_results {
&Apache::loncommon::end_data_table()).' '.
&mt('Differences can occur if submissions were modified using manual grading after a bubblesheet grading pass.').' '.&mt('If unexpected discrepancies were detected, it is recommended that you inspect the original bubblesheets.');
}
- $r->print(' '.$grading_menu_button);
+ $r->print(' ');
return;
}
@@ -9659,36 +9317,29 @@ sub verify_scantron_grading {
return ($counter,$record);
}
+sub letter_to_digits {
+ my %lettdig = (
+ A => 1,
+ B => 2,
+ C => 3,
+ D => 4,
+ E => 5,
+ F => 6,
+ G => 7,
+ H => 8,
+ I => 9,
+ J => 0,
+ );
+ return %lettdig;
+}
+
+
#-------- end of section for handling grading scantron forms -------
#
#-------------------------------------------------------------------
#-------------------------- Menu interface -------------------------
#
-#--- Show a Grading Menu button - Calls the next routine ---
-sub show_grading_menu_form {
- my ($symb)=@_;
- my $result.=''."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n";
- return $result;
-}
-
-# -- Retrieve choices for grading form
-sub savedState {
- my %savedState = ();
- if ($env{'form.saveState'}) {
- foreach (split(/:/,$env{'form.saveState'})) {
- my ($key,$value) = split(/=/,$_,2);
- $savedState{$key} = $value;
- }
- }
- return \%savedState;
-}
-
#--- Href with symb and command ---
sub href_symb_cmd {
@@ -9697,23 +9348,26 @@ sub href_symb_cmd {
}
sub grading_menu {
- my ($request) = @_;
- my ($symb)=&get_symb($request);
+ my ($request,$symb) = @_;
if (!$symb) {return '';}
- my $probTitle = &Apache::lonnet::gettitle($symb);
- my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle);
- $request->print($table);
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb),
- 'handgrade'=>$hdgrade,
- 'probTitle'=>$probTitle,
- 'command'=>'submit_options',
- 'saveState'=>"",
- 'gradingMenu'=>1,
- 'showgrading'=>"yes");
-
- my $url1 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+ 'command'=>'individual');
+ my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ $fields{'command'}='ungraded';
+ my $url1b=&Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ $fields{'command'}='table';
+ my $url1c=&Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ $fields{'command'}='all_for_one';
+ my $url1d=&Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ $fields{'command'}='downloadfilesselect';
+ my $url1e=&Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
$fields{'command'} = 'csvform';
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
@@ -9722,15 +9376,46 @@ sub grading_menu {
$fields{'command'} = 'scantron_selectphase';
my $url4 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ $fields{'command'} = 'initialverifyreceipt';
+ my $url5 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- my @menu = ({ categorytitle=>'Course Grading',
+ my @menu = ({ categorytitle=>'Hand Grading',
items =>[
- { linktext => 'Manual Grading/View Submissions',
- url => $url1,
+ { linktext => 'Select individual students to grade',
+ url => $url1a,
permission => 'F',
- icon => 'edit-find-replace.png',
- linktitle => 'Start the process of hand grading submissions.'
+ icon => 'grade_students.png',
+ linktitle => 'Grade current resource for a selection of students.'
+ },
+ { linktext => 'Grade ungraded submissions.',
+ url => $url1b,
+ permission => 'F',
+ icon => 'ungrade_sub.png',
+ linktitle => 'Grade all submissions that have not been graded yet.'
+ },
+
+ { linktext => 'Grading table',
+ url => $url1c,
+ permission => 'F',
+ icon => 'grading_table.png',
+ linktitle => 'Grade current resource for all students.'
},
+ { linktext => 'Grade page/folder for one student',
+ url => $url1d,
+ permission => 'F',
+ icon => 'grade_PageFolder.png',
+ linktitle => 'Grade all resources in current page/sequence/folder for one student.'
+ },
+ { linktext => 'Download submissions',
+ url => $url1e,
+ permission => 'F',
+ icon => 'download_sub.png',
+ linktitle => 'Download all students submissions.'
+ }]},
+ { categorytitle=>'Automated Grading',
+ items =>[
+
{ linktext => 'Upload Scores',
url => $url2,
permission => 'F',
@@ -9746,168 +9431,132 @@ sub grading_menu {
{ linktext => 'Grade/Manage/Review Bubblesheets',
url => $url4,
permission => 'F',
- icon => 'stat.png',
+ icon => 'bubblesheet.png',
linktitle => 'Grade bubblesheet exams, upload/download bubblesheet data files, and review previously graded bubblesheet exams.'
- }
+ },
+ { linktext => 'Verify Receipt Number',
+ url => $url5,
+ permission => 'F',
+ icon => 'receipt_number.png',
+ linktitle => 'Verify a system-generated receipt number for correct problem solution.'
+ }
+
]
});
- #$fields{'command'} = 'verify';
- #$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- #
# Create the menu
my $Str;
- # $Str .= ''.&mt('Please select a grading task').' ';
$Str .= '';
$Str .= ' '.
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n";
-
- $Str .= Apache::lonhtmlcommon::generate_menu(@menu);
- #$menudata->{'jscript'}
- $Str .=' '.
- &Apache::lonnet::recprefix($env{'request.course.id'}).
- '- ';
+ ' '."\n";
- $Str .=" \n";
- my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box.");
- $request->print(<
- function checkChoice(formname,val,cmdx) {
- if (val <= 2) {
- var cmd = radioSelection(formname.radioChoice);
- var cmdsave = cmd;
- } else {
- cmd = cmdx;
- cmdsave = 'submission';
- }
- formname.command.value = cmd;
- if (val < 5) formname.submit();
- if (val == 5) {
- if (!checkReceiptNo(formname,'notOK')) {
- return false;
- } else {
- formname.submit();
- }
- }
- }
+ $Str .= &Apache::lonhtmlcommon::generate_menu(@menu);
+ return $Str;
+}
- function checkReceiptNo(formname,nospace) {
- var receiptNo = formname.receipt.value;
- var checkOpt = false;
- if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}
- if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}
- if (checkOpt) {
- alert("$receiptalert");
- formname.receipt.value = "";
- formname.receipt.focus();
- return false;
- }
- return true;
- }
-
-GRADINGMENUJS
+
+sub ungraded {
+ my ($request)=@_;
+ &submit_options($request);
+}
+
+sub submit_options_sequence {
+ my ($request,$symb) = @_;
+ if (!$symb) {return '';}
&commonJSfunctions($request);
- return $Str;
+ my $result;
+
+ $result.=''."\n".
+ ' '."\n";
+ $result.=&selectfield(0).
+ '
+
+
+
+
+ ';
+ return $result;
+}
+
+sub submit_options_table {
+ my ($request,$symb) = @_;
+ if (!$symb) {return '';}
+ &commonJSfunctions($request);
+ my $result;
+
+ $result.=''."\n".
+ ' '."\n";
+
+ $result.=&selectfield(0).
+ '
+
+
+
+
+ ';
+ return $result;
}
+sub submit_options_download {
+ my ($request,$symb) = @_;
+ if (!$symb) {return '';}
+
+ &commonJSfunctions($request);
+
+ my $result=''."\n".
+ ' '."\n";
+ $result.='
+
+ '.&mt('Select Students for Which to Download Submissions').'
+ '.&selectfield(1).'
+
+
+
+
+
+
+ ';
+ return $result;
+}
#--- Displays the submissions first page -------
sub submit_options {
- my ($request) = @_;
- my ($symb)=&get_symb($request);
+ my ($request,$symb) = @_;
if (!$symb) {return '';}
- my $probTitle = &Apache::lonnet::gettitle($symb);
- my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box.");
- $request->print(<
- function checkChoice(formname,val,cmdx) {
- if (val <= 2) {
- var cmd = radioSelection(formname.radioChoice);
- var cmdsave = cmd;
- } else {
- cmd = cmdx;
- cmdsave = 'submission';
- }
- formname.command.value = cmd;
- formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+
- ":saveSub="+pullDownSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status);
- if (val < 5) formname.submit();
- if (val == 5) {
- if (!checkReceiptNo(formname,'notOK')) { return false;}
- formname.submit();
- }
- if (val < 7) formname.submit();
- }
-
- function checkReceiptNo(formname,nospace) {
- var receiptNo = formname.receipt.value;
- var checkOpt = false;
- if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}
- if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}
- if (checkOpt) {
- alert("$receiptalert");
- formname.receipt.value = "";
- formname.receipt.focus();
- return false;
- }
- return true;
- }
-
-GRADINGMENUJS
&commonJSfunctions($request);
- my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle);
my $result;
- my (undef,$sections) = &getclasslist('all','0');
- my $savedState = &savedState();
- my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'submission' : $$savedState{'saveCmd'});
- my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'});
- my $saveSub = ($$savedState{'saveSub'} eq '' ? 'all' : $$savedState{'saveSub'});
- my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'});
-
- # Preselect sections
- my $selsec="";
- if (ref($sections)) {
- foreach my $section (sort(@$sections)) {
- $selsec.=''.$section.' '."\n";
- }
- }
$result.=''."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n".
- ' '."\n";
+ ' '."\n";
+ $result.=&selectfield(1).'
+
+
+
+
- $result.='
-
- '.&mt('Grade Current Resource').'
-
-
- '.$table.'
-
-
+ ';
+ return $result;
+}
+
+sub selectfield {
+ my ($full)=@_;
+ my %options =
+ (&Apache::lonlocal::texthash(
+ 'yes' => 'with submissions',
+ 'queued' => 'in grading queue',
+ 'graded' => 'with ungraded submissions',
+ 'incorrect' => 'with incorrect submissions',
+ 'all' => 'with any status'),
+ 'select_form_order' => ['yes','queued','graded','incorrect','all']);
+ my $result='
'.&mt('Sections').'
- '."\n";
- $result.= $selsec;
- $result.= 'all ';
- $result.='
+ '.&Apache::lonstatistics::SectionSelect('section','multiple',5).'
@@ -9921,76 +9570,21 @@ GRADINGMENUJS
'.&mt('Access Status').'
- '.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').'
-
-
+ '.&Apache::lonhtmlcommon::StatusOptions(undef,undef,5,undef,'mult').'
+ ';
+ if ($full) {
+ $result.='
'.&mt('Submission Status').'
-
-
- '.&mt('with submissions').'
- '.&mt('in grading queue').'
- '.&mt('with ungraded submissions').'
- '.&mt('with incorrect submissions').'
- '.&mt('with any status').'
-
-
-
-
-
-
-
-
-
-
- '.&mt('Grade Complete Folder for One Student').'
-
-
- ';
- $result .= &show_grading_menu_form($symb);
+ '.
+ &Apache::loncommon::select_form('all','submitonly',\%options).
+ '';
+ }
+ $result.='
';
return $result;
}
-sub substatus_options {
- return &Apache::lonlocal::texthash(
- 'yes' => 'with submissions',
- 'queued' => 'in grading queue',
- 'graded' => 'with ungraded submissions',
- 'incorrect' => 'with incorrect submissions',
- 'all' => 'with any status',
- );
-}
-
sub reset_perm {
undef(%perm);
}
@@ -10090,18 +9684,14 @@ sub clicker_grading_parameters {
}
sub process_clicker {
- my ($r)=@_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
my $result=&checkforfile_js();
- $env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
- my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
- $result.=$table;
- $result.=''."\n";
- $result.=''."\n";
- $result.=' '.&mt('Specify a file containing the clicker information for this resource.').
- ' '."\n";
- $result.=''."\n";
+ $result.=&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ ' '.&mt('Specify a file containing clicker information and set grading options.').' '.
+ &Apache::loncommon::end_data_table_header_row().
+ &Apache::loncommon::start_data_table_row()."\n";
# Attempt to restore parameters from last session, set defaults if not present
my %Saveable_Parameters=&clicker_grading_parameters();
&Apache::loncommon::restore_course_settings('grades_clicker',
@@ -10118,7 +9708,7 @@ sub process_clicker {
}
}
- my $upload=&mt("Upload File");
+ my $upload=&mt("Evaluate File");
my $type=&mt("Type");
my $attendance=&mt("Award points just for participation");
my $personnel=&mt("Correctness determined from response by course personnel");
@@ -10128,12 +9718,11 @@ sub process_clicker {
my $pcorrect=&mt("Percentage points for correct solution");
my $pincorrect=&mt("Percentage points for incorrect solution");
my $selectform=&Apache::loncommon::select_form($env{'form.upfiletype'},'upfiletype',
- {'iclicker' => 'i>clicker',
+ {'iclicker' => 'i>clicker',
'interwrite' => 'interwrite PRS',
'turning' => 'Turning Technologies'});
$symb = &Apache::lonenc::check_encrypt($symb);
- $result.=<
+ $result.= &Apache::lonhtmlcommon::scripttag(<
+ENDUPFORM
+ $result.= <
-
-
$type: $selectform
- $attendance
+ENDUPFORM
+ $result.=' '.&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row().''.(< $attendance
$personnel
$specific
@@ -10187,34 +9778,35 @@ function sanitycheck() {
-$pcorrect:
+ENDGRADINGFORM
+ $result.=' '.&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row().''.(<$pcorrect:
$pincorrect:
-
-ENDUPFORM
- $result.='
'."\n".
- '
'."\n";
- $result.=&show_grading_menu_form($symb);
+ '
+ENDPERCFORM
+ $result.=' '.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table();
return $result;
}
sub process_clicker_file {
- my ($r)=@_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
my %Saveable_Parameters=&clicker_grading_parameters();
&Apache::loncommon::store_course_settings('grades_clicker',
\%Saveable_Parameters);
-
- my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
+ my $result='';
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) {
$result.=''.&mt('You need to specify a clicker ID for the correct answer').' ';
- return $result.&show_grading_menu_form($symb);
+ return $result;
}
if (($env{'form.gradingmechanism'} eq 'given') && ($env{'form.givenanswer'}!~/\S/)) {
$result.=''.&mt('You need to specify the correct answer').' ';
- return $result.&show_grading_menu_form($symb);
+ return $result;
}
my $foundgiven=0;
if ($env{'form.gradingmechanism'} eq 'given') {
@@ -10263,7 +9855,7 @@ sub process_clicker_file {
$result .=
&Apache::lonhtmlcommon::confirm_success(
&mt('No IDs found to determine correct answer'),1);
- return $result,.&show_grading_menu_form($symb);
+ return $result;
}
}
if (length($env{'form.upfile'}) < 2) {
@@ -10271,23 +9863,22 @@ sub process_clicker_file {
&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.&show_grading_menu_form($symb);
+ return $result;
}
# Were able to get all the info needed, now analyze the file
$result.=&Apache::loncommon::studentbrowser_javascript();
$symb = &Apache::lonenc::check_encrypt($symb);
- my $heading=&mt('Scanning clicker file');
- $result.=(<
-
-$heading
+ $result.=&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ ' '.&mt('Evaluate clicker file').' '.
+ &Apache::loncommon::end_data_table_header_row().
+ &Apache::loncommon::start_data_table_row().(<
-
-
@@ -10315,7 +9906,7 @@ ENDHEADER
' ';
if (($env{'form.gradingmechanism'} eq 'given') && ($number!=$foundgiven)) {
$result.=''.&mt('Number of given answers does not agree with number of questions in file.').' ';
- return $result.&show_grading_menu_form($symb);
+ return $result;
}
# Remember Question Titles
# FIXME: Possibly need delimiter other than ":"
@@ -10335,7 +9926,9 @@ ENDHEADER
} elsif ($clicker_ids{$id}) {
if ($clicker_ids{$id}=~/\,/) {
# More than one user with the same clicker!
- $result.="\n ".&mt('Clicker registered more than once').": ".$id." ";
+ $result.="".&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row()."".
+ &mt('Clicker registered more than once').": ".$id." ";
$result.="\n".' '.
"";
foreach my $reguser (sort(split(/\,/,$clicker_ids{$id}))) {
@@ -10349,7 +9942,9 @@ ENDHEADER
$student_count++;
}
} else {
- $result.="\n ".&mt('Unregistered Clicker')." ".$id." ";
+ $result.=" ".&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row()."".
+ &mt('Unregistered Clicker')." ".$id." ";
$result.="\n".' '.
"\n".&mt("Username").": ".
"\n".&mt("Domain").": ".
@@ -10375,9 +9970,10 @@ ENDHEADER
} else {
$result.=' ';
}
- $result.='
'."\n".
- '
'."\n";
- return $result.&show_grading_menu_form($symb);
+ $result.=''.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table();
+ return $result;
}
sub iclicker_eval {
@@ -10464,9 +10060,9 @@ sub turning_eval {
return ($errormsg,$number);
}
+
sub assign_clicker_grades {
- my ($r)=@_;
- my ($symb)=&get_symb($r);
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
# See which part we are saving to
my $res_error;
@@ -10477,15 +10073,11 @@ sub assign_clicker_grades {
# FIXME: This should probably look for the first handgradeable part
my $part=$$partlist[0];
# Start screen output
- my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
-
- $result .= ' '.
- &Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_header_row().
- ''.&mt('Assigning grades based on clicker file').' '.
- &Apache::loncommon::end_data_table_header_row().
- &Apache::loncommon::start_data_table_row().'';
-
+ my $result=&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ ' '.&mt('Assigning grades based on clicker file').' '.
+ &Apache::loncommon::end_data_table_header_row().
+ &Apache::loncommon::start_data_table_row().'';
# Get correct result
# FIXME: Possibly need delimiter other than ":"
my @correct=();
@@ -10540,14 +10132,14 @@ sub assign_clicker_grades {
&mt('More than one entry found for [_1]!',''.$user.' ').
' ';
}
- $users{$user}=1;
+ $users{$user}=1;
my @answer=split(/\,/,$env{$key});
my $sum=0;
my $realnumber=$number;
for (my $i=0;$i<$number;$i++) {
if ($correct[$i] eq '-') {
$realnumber--;
- } elsif ($answer[$i]) {
+ } elsif (($answer[$i]) || ($answer[$i]=~/^[0\.]+$/)) {
if ($gradingmechanism eq 'attendance') {
$sum+=$pcorrect;
} elsif ($correct[$i] eq '*') {
@@ -10594,8 +10186,8 @@ sub assign_clicker_grades {
$result.=' '.&mt('Successfully stored grades for [quant,_1,student].',$storecount).
' '.
&Apache::loncommon::end_data_table_row().
- &Apache::loncommon::end_data_table()." \n";
- return $result.&show_grading_menu_form($symb);
+ &Apache::loncommon::end_data_table();
+ return $result;
}
sub navmap_errormsg {
@@ -10606,26 +10198,28 @@ sub navmap_errormsg {
}
sub startpage {
- my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag,$stuvcurrent,$stuvdisp,$nomenu,$js,$onload) = @_;
- my %args;
- if ($onload) {
- my %loaditems = (
- 'onload' => $onload,
- );
- $args{'add_entries'} = \%loaditems;
- }
+ my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag,$stuvcurrent,$stuvdisp,$nomenu,$js) = @_;
if ($nomenu) {
- $args{'only_body'} = 1;
- $r->print(&Apache::loncommon::start_page("Student's Version",$js,\%args));
+ $r->print(&Apache::loncommon::start_page("Student's Version",$js,{'only_body' => '1'}));
} else {
- $args{'bread_crumbs'} = $crumbs;
- $r->print(&Apache::loncommon::start_page('Grading',$js,\%args));
+ 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,$stuvcurrent,$stuvdisp));
}
}
+sub select_problem {
+ my ($r)=@_;
+ $r->print(''.&mt('Select the problem or one of the problems you want to grade').' ');
+ $r->print(&Apache::lonstathelpers::problem_selector('.',undef,1));
+ $r->print(' ');
+ $r->print(' ');
+}
+
sub handler {
my $request=$_[0];
&reset_caches();
@@ -10636,82 +10230,47 @@ sub handler {
}
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
- my $symb=&get_symb($request,1);
+# see what command we need to execute
+
my @commands=&Apache::loncommon::get_env_multiple('form.command');
my $command=$commands[0];
+ &init_perm();
+ if (!$env{'request.course.id'}) {
+ unless ((&Apache::lonnet::allowed('usc',$env{'request.role.domain'})) &&
+ ($command =~ /^scantronupload/)) {
+ # Not in a course.
+ $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context";
+ return HTTP_NOT_ACCEPTABLE;
+ }
+ } elsif (!%perm) {
+ $request->internal_redirect('/adm/quickgrades');
+ return OK;
+ }
+ &Apache::loncommon::content_type($request,'text/html');
+ $request->send_http_header;
+
if ($#commands > 0) {
&Apache::lonnet::logthis("grades got multiple commands ".join(':',@commands));
}
+# see what the symb is
+
+ my $symb=$env{'form.symb'};
+ unless ($symb) {
+ (my $url=$env{'form.url'}) =~ s-^https*://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ $symb=&Apache::lonnet::symbread($url);
+ }
+ &Apache::lonenc::check_decrypt(\$symb);
+
$ssi_error = 0;
- my $brcrum = [{href=>"/adm/grades",text=>"Grading"}];
- my $start_page = &Apache::loncommon::start_page('Grading',undef,
- {'bread_crumbs' => $brcrum});
- if ($symb eq '' && $command eq '') {
- if ($env{'user.adv'}) {
- &Apache::loncommon::content_type($request,'text/html');
- $request->send_http_header;
- $request->print($start_page);
- if (($env{'form.codeone'}) && ($env{'form.codetwo'}) &&
- ($env{'form.codethree'})) {
- my $token=$env{'form.codeone'}.'*'.$env{'form.codetwo'}.'*'.
- $env{'form.codethree'};
- my ($tsymb,$tuname,$tudom,$tcrsid)=
- &Apache::lonnet::checkin($token);
- if ($tsymb) {
- my ($map,$id,$url)=&Apache::lonnet::decode_symb($tsymb);
- if (&Apache::lonnet::allowed('mgr',$tcrsid)) {
- $request->print(&ssi_with_retries('/res/'.$url, $ssi_retries,
- ('grade_username' => $tuname,
- 'grade_domain' => $tudom,
- 'grade_courseid' => $tcrsid,
- 'grade_symb' => $tsymb)));
- } else {
- $request->print('Not authorized: '.$token.' ');
- }
- } else {
- $request->print('Not a valid DocID: '.$token.' ');
- }
- } else {
- $request->print(&Apache::lonxml::tokeninputfield());
- }
- } elsif ($env{'request.course.id'}) {
- &init_perm();
- if (!%perm) {
- $request->internal_redirect('/adm/quickgrades');
- return OK;
- } else {
- &Apache::loncommon::content_type($request,'text/html');
- $request->send_http_header;
- $request->print($start_page);
- }
- }
+ if (($symb eq '' || $command eq '') && ($env{'request.course.id'})) {
+#
+# Not called from a resource, but inside a course
+#
+ &startpage($request,undef,[],1,1);
+ &select_problem($request);
} else {
- &init_perm();
- if (!$env{'request.course.id'}) {
- unless ((&Apache::lonnet::allowed('usc',$env{'request.role.domain'})) &&
- ($command =~ /^scantronupload/)) {
- # Not in a course.
- $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context";
- return HTTP_NOT_ACCEPTABLE;
- }
- } elsif (!%perm) {
- $request->internal_redirect('/adm/quickgrades');
- }
- &Apache::loncommon::content_type($request,'text/html');
- $request->send_http_header;
- if (($command eq 'scantron_selectphase' && $perm{'mgr'}) ||
- (($command eq 'scantronupload') &&
- (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
- &Apache::lonnet::allowed('usc',$env{'request.course.id'})))) {
- &startpage($request,$symb,[{href=>'/adm/grades', text=>"Grading"}],1,1,
- undef,undef,undef,undef,'toggleScantab(document.rules);');
- } else {
- unless ((($command eq 'submission' || $command eq 'versionsub')) && ($perm{'vgr'})) {
- $request->print($start_page);
- }
- }
if ($command eq 'submission' && $perm{'vgr'}) {
my ($stuvcurrent,$stuvdisp,$versionform,$js);
if (($env{'form.student'} ne '') && ($env{'form.userdom'} ne '')) {
@@ -10724,7 +10283,7 @@ sub handler {
$request->print($versionform);
}
$request->print(' ');
- ($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
+ ($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'},
@@ -10737,79 +10296,147 @@ sub handler {
$request->print(' ');
$request->print(&show_previous_task_version($request,$symb));
} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
- &pickStudentPage($request);
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,'all_for_one'),text=>'Grade page/folder for one student'},
+ {href=>'',text=>'Select student'}],1,1);
+ &pickStudentPage($request,$symb);
} elsif ($command eq 'displayPage' && $perm{'vgr'}) {
- &displayPage($request);
+ &startpage($request,$symb,
+ [{href=>&href_symb_cmd($symb,'all_for_one'),text=>'Grade page/folder for one student'},
+ {href=>'',text=>'Select student'},
+ {href=>'',text=>'Grade student'}],1,1);
+ &displayPage($request,$symb);
} elsif ($command eq 'gradeByPage' && $perm{'mgr'}) {
- &updateGradeByPage($request);
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,'all_for_one'),text=>'Grade page/folder for one student'},
+ {href=>'',text=>'Select student'},
+ {href=>'',text=>'Grade student'},
+ {href=>'',text=>'Store grades'}],1,1);
+ &updateGradeByPage($request,$symb);
} elsif ($command eq 'processGroup' && $perm{'vgr'}) {
- &processGroup($request);
+ &startpage($request,$symb,[{href=>'',text=>'...'},
+ {href=>'',text=>'Modify grades'}]);
+ &processGroup($request,$symb);
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) {
- $request->print(&grading_menu($request));
- } elsif ($command eq 'submit_options' && $perm{'vgr'}) {
- $request->print(&submit_options($request));
+ &startpage($request,$symb);
+ $request->print(&grading_menu($request,$symb));
+ } elsif ($command eq 'individual' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>'',text=>'Select individual students to grade'}]);
+ $request->print(&submit_options($request,$symb));
+ } elsif ($command eq 'ungraded' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>'',text=>'Grade ungraded submissions'}]);
+ $request->print(&listStudents($request,$symb,'graded'));
+ } elsif ($command eq 'table' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>"", text=>"Grading table"}]);
+ $request->print(&submit_options_table($request,$symb));
+ } elsif ($command eq 'all_for_one' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>'',text=>'Grade page/folder for one student'}],1,1);
+ $request->print(&submit_options_sequence($request,$symb));
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) {
- $request->print(&viewgrades($request));
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,"table"), text=>"Grading table"},{href=>'', text=>"Modify grades"}]);
+ $request->print(&viewgrades($request,$symb));
} elsif ($command eq 'handgrade' && $perm{'mgr'}) {
- $request->print(&processHandGrade($request));
+ &startpage($request,$symb,[{href=>'',text=>'...'},
+ {href=>'',text=>'Store grades'}]);
+ $request->print(&processHandGrade($request,$symb));
} elsif ($command eq 'editgrades' && $perm{'mgr'}) {
- $request->print(&editgrades($request));
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,"table"), text=>"Grading table"},
+ {href=>&href_symb_cmd($symb,'viewgrades').'&group=all§ion=all&Status=Active',
+ text=>"Modify grades"},
+ {href=>'', text=>"Store grades"}]);
+ $request->print(&editgrades($request,$symb));
+ } elsif ($command eq 'initialverifyreceipt' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>'',text=>'Verify Receipt Number'}]);
+ $request->print(&initialverifyreceipt($request,$symb));
} elsif ($command eq 'verify' && $perm{'vgr'}) {
- $request->print(&verifyreceipt($request));
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,"initialverifyreceipt"),text=>'Verify Receipt Number'},
+ {href=>'',text=>'Verification Result'}]);
+ $request->print(&verifyreceipt($request,$symb));
} elsif ($command eq 'processclicker' && $perm{'mgr'}) {
- $request->print(&process_clicker($request));
+ &startpage($request,$symb,[{href=>'', text=>'Process clicker'}]);
+ $request->print(&process_clicker($request,$symb));
} elsif ($command eq 'processclickerfile' && $perm{'mgr'}) {
- $request->print(&process_clicker_file($request));
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,'processclicker'), text=>'Process clicker'},
+ {href=>'', text=>'Process clicker file'}]);
+ $request->print(&process_clicker_file($request,$symb));
} elsif ($command eq 'assignclickergrades' && $perm{'mgr'}) {
- $request->print(&assign_clicker_grades($request));
+ &startpage($request,$symb,[{href=>&href_symb_cmd($symb,'processclicker'), text=>'Process clicker'},
+ {href=>'', text=>'Process clicker file'},
+ {href=>'', text=>'Store grades'}]);
+ $request->print(&assign_clicker_grades($request,$symb));
} elsif ($command eq 'csvform' && $perm{'mgr'}) {
- $request->print(&upcsvScores_form($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&upcsvScores_form($request,$symb));
} elsif ($command eq 'csvupload' && $perm{'mgr'}) {
- $request->print(&csvupload($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&csvupload($request,$symb));
} elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) {
- $request->print(&csvuploadmap($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&csvuploadmap($request,$symb));
} elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) {
if ($env{'form.associate'} ne 'Reverse Association') {
- $request->print(&csvuploadoptions($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&csvuploadoptions($request,$symb));
} else {
if ( $env{'form.upfile_associate'} ne 'reverse' ) {
$env{'form.upfile_associate'} = 'reverse';
} else {
$env{'form.upfile_associate'} = 'forward';
}
- $request->print(&csvuploadmap($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&csvuploadmap($request,$symb));
}
} elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) {
- $request->print(&csvuploadassign($request));
+ &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
+ $request->print(&csvuploadassign($request,$symb));
} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
- $request->print(&scantron_selectphase($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_selectphase($request,undef,$symb));
} elsif ($command eq 'scantron_warning' && $perm{'mgr'}) {
- $request->print(&scantron_do_warning($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_do_warning($request,$symb));
} elsif ($command eq 'scantron_validate' && $perm{'mgr'}) {
- $request->print(&scantron_validate_file($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_validate_file($request,$symb));
} elsif ($command eq 'scantron_process' && $perm{'mgr'}) {
- $request->print(&scantron_process_students($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_process_students($request,$symb));
} elsif ($command eq 'scantronupload' &&
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
- $request->print(&scantron_upload_scantron_data($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_upload_scantron_data($request,$symb));
} elsif ($command eq 'scantronupload_save' &&
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
- $request->print(&scantron_upload_scantron_data_save($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_upload_scantron_data_save($request,$symb));
} elsif ($command eq 'scantron_download' &&
&Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
- $request->print(&scantron_download_scantron_data($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&scantron_download_scantron_data($request,$symb));
} elsif ($command eq 'checksubmissions' && $perm{'vgr'}) {
- $request->print(&checkscantron_results($request));
+ &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+ $request->print(&checkscantron_results($request,$symb));
+ } elsif ($command eq 'downloadfilesselect' && $perm{'vgr'}) {
+ &startpage($request,$symb,[{href=>'', text=>'Select which submissions to download'}]);
+ $request->print(&submit_options_download($request,$symb));
+ } elsif ($command eq 'downloadfileslink' && $perm{'vgr'}) {
+ &startpage($request,$symb,
+ [{href=>&href_symb_cmd($symb,'downloadfilesselect'), text=>'Select which submissions to download'},
+ {href=>'', text=>'Download submissions'}]);
+ &submit_download_link($request,$symb);
} elsif ($command) {
+ &startpage($request,$symb,[{href=>'', text=>'Access denied'}]);
$request->print(''.&mt('Access Denied ([_1])',$command).'
');
}
}
if ($ssi_error) {
&ssi_print_error($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;
}
@@ -10833,7 +10460,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).
@@ -10880,6 +10507,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
@@ -10889,7 +10585,7 @@ ssi_with_retries()
$r - Apache request object
$i - number of the current scanline
$scan_record - hash ref as returned from &scantron_parse_scanline()
- $scan_config - hash ref as returned from &Apache::lonnet::get_scantron_config()
+ $scan_config - hash ref as returned from &get_scantron_config()
$line - full contents of the current scanline
$error - error condition, valid values are
'incorrectCODE', 'duplicateCODE',
@@ -10916,6 +10612,7 @@ ssi_with_retries()
or code-based randompick and/or randomorder.
+
=item scantron_get_maxbubble() :
Arguments:
@@ -10995,7 +10692,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