symb();
@@ -435,14 +301,7 @@ sub reset_caches {
if ($check_for_randomlist) {
$add_to_form = { 'check_parts_withrandomlist' => 1,};
}
- if ($scancode) {
- if (ref($add_to_form) eq 'HASH') {
- $add_to_form->{'code_for_randomlist'} = $scancode;
- } else {
- $add_to_form = { 'code_for_randomlist' => $scancode,};
- }
- }
- my $analyze =
+ my $analyze =
&get_analyze($symb,$uname,$udom,undef,$add_to_form,
undef,undef,undef,$bubbles_per_row);
if (ref($analyze) eq 'HASH') {
@@ -471,8 +330,6 @@ sub cleanRecord {
my $grayFont = '';
if ($response =~ /^(option|rank)$/) {
my %answer=&Apache::lonnet::str2hash($answer);
- my @answer = %answer;
- %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my %grading=&Apache::lonnet::str2hash($record->{$version."resource.$partid.$respid.submissiongrading"});
my ($toprow,$bottomrow);
foreach my $foil (@$order) {
@@ -489,8 +346,6 @@ sub cleanRecord {
$bottomrow.'';
} elsif ($response eq 'match') {
my %answer=&Apache::lonnet::str2hash($answer);
- my @answer = %answer;
- %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my %grading=&Apache::lonnet::str2hash($record->{$version."resource.$partid.$respid.submissiongrading"});
my @items=&Apache::lonnet::str2array($record->{$version."resource.$partid.$respid.submissionitems"});
my ($toprow,$middlerow,$bottomrow);
@@ -513,8 +368,6 @@ sub cleanRecord {
$bottomrow.'';
} elsif ($response eq 'radiobutton') {
my %answer=&Apache::lonnet::str2hash($answer);
- my @answer = %answer;
- %answer = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my ($toprow,$bottomrow);
my $correct =
&get_radiobutton_correct_foil($partid,$respid,$symb,$uname,$udom,$type,$trial,$rndseed);
@@ -547,11 +400,10 @@ sub cleanRecord {
$env{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
$env{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob.
}
- $answer = &Apache::lontexconvert::msgtexconverted($answer);
+ $answer =~ s-\n- -g;
return ''.&keywords_highlight($answer).' ';
} elsif ( $response eq 'organic') {
- my $result=&mt('Smile representation: [_1]',
- '"'.&HTML::Entities::encode($answer, '"<>&').' "');
+ my $result='Smile representation: "'.$answer.' "';
my $jme=$record->{$version."resource.$partid.$respid.molecule"};
$result.=&Apache::chemresponse::jme_img($jme,$answer,400);
return $result;
@@ -586,13 +438,12 @@ sub cleanRecord {
return $result;
}
} elsif ( $response =~ m/(?:numerical|formula|custom)/) {
- # Respect multiple input fields, see Bug #5409
+ # Respect multiple input fields, see Bug #5409
$answer =
&Apache::loncommon::format_previous_attempt_value('submission',
$answer);
- return $answer;
}
- return &HTML::Entities::encode($answer, '"<>&');
+ return $answer;
}
#-- A couple of common js functions
@@ -632,7 +483,7 @@ COMMONJSFUNCTIONS
#--- Dumps the class list with usernames,list of sections,
#--- section, ids and fullnames for each user.
sub getclasslist {
- my ($getsec,$filterbyaccstatus,$getgroup,$symb,$submitonly,$filterbysubmstatus) = @_;
+ my ($getsec,$filterlist,$getgroup) = @_;
my @getsec;
my @getgroup;
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
@@ -660,13 +511,6 @@ sub getclasslist {
#
my %sections;
my %fullnames;
- my ($cdom,$cnum,$partlist);
- if (($filterbysubmstatus) && ($submitonly ne 'all') && ($symb ne '')) {
- $cdom = $env{"course.$env{'request.course.id'}.domain"};
- $cnum = $env{"course.$env{'request.course.id'}.num"};
- my $res_error;
- ($partlist) = &response_type($symb,\$res_error);
- }
foreach my $student (keys(%$classlist)) {
my $end =
$classlist->{$student}->[&Apache::loncoursedata::CL_END()];
@@ -683,7 +527,7 @@ sub getclasslist {
my $group =
$classlist->{$student}->[&Apache::loncoursedata::CL_GROUP()];
# filter students according to status selected
- if ($filterbyaccstatus && (!($stu_status =~ /Any/))) {
+ if ($filterlist && (!($stu_status =~ /Any/))) {
if (!($stu_status =~ $status)) {
delete($classlist->{$student});
next;
@@ -700,58 +544,13 @@ sub getclasslist {
}
}
if (($grp eq 'none') && !$group) {
- $exclude = 0;
+ $exclude = 0;
}
}
if ($exclude) {
delete($classlist->{$student});
- next;
}
}
- if (($filterbysubmstatus) && ($submitonly ne 'all') && ($symb ne '')) {
- my $udom =
- $classlist->{$student}->[&Apache::loncoursedata::CL_SDOM()];
- my $uname =
- $classlist->{$student}->[&Apache::loncoursedata::CL_SNAME()];
- if (($symb ne '') && ($udom ne '') && ($uname ne '')) {
- if ($submitonly eq 'queued') {
- my %queue_status =
- &Apache::bridgetask::get_student_status($symb,$cdom,$cnum,
- $udom,$uname);
- if (!defined($queue_status{'gradingqueue'})) {
- delete($classlist->{$student});
- next;
- }
- } else {
- my (%status) =&student_gradeStatus($symb,$udom,$uname,$partlist);
- my $submitted = 0;
- my $graded = 0;
- my $incorrect = 0;
- foreach (keys(%status)) {
- $submitted = 1 if ($status{$_} ne 'nothing');
- $graded = 1 if ($status{$_} =~ /^ungraded/);
- $incorrect = 1 if ($status{$_} =~ /^incorrect/);
-
- my ($foo,$partid,$foo1) = split(/\./,$_);
- if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
- $submitted = 0;
- }
- }
- if (!$submitted && ($submitonly eq 'yes' ||
- $submitonly eq 'incorrect' ||
- $submitonly eq 'graded')) {
- delete($classlist->{$student});
- next;
- } elsif (!$graded && ($submitonly eq 'graded')) {
- delete($classlist->{$student});
- next;
- } elsif (!$incorrect && $submitonly eq 'incorrect') {
- delete($classlist->{$student});
- next;
- }
- }
- }
- }
$section = ($section ne '' ? $section : 'none');
if (&canview($section)) {
if (!@getsec || grep(/^\Q$section\E$/,@getsec)) {
@@ -766,6 +565,7 @@ sub getclasslist {
delete($classlist->{$student});
}
}
+ my %seen = ();
my @sections = sort(keys(%sections));
return ($classlist,\@sections,\%fullnames);
}
@@ -781,7 +581,7 @@ sub canmodify {
#can modify the requested section
return 1;
} else {
- # can't modify the requested section
+ # can't modify the request section
return 0;
}
}
@@ -794,19 +594,19 @@ sub canview {
my ($sec)=@_;
if ($perm{'vgr'}) {
if (!defined($perm{'vgr_section'})) {
- # can view whole class
+ # can modify whole class
return 1;
} else {
if ($sec eq $perm{'vgr_section'}) {
- #can view the requested section
+ #can modify the requested section
return 1;
} else {
- # can't view the requested section
+ # can't modify the request section
return 0;
}
}
}
- #can't view
+ #can't modify
return 0;
}
@@ -947,14 +747,14 @@ sub initialverifyreceipt {
#--- Check whether a receipt number is valid.---
sub verifyreceipt {
- my ($request,$symb) = @_;
+ my ($request,$symb) = @_;
my $courseid = $env{'request.course.id'};
my $receipt = &Apache::lonnet::recprefix($courseid).'-'.
$env{'form.receipt'};
$receipt =~ s/[^\-\d]//g;
- my $title =
+ my $title.=
''.
&mt('Verifying Receipt Number [_1]',$receipt).
' '."\n";
@@ -1035,36 +835,24 @@ sub verifyreceipt {
#--- Also called directly when one clicks on the subm button
# on the problem page.
sub listStudents {
- my ($request,$symb,$submitonly,$divforres) = @_;
+ my ($request,$symb,$submitonly) = @_;
my $cdom = $env{"course.$env{'request.course.id'}.domain"};
my $cnum = $env{"course.$env{'request.course.id'}.num"};
my $getsec = $env{'form.section'} eq '' ? 'all' : $env{'form.section'};
my $getgroup = $env{'form.group'} eq '' ? 'all' : $env{'form.group'};
unless ($submitonly) {
- $submitonly = $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
+ $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
}
my $result='';
my $res_error;
- my ($partlist,$handgrade,$responseType,$numresp,$numessay) = &response_type($symb,\$res_error);
-
- my $table;
- if (ref($partlist) eq 'ARRAY') {
- if (scalar(@$partlist) > 1 ) {
- $table = &showResourceInfo($symb,$partlist,$responseType,'gradesub',1);
- } elsif ($divforres) {
- $table = '
';
- } else {
- $table = ' ';
- }
- }
+ my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error);
- my %js_lt = &Apache::lonlocal::texthash (
+ my %lt = &Apache::lonlocal::texthash (
'multiple' => 'Please select a student or group of students before clicking on the Next button.',
'single' => 'Please select the student before clicking on the Next button.',
);
- &js_escape(\%js_lt);
$request->print(&Apache::lonhtmlcommon::scripttag(<print($result);
my $gradeTable=' '."\n".
''.
' '.
- $optiontext{'last'}.' '."\n".
+ &mt('last submission with details').' '."\n".
''.
' '.
- $optiontext{'datesub'}.' '."\n".
+ &mt('all submissions').''."\n".
''.
' '.
- $optiontext{'all'}.' ';
- my ($compmsg,$nocompmsg);
- $nocompmsg = ' checked="checked"';
- if ($numessay) {
- $compmsg = $nocompmsg;
- $nocompmsg = '';
- }
- $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Submissions'))
- .$submission_options;
-# Check if any gradable
- my $showmore;
- if ($perm{'mgr'}) {
- my @sections;
- if ($env{'request.course.sec'} ne '') {
- @sections = ($env{'request.course.sec'});
- } elsif ($env{'form.section'} eq '') {
- @sections = ('all');
- } else {
- @sections = &Apache::loncommon::get_env_multiple('form.section');
- }
- if (grep(/^all$/,@sections)) {
- $showmore = 1;
- } else {
- foreach my $sec (@sections) {
- if (&canmodify($sec)) {
- $showmore = 1;
- last;
- }
- }
- }
- }
-
- if ($showmore) {
- $gradeTable .=
- &Apache::lonhtmlcommon::row_closure()
- .&Apache::lonhtmlcommon::row_title(&mt('Send Messages'))
- .''
- .' '
- .&mt('No').(' 'x2).' '
- .' '
- .&mt('Yes').(' 'x2).' '
+ &mt('all submissions with details').' ';
+ $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('View Submissions'))
+ .$submission_options
.&Apache::lonhtmlcommon::row_closure();
- $gradeTable .=
- &Apache::lonhtmlcommon::row_title(&mt('Grading Increments'))
+ $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Grading Increments'))
.''
.''.&mt('Whole Points').' '
.''.&mt('Half Points').' '
.''.&mt('Quarter Points').' '
.''.&mt('Tenths of a Point').' '
- .' ';
- }
+ .''
+ .&Apache::lonhtmlcommon::row_closure();
+
$gradeTable .=
&build_section_inputs().
' '."\n".
' '."\n".
' '."\n";
+
if (exists($env{'form.Status'})) {
- $gradeTable .= ' '."\n";
+ $gradeTable .= ' '."\n";
} else {
- $gradeTable .= &Apache::lonhtmlcommon::row_closure()
- .&Apache::lonhtmlcommon::row_title(&mt('Student Status'))
+ $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Student Status'))
.&Apache::lonhtmlcommon::StatusOptions(
- $saveStatus,undef,1,'javascript:reLoadList(this.form);');
+ $saveStatus,undef,1,'javascript:reLoadList(this.form);')
+ .&Apache::lonhtmlcommon::row_closure();
}
- if ($numessay) {
- $gradeTable .= &Apache::lonhtmlcommon::row_closure()
- .&Apache::lonhtmlcommon::row_title(&mt('Check For Plagiarism'))
- .' ';
- }
- $gradeTable .= &Apache::lonhtmlcommon::row_closure(1)
+
+ $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Check For Plagiarism'))
+ .' '
+ .&Apache::lonhtmlcommon::row_closure(1)
.&Apache::lonhtmlcommon::end_pick_box();
$gradeTable .= ''
@@ -1355,8 +1099,8 @@ LISTJAVASCRIPT
#---- Called from the listStudents routine
sub check_script {
- my ($form,$type) = @_;
- my $chkallscript = &Apache::lonhtmlcommon::scripttag('
+ my ($form, $type)=@_;
+ my $chkallscript= &Apache::lonhtmlcommon::scripttag('
function checkall() {
for (i=0; i
INNERJS
- my $start_page_msg_central =
+ my $inner_js_highlight_central= (<
+ function updateChoice(flag) {
+ opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr);
+ opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize);
+ opener.document.SCORE.kwstyle.value = opener.radioSelection(document.hlCenter.kwdstyle);
+ opener.document.SCORE.refresh.value = "on";
+ if (opener.document.SCORE.keywords.value!=""){
+ opener.document.SCORE.submit();
+ }
+ self.close()
+ }
+
+INNERJS
+
+ my $start_page_msg_central =
&Apache::loncommon::start_page('Message Central',$inner_js_msg_central,
{'js_ready' => 1,
'only_body' => 1,
'bgcolor' =>'#FFFFFF',});
- my $end_page_msg_central =
+ my $end_page_msg_central =
&Apache::loncommon::end_page({'js_ready' => 1});
+ my $start_page_highlight_central =
+ &Apache::loncommon::start_page('Highlight Central',
+ $inner_js_highlight_central,
+ {'js_ready' => 1,
+ 'only_body' => 1,
+ 'bgcolor' =>'#FFFFFF',});
+ my $end_page_highlight_central =
+ &Apache::loncommon::end_page({'js_ready' => 1});
+
my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
$docopen=~s/^document\.//;
-
- my %html_js_lt = &Apache::lonlocal::texthash(
+ my %lt = &Apache::lonlocal::texthash(
+ keyw => 'Keywords list, separated by a space. Add/delete to list if desired.',
+ plse => 'Please select a word or group of words from document and then click this link.',
+ adds => 'Add selection to keyword list? Edit if desired.',
comp => 'Compose Message for: ',
incl => 'Include',
type => 'Type',
@@ -1657,11 +1428,35 @@ INNERJS
new => 'New',
save => 'Save',
canc => 'Cancel',
+ kehi => 'Keyword Highlight Options',
+ txtc => 'Text Color',
+ font => 'Font Size',
+ fnst => 'Font Style',
+ col1 => 'red',
+ col2 => 'green',
+ col3 => 'blue',
+ siz1 => 'normal',
+ siz2 => '+1',
+ siz3 => '+2',
+ sty1 => 'normal',
+ sty2 => 'italic',
+ sty3 => 'bold',
);
- &html_escape(\%html_js_lt);
- &js_escape(\%html_js_lt);
$request->print(&Apache::lonhtmlcommon::scripttag(<");
pDoc.write(" ");
- pDoc.write(" $html_js_lt{'comp'}\"+fullname+\"<\\/h1>");
+ pDoc.write(" $lt{'comp'}\"+fullname+\"<\\/h1>");
pDoc.write(' ');
- pDoc.write("$html_js_lt{'incl'}<\\/b><\\/td> $html_js_lt{'type'}<\\/b><\\/td> $html_js_lt{'mesa'}<\\/td><\\/tr>");
+ pDoc.write(" $lt{'incl'}<\\/b><\\/td> $lt{'type'}<\\/b><\\/td> $lt{'mesa'}<\\/td><\\/tr>");
}
function displaySubject(msg,shwsel) {
pDoc = pWin.document;
pDoc.write("");
pDoc.write(" <\\/td>");
- pDoc.write("$html_js_lt{'subj'}<\\/td>");
+ pDoc.write(" $lt{'subj'}<\\/td>");
pDoc.write(" <\\/td><\\/tr>");
}
@@ -1766,121 +1581,21 @@ INNERJS
pDoc = pWin.document;
pDoc.write(" ");
pDoc.write(" <\\/td>");
- pDoc.write("$html_js_lt{'new'}<\\/td>");
+ pDoc.write(" $lt{'new'}<\\/td>");
pDoc.write(" '."\n".
''."\n".
-''.&mt('Submissions').' '.$showrecord.' '."\n";
+' Submissions '.$showrecord.' '."\n";
$passed ++;
} else {
my $css_class = ($failed % 2)?'LC_odd_row':'LC_even_row';
$badstudents .= ''.&mt('Bubblesheet').' '.$scandata{$pid}.' '.$last.' '.$pid.' '."\n".
' '."\n".
''."\n".
-''.&mt('Submissions').' '.$record{$pid}.' '."\n".
+'Submissions '.$record{$pid}.' '."\n".
' '."\n";
$failed ++;
}
@@ -9828,19 +9087,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".
@@ -9986,6 +9247,23 @@ 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 -------
#
#-------------------------------------------------------------------
@@ -10005,7 +9283,7 @@ sub grading_menu {
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb),
'command'=>'individual');
-
+
my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
$fields{'command'}='ungraded';
@@ -10019,7 +9297,7 @@ sub grading_menu {
$fields{'command'}='downloadfilesselect';
my $url1e=&Apache::lonhtmlcommon::build_url('grades/',\%fields);
-
+
$fields{'command'} = 'csvform';
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
@@ -10031,74 +9309,64 @@ sub grading_menu {
$fields{'command'} = 'initialverifyreceipt';
my $url5 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
-
- my %permissions;
- if ($perm{'mgr'}) {
- $permissions{'either'} = 'F';
- $permissions{'mgr'} = 'F';
- }
- if ($perm{'vgr'}) {
- $permissions{'either'} = 'F';
- $permissions{'vgr'} = 'F';
- }
-
+
my @menu = ({ categorytitle=>'Hand Grading',
items =>[
- { linktext => 'Select individual students to grade',
- url => $url1a,
- permission => $permissions{'either'},
- icon => 'grade_students.png',
- linktitle => 'Grade current resource for a selection of students.'
- },
- { linktext => 'Grade ungraded submissions',
+ { linktext => 'Select individual students to grade',
+ url => $url1a,
+ permission => 'F',
+ icon => 'grade_students.png',
+ linktitle => 'Grade current resource for a selection of students.'
+ },
+ { linktext => 'Grade ungraded submissions.',
url => $url1b,
- permission => $permissions{'either'},
+ permission => 'F',
icon => 'ungrade_sub.png',
linktitle => 'Grade all submissions that have not been graded yet.'
},
{ linktext => 'Grading table',
url => $url1c,
- permission => $permissions{'either'},
+ permission => 'F',
icon => 'grading_table.png',
linktitle => 'Grade current resource for all students.'
},
{ linktext => 'Grade page/folder for one student',
url => $url1d,
- permission => $permissions{'either'},
+ permission => 'F',
icon => 'grade_PageFolder.png',
linktitle => 'Grade all resources in current page/sequence/folder for one student.'
},
- { linktext => 'Download submitted files',
+ { linktext => 'Download submissions',
url => $url1e,
- permission => $permissions{'either'},
+ permission => 'F',
icon => 'download_sub.png',
- linktitle => 'Download all files submitted by students.'
+ linktitle => 'Download all students submissions.'
}]},
{ categorytitle=>'Automated Grading',
items =>[
{ linktext => 'Upload Scores',
url => $url2,
- permission => $permissions{'mgr'},
+ permission => 'F',
icon => 'uploadscores.png',
linktitle => 'Specify a file containing the class scores for current resource.'
},
{ linktext => 'Process Clicker',
url => $url3,
- permission => $permissions{'mgr'},
+ permission => 'F',
icon => 'addClickerInfoFile.png',
linktitle => 'Specify a file containing the clicker information for this resource.'
},
{ linktext => 'Grade/Manage/Review Bubblesheets',
url => $url4,
- permission => $permissions{'mgr'},
+ permission => 'F',
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 => $permissions{'either'},
+ permission => 'F',
icon => 'receipt_number.png',
linktitle => 'Verify a system-generated receipt number for correct problem solution.'
}
@@ -10116,6 +9384,7 @@ sub grading_menu {
return $Str;
}
+
sub ungraded {
my ($request)=@_;
&submit_options($request);
@@ -10148,7 +9417,7 @@ sub submit_options_table {
$result.=''."\n".
' '."\n";
- $result.=&selectfield(1).
+ $result.=&selectfield(0).
'
@@ -10162,34 +9431,15 @@ sub submit_options_download {
my ($request,$symb) = @_;
if (!$symb) {return '';}
- my $res_error;
- my ($partlist,$handgrade,$responseType,$numresp,$numessay,$numdropbox) =
- &response_type($symb,\$res_error);
- if ($res_error) {
- $request->print(&mt('An error occurred retrieving response types'));
- return;
- }
- unless ($numessay) {
- $request->print(&mt('No essayresponse items found'));
- return;
- }
- my $table;
- if (ref($partlist) eq 'ARRAY') {
- if (scalar(@$partlist) > 1 ) {
- $table = &showResourceInfo($symb,$partlist,$responseType,'gradingMenu',1,1);
- }
- }
-
&commonJSfunctions($request);
my $result='
'."\n".
- $table."\n".
- ' '."\n";
+ ' '."\n";
$result.='
- '.&mt('Select Students for whom to Download Submitted Files').'
+ '.&mt('Select Students for Which to Download Submissions').'
'.&selectfield(1).'
-
+
@@ -10210,43 +9460,42 @@ sub submit_options {
$result.=''."\n".
' '."\n";
$result.=&selectfield(1).'
-
-
+
+
+
+
';
return $result;
}
sub selectfield {
my ($full)=@_;
- my %options =
- (&substatus_options,
- 'select_form_order' => ['yes','queued','graded','incorrect','all']);
-
- #
- # PrepareClasslist() needs to be called to avoid getting a sections list
- # for a different course from the @Sections global in lonstatistics.pm,
- # populated by an earlier request.
- #
- &Apache::lonstatistics::PrepareClasslist();
-
+ 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').'
'.&Apache::lonstatistics::SectionSelect('section','multiple',5).'
-
+
'.&mt('Groups').'
'.&Apache::lonstatistics::GroupSelect('group','multiple',5).'
-
+
'.&mt('Access Status').'
@@ -10254,7 +9503,7 @@ sub selectfield {
'.&Apache::lonhtmlcommon::StatusOptions(undef,undef,5,undef,'mult').'
';
if ($full) {
- $result.='
+ $result.='
'.&mt('Submission Status').'
@@ -10266,24 +9515,6 @@ sub selectfield {
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 transtatus_options {
- return &Apache::lonlocal::texthash(
- 'yes' => 'with score transactions',
- 'incorrect' => 'with less than full credit',
- 'all' => 'with any status',
- );
-}
-
sub reset_perm {
undef(%perm);
}
@@ -10417,7 +9648,7 @@ 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);
@@ -10478,12 +9709,12 @@ ENDUPFORM
ENDGRADINGFORM
- $result.=''.&Apache::loncommon::end_data_table_row().
+ $result.=''.&Apache::loncommon::end_data_table_row().
&Apache::loncommon::start_data_table_row().''.(<$pcorrect:
$pincorrect:
-
+'
ENDPERCFORM
$result.=' '.
&Apache::loncommon::end_data_table_row().
@@ -10492,7 +9723,7 @@ ENDPERCFORM
}
sub process_clicker_file {
- my ($r,$symb) = @_;
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
my %Saveable_Parameters=&clicker_grading_parameters();
@@ -10564,22 +9795,6 @@ sub process_clicker_file {
''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').' '),1);
return $result;
}
- my $mimetype;
- if ($env{'form.upfiletype'} eq 'iclicker') {
- my $mm = new File::MMagic;
- $mimetype = $mm->checktype_contents($env{'form.upfile'});
- unless (($mimetype eq 'text/plain') || ($mimetype eq 'text/html')) {
- $result.= ''.
- &Apache::lonhtmlcommon::confirm_success(
- &mt('File format is neither csv (iclicker 6) nor xml (iclicker 7)'),1).'
';
- return $result;
- }
- } elsif (($env{'form.upfiletype'} ne 'interwrite') && ($env{'form.upfiletype'} ne 'turning')) {
- $result .= ''.
- &Apache::lonhtmlcommon::confirm_success(
- &mt('Invalid clicker type: choose one of: i>clicker, Interwrite PRS, or Turning Technologies.'),1).'
';
- return $result;
- }
# Were able to get all the info needed, now analyze the file
@@ -10606,14 +9821,12 @@ ENDHEADER
my $errormsg='';
my $number=0;
if ($env{'form.upfiletype'} eq 'iclicker') {
- if ($mimetype eq 'text/plain') {
- ($errormsg,$number)=&iclicker_eval(\@questiontitles,\%responses);
- } elsif ($mimetype eq 'text/html') {
- ($errormsg,$number)=&iclickerxml_eval(\@questiontitles,\%responses);
- }
- } elsif ($env{'form.upfiletype'} eq 'interwrite') {
+ ($errormsg,$number)=&iclicker_eval(\@questiontitles,\%responses);
+ }
+ if ($env{'form.upfiletype'} eq 'interwrite') {
($errormsg,$number)=&interwrite_eval(\@questiontitles,\%responses);
- } elsif ($env{'form.upfiletype'} eq 'turning') {
+ }
+ if ($env{'form.upfiletype'} eq 'turning') {
($errormsg,$number)=&turning_eval(\@questiontitles,\%responses);
}
$result.=' '.&mt('Found [_1] question(s)',$number).' '.
@@ -10666,7 +9879,7 @@ ENDHEADER
"\n".&mt("Username").": ".
"\n".&mt("Domain").": ".
&Apache::loncommon::select_dom_form($env{'course.'.$env{'request.course.id'}.'.domain'},'udom'.$id).' '.
- &Apache::loncommon::selectstudent_link('clickeranalysis','uname'.$id,'udom'.$id,'',$id);
+ &Apache::loncommon::selectstudent_link('clickeranalysis','uname'.$id,'udom'.$id,0,$id);
$unknown_count++;
}
}
@@ -10721,49 +9934,6 @@ sub iclicker_eval {
return ($errormsg,$number);
}
-sub iclickerxml_eval {
- my ($questiontitles,$responses)=@_;
- my $number=0;
- my $errormsg='';
- my @state;
- my %respbyid;
- my $p = HTML::Parser->new
- (
- xml_mode => 1,
- start_h =>
- [sub {
- my ($tagname,$attr) = @_;
- push(@state,$tagname);
- if ("@state" eq "ssn p") {
- my $title = $attr->{qn};
- $title =~ s/(^\s+|\s+$)//g;
- $questiontitles->[$number]=$title;
- } elsif ("@state" eq "ssn p v") {
- my $id = $attr->{id};
- my $entry = $attr->{ans};
- $id=~s/^[\#0]+//;
- $entry =~s/[^a-zA-Z0-9\.\*\-\+]+//g;
- $respbyid{$id}[$number] = $entry;
- }
- }, "tagname, attr"],
- end_h =>
- [sub {
- my ($tagname) = @_;
- if ("@state" eq "ssn p") {
- $number++;
- }
- pop(@state);
- }, "tagname"],
- );
-
- $p->parse($env{'form.upfile'});
- $p->eof;
- foreach my $id (keys(%respbyid)) {
- $responses->{$id}=join(',',@{$respbyid{$id}});
- }
- return ($errormsg,$number);
-}
-
sub interwrite_eval {
my ($questiontitles,$responses)=@_;
my $number=0;
@@ -10820,8 +9990,9 @@ sub turning_eval {
return ($errormsg,$number);
}
+
sub assign_clicker_grades {
- my ($r,$symb) = @_;
+ my ($r,$symb)=@_;
if (!$symb) {return '';}
# See which part we are saving to
my $res_error;
@@ -10832,11 +10003,11 @@ sub assign_clicker_grades {
# FIXME: This should probably look for the first handgradeable part
my $part=$$partlist[0];
# Start screen output
- 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().'';
+ 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=();
@@ -10891,14 +10062,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]) || ($answer[$i]=~/^[0\.]+$/)) {
+ } elsif (($answer[$i]) || ($answer[$i]=~/^[0\.]+$/)) {
if ($gradingmechanism eq 'attendance') {
$sum+=$pcorrect;
} elsif ($correct[$i] eq '*') {
@@ -10957,33 +10128,24 @@ sub navmap_errormsg {
}
sub startpage {
- my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag,$stuvcurrent,$stuvdisp,$nomenu,$head_extra,$onload,$divforres) = @_;
- 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",$head_extra,\%args));
+ $r->print(&Apache::loncommon::start_page("Student's Version",$js,{'only_body' => '1'}));
} else {
- if ($env{'request.course.id'}) {
- unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"});
- }
- $args{'bread_crumbs'} = $crumbs;
- $r->print(&Apache::loncommon::start_page('Grading',$head_extra,\%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,$divforres));
+ $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,undef,undef,1));
+ $r->print(&Apache::lonstathelpers::problem_selector('.',undef,1));
$r->print(' ');
$r->print(' ');
}
@@ -10999,7 +10161,7 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
# see what command we need to execute
-
+
my @commands=&Apache::loncommon::get_env_multiple('form.command');
my $command=$commands[0];
@@ -11035,98 +10197,62 @@ sub handler {
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 {
- if ($command eq 'submission' && $perm{'vgr'}) {
- my ($stuvcurrent,$stuvdisp,$versionform,$js,$onload);
+ if ($command eq 'submission' && $perm{'vgr'}) {
+ 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'});
}
- my $divforres;
- if ($env{'form.student'} eq '') {
- $js .= &part_selector_js();
- $onload = "toggleParts('gradesub');";
- } else {
- $divforres = 1;
- }
- my $head_extra = $js;
- unless ($env{'form.vProb'} eq 'no') {
- my $csslinks = &Apache::loncommon::css_links($symb);
- if ($csslinks) {
- $head_extra .= "\n$csslinks";
- }
- }
- &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}],undef,undef,
- $stuvcurrent,$stuvdisp,undef,$head_extra,$onload,$divforres);
+ &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}],undef,undef,$stuvcurrent,$stuvdisp,undef,$js);
if ($versionform) {
- if ($divforres) {
- $request->print('
');
- }
$request->print($versionform);
}
- ($env{'form.student'} eq '' ? &listStudents($request,$symb,'',$divforres) : &submission($request,0,0,$symb,$divforres,$command));
+ $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'});
- my $head_extra = $js;
- unless ($env{'form.vProb'} eq 'no') {
- my $csslinks = &Apache::loncommon::css_links($symb);
- if ($csslinks) {
- $head_extra .= "\n$csslinks";
- }
- }
- &startpage($request,$symb,[{href=>"", text=>"Previous Student Version"}],undef,undef,
- $stuvcurrent,$stuvdisp,$env{'form.inhibitmenu'},$head_extra);
+ &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'}) {
+ } 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);
- &pickStudentPage($request,$symb);
- } elsif ($command eq 'displayPage' && $perm{'vgr'}) {
- my $csslinks;
- unless ($env{'form.vProb'} eq 'no') {
- $csslinks = &Apache::loncommon::css_links($symb,'map');
- }
+ &pickStudentPage($request,$symb);
+ } elsif ($command eq 'displayPage' && $perm{'vgr'}) {
&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,undef,undef,undef,$csslinks);
- &displayPage($request,$symb);
- } elsif ($command eq 'gradeByPage' && $perm{'mgr'}) {
+ {href=>'',text=>'Grade student'}],1,1);
+ &displayPage($request,$symb);
+ } elsif ($command eq 'gradeByPage' && $perm{'mgr'}) {
&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'}) {
- my $csslinks;
- unless ($env{'form.vProb'} eq 'no') {
- $csslinks = &Apache::loncommon::css_links($symb);
- }
+ &updateGradeByPage($request,$symb);
+ } elsif ($command eq 'processGroup' && $perm{'vgr'}) {
&startpage($request,$symb,[{href=>'',text=>'...'},
- {href=>'',text=>'Modify grades'}],undef,undef,undef,undef,undef,$csslinks,undef,1);
- &processGroup($request,$symb);
- } elsif ($command eq 'gradingmenu' && $perm{'vgr'}) {
+ {href=>'',text=>'Modify grades'}]);
+ &processGroup($request,$symb);
+ } elsif ($command eq 'gradingmenu' && $perm{'vgr'}) {
&startpage($request,$symb);
- $request->print(&grading_menu($request,$symb));
- } elsif ($command eq 'individual' && $perm{'vgr'}) {
+ $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));
+ $request->print(&submit_options($request,$symb));
} elsif ($command eq 'ungraded' && $perm{'vgr'}) {
- my $js = &part_selector_js();
- my $onload = "toggleParts('gradesub');";
- &startpage($request,$symb,[{href=>'',text=>'Grade ungraded submissions'}],
- undef,undef,undef,undef,undef,$js,$onload);
+ &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"}]);
@@ -11134,26 +10260,26 @@ sub handler {
} 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'}) {
+ } elsif ($command eq 'viewgrades' && $perm{'vgr'}) {
&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(&viewgrades($request,$symb));
+ } elsif ($command eq 'handgrade' && $perm{'mgr'}) {
&startpage($request,$symb,[{href=>'',text=>'...'},
{href=>'',text=>'Store grades'}]);
- $request->print(&processHandGrade($request,$symb));
- } elsif ($command eq 'editgrades' && $perm{'mgr'}) {
+ $request->print(&processHandGrade($request,$symb));
+ } elsif ($command eq 'editgrades' && $perm{'mgr'}) {
&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));
+ $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'}) {
+ } elsif ($command eq 'verify' && $perm{'vgr'}) {
&startpage($request,$symb,[{href=>&href_symb_cmd($symb,"initialverifyreceipt"),text=>'Verify Receipt Number'},
{href=>'',text=>'Verification Result'}]);
- $request->print(&verifyreceipt($request,$symb));
+ $request->print(&verifyreceipt($request,$symb));
} elsif ($command eq 'processclicker' && $perm{'mgr'}) {
&startpage($request,$symb,[{href=>'', text=>'Process clicker'}]);
$request->print(&process_clicker($request,$symb));
@@ -11166,84 +10292,81 @@ sub handler {
{href=>'', text=>'Process clicker file'},
{href=>'', text=>'Store grades'}]);
$request->print(&assign_clicker_grades($request,$symb));
- } elsif ($command eq 'csvform' && $perm{'mgr'}) {
+ } elsif ($command eq 'csvform' && $perm{'mgr'}) {
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
- $request->print(&upcsvScores_form($request,$symb));
- } elsif ($command eq 'csvupload' && $perm{'mgr'}) {
+ $request->print(&upcsvScores_form($request,$symb));
+ } elsif ($command eq 'csvupload' && $perm{'mgr'}) {
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
- $request->print(&csvupload($request,$symb));
- } elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) {
+ $request->print(&csvupload($request,$symb));
+ } elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) {
&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(&csvuploadmap($request,$symb));
+ } elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) {
+ if ($env{'form.associate'} ne 'Reverse Association') {
&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(&csvuploadoptions($request,$symb));
+ } else {
+ if ( $env{'form.upfile_associate'} ne 'reverse' ) {
+ $env{'form.upfile_associate'} = 'reverse';
+ } else {
+ $env{'form.upfile_associate'} = 'forward';
+ }
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
- $request->print(&csvuploadmap($request,$symb));
- }
- } elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) {
+ $request->print(&csvuploadmap($request,$symb));
+ }
+ } elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) {
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
- $request->print(&csvuploadassign($request,$symb));
- } elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
- &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1,
- undef,undef,undef,undef,'toggleScantab(document.rules);');
- $request->print(&scantron_selectphase($request,undef,$symb));
- } elsif ($command eq 'scantron_warning' && $perm{'mgr'}) {
+ $request->print(&csvuploadassign($request,$symb));
+ } elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
+ &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'}) {
+ &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'}) {
&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,$symb));
+ } elsif ($command eq 'scantron_process' && $perm{'mgr'}) {
&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,$symb));
+ } elsif ($command eq 'scantronupload' &&
+ (&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
+ &Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
&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'}))) {
- &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1,
- undef,undef,undef,undef,'toggleScantab(document.rules);');
- $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($request,$symb));
+ } elsif ($command eq 'scantronupload_save' &&
+ (&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
+ &Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
&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_upload_scantron_data_save($request,$symb));
+ } elsif ($command eq 'scantron_download' &&
+ &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
- $request->print(&scantron_download_scantron_data($request,$symb));
+ $request->print(&scantron_download_scantron_data($request,$symb));
} elsif ($command eq 'checksubmissions' && $perm{'vgr'}) {
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
$request->print(&checkscantron_results($request,$symb));
} elsif ($command eq 'downloadfilesselect' && $perm{'vgr'}) {
- my $js = &part_selector_js();
- my $onload = "toggleParts('gradingMenu');";
- &startpage($request,$symb,[{href=>'', text=>'Select which submissions to download'}],
- undef,undef,undef,undef,undef,$js,$onload);
+ &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 submitted files'}],
- undef,undef,undef,undef,undef,undef,undef,1);
- $request->print('
');
+ {href=>'', text=>'Download submissions'}]);
&submit_download_link($request,$symb);
- } elsif ($command) {
+ } elsif ($command) {
&startpage($request,$symb,[{href=>'', text=>'Access denied'}]);
- $request->print(''.&mt('Access Denied ([_1])',$command).'
');
- }
+ $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;
}
@@ -11267,7 +10390,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).
@@ -11314,6 +10437,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
@@ -11323,7 +10515,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',
@@ -11340,8 +10532,8 @@ ssi_with_retries()
- missingbubble - array ref of the bubble lines that have missing
bubble errors
- $randomorder - True if exam folder (or a sub-folder) has randomorder set
- $randompick - True if exam folder (or a sub-folder) has randompick set
+ $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).
@@ -11350,6 +10542,7 @@ ssi_with_retries()
or code-based randompick and/or randomorder.
+
=item scantron_get_maxbubble() :
Arguments:
@@ -11429,7 +10622,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