version 1.609, 2010/04/12 01:22:44
|
version 1.624, 2010/04/18 19:29:10
|
Line 43 use Apache::lonmsg();
|
Line 43 use Apache::lonmsg();
|
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonenc; |
use Apache::lonenc; |
|
use Apache::lonstathelpers; |
use String::Similarity; |
use String::Similarity; |
use LONCAPA; |
use LONCAPA; |
|
|
Line 137 sub nameUserString {
|
Line 138 sub nameUserString {
|
|
|
#--- Get the partlist and the response type for a given problem. --- |
#--- Get the partlist and the response type for a given problem. --- |
#--- Indicate if a response type is coded handgraded or not. --- |
#--- Indicate if a response type is coded handgraded or not. --- |
|
#--- Sets response_error pointer to "1" if navmaps object broken --- |
sub response_type { |
sub response_type { |
my ($symb,$response_error) = @_; |
my ($symb,$response_error) = @_; |
|
|
Line 617 sub jscriptNform {
|
Line 619 sub jscriptNform {
|
"\n"); |
"\n"); |
$jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\n". |
$jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n". |
'<input type="hidden" name="student" value="" />'."\n". |
'<input type="hidden" name="student" value="" />'."\n". |
Line 801 sub verifyreceipt {
|
Line 802 sub verifyreceipt {
|
$contents. |
$contents. |
&Apache::loncommon::end_data_table()."\n"; |
&Apache::loncommon::end_data_table()."\n"; |
} |
} |
return $string.&show_grading_menu_form($symb); |
return $string; |
} |
} |
|
|
#--- This is called by a number of programs. |
#--- This is called by a number of programs. |
Line 809 sub verifyreceipt {
|
Line 810 sub verifyreceipt {
|
#--- Also called directly when one clicks on the subm button |
#--- Also called directly when one clicks on the subm button |
# on the problem page. |
# on the problem page. |
sub listStudents { |
sub listStudents { |
my ($request,$symb) = @_; |
my ($request,$symb,$submitonly) = @_; |
|
|
my $cdom = $env{"course.$env{'request.course.id'}.domain"}; |
my $cdom = $env{"course.$env{'request.course.id'}.domain"}; |
my $cnum = $env{"course.$env{'request.course.id'}.num"}; |
my $cnum = $env{"course.$env{'request.course.id'}.num"}; |
my $getsec = $env{'form.section'} eq '' ? 'all' : $env{'form.section'}; |
my $getsec = $env{'form.section'} eq '' ? 'all' : $env{'form.section'}; |
my $getgroup = $env{'form.group'} eq '' ? 'all' : $env{'form.group'}; |
my $getgroup = $env{'form.group'} eq '' ? 'all' : $env{'form.group'}; |
my $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'}; |
unless ($submitonly) { |
my $viewgrade = $env{'form.showgrading'} eq 'yes' ? 'View/Grade/Regrade' : 'View'; |
$submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'}; |
|
} |
|
|
my $result='<h3><span class="LC_info"> ' |
my $result='<h3><span class="LC_info"> ' |
.&mt("$viewgrade Submissions for a Student or a Group of Students") |
.&mt("View/Grade/Regrade Submissions for a Student or a Group of Students") |
.'</span></h3>'; |
.'</span></h3>'; |
|
my $res_error; |
my ($partlist,$handgrade,$responseType) = &response_type($symb |
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
#,$res_error |
|
); |
|
|
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'multiple' => 'Please select a student or group of students before clicking on the Next button.', |
'multiple' => 'Please select a student or group of students before clicking on the Next button.', |
Line 864 LISTJAVASCRIPT
|
Line 864 LISTJAVASCRIPT
|
&commonJSfunctions($request); |
&commonJSfunctions($request); |
$request->print($result); |
$request->print($result); |
|
|
my $checkhdgrade = ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked="checked"' : ''; |
|
my $checklastsub = $checkhdgrade eq '' ? 'checked="checked"' : ''; |
|
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'. |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'. |
"\n"; |
"\n"; |
|
|
Line 882 LISTJAVASCRIPT
|
Line 880 LISTJAVASCRIPT
|
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
|
|
my $submission_options; |
my $submission_options; |
if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) { |
|
$submission_options.= |
|
'<label><input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> '.&mt('essay part only').' </label>'."\n"; |
|
} |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $saveStatus = $stu_status eq '' ? 'Active' : $stu_status; |
my $saveStatus = $stu_status eq '' ? 'Active' : $stu_status; |
$env{'form.Status'} = $saveStatus; |
$env{'form.Status'} = $saveStatus; |
$submission_options.= |
$submission_options.= |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<label><input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> '. |
'<label><input type="radio" name="lastSub" value="lastonly" /> '. |
&mt('last submission only').' </label></span>'."\n". |
&mt('last submission only').' </label></span>'."\n". |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<label><input type="radio" name="lastSub" value="last" /> '. |
'<label><input type="radio" name="lastSub" value="last" /> '. |
Line 918 LISTJAVASCRIPT
|
Line 912 LISTJAVASCRIPT
|
$gradeTable .= |
$gradeTable .= |
&build_section_inputs(). |
&build_section_inputs(). |
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" /><br />'."\n". |
|
'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" /><br />'."\n". |
|
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
|
|
if (exists($env{'form.gradingMenu'}) && exists($env{'form.Status'})) { |
if (exists($env{'form.Status'})) { |
$gradeTable .= '<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n"; |
$gradeTable .= '<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n"; |
} else { |
} else { |
$gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Student Status')) |
$gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Student Status')) |
Line 939 LISTJAVASCRIPT
|
Line 930 LISTJAVASCRIPT
|
.&Apache::lonhtmlcommon::end_pick_box(); |
.&Apache::lonhtmlcommon::end_pick_box(); |
|
|
$gradeTable .= '<p>' |
$gradeTable .= '<p>' |
.&mt('To '.lc($viewgrade)." a submission or a group of submissions, click on the check box(es) next to the student's name(s). Then click on the Next button.")."\n" |
.&mt("To view/grade/regrade a submission or a group of submissions, click on the check box(es) next to the student's name(s). Then click on the Next button.")."\n" |
.'<input type="hidden" name="command" value="processGroup" />' |
.'<input type="hidden" name="command" value="processGroup" />' |
.'</p>'; |
.'</p>'; |
|
|
Line 956 LISTJAVASCRIPT
|
Line 947 LISTJAVASCRIPT
|
while ($loop < 2) { |
while ($loop < 2) { |
$gradeTable.='<th>'.&mt('No.').'</th><th>'.&mt('Select').'</th>'. |
$gradeTable.='<th>'.&mt('No.').'</th><th>'.&mt('Select').'</th>'. |
'<th>'.&nameUserString('header').' '.&mt('Section/Group').'</th>'; |
'<th>'.&nameUserString('header').' '.&mt('Section/Group').'</th>'; |
if ($env{'form.showgrading'} eq 'yes' |
if (($submitonly ne 'queued') && ($submitonly ne 'all')) { |
&& $submitonly ne 'queued' |
|
&& $submitonly ne 'all') { |
|
foreach my $part (sort(@$partlist)) { |
foreach my $part (sort(@$partlist)) { |
my $display_part= |
my $display_part= |
&get_display_part((split(/_/,$part))[0],$symb); |
&get_display_part((split(/_/,$part))[0],$symb); |
Line 994 LISTJAVASCRIPT
|
Line 983 LISTJAVASCRIPT
|
$status{'gradingqueue'} = $queue_status{'gradingqueue'}; |
$status{'gradingqueue'} = $queue_status{'gradingqueue'}; |
} |
} |
|
|
if ($env{'form.showgrading'} eq 'yes' |
if (($submitonly ne 'queued') && ($submitonly ne 'all')) { |
&& $submitonly ne 'queued' |
|
&& $submitonly ne 'all') { |
|
(%status) =&student_gradeStatus($symb,$udom,$uname,$partlist); |
(%status) =&student_gradeStatus($symb,$udom,$uname,$partlist); |
my $submitted = 0; |
my $submitted = 0; |
my $graded = 0; |
my $graded = 0; |
Line 1037 LISTJAVASCRIPT
|
Line 1024 LISTJAVASCRIPT
|
&nameUserString(undef,$$fullname{$student},$uname,$udom). |
&nameUserString(undef,$$fullname{$student},$uname,$udom). |
' '.$section.($group ne '' ?'/'.$group:'').'</td>'."\n"; |
' '.$section.($group ne '' ?'/'.$group:'').'</td>'."\n"; |
|
|
if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
if ($submitonly ne 'all') { |
foreach (sort(keys(%status))) { |
foreach (sort(keys(%status))) { |
next if ($_ =~ /^resource.*?submitted_by$/); |
next if ($_ =~ /^resource.*?submitted_by$/); |
$gradeTable.='<td align="center"> '.&mt($status{$_}).' </td>'."\n"; |
$gradeTable.='<td align="center"> '.&mt($status{$_}).' </td>'."\n"; |
Line 1051 LISTJAVASCRIPT
|
Line 1038 LISTJAVASCRIPT
|
} |
} |
if ($ctr%2 ==1) { |
if ($ctr%2 ==1) { |
$gradeTable.='<td> </td><td> </td><td> </td>'; |
$gradeTable.='<td> </td><td> </td><td> </td>'; |
if ($env{'form.showgrading'} eq 'yes' |
if (($submitonly ne 'queued') && ($submitonly ne 'all')) { |
&& $submitonly ne 'queued' |
|
&& $submitonly ne 'all') { |
|
foreach (@$partlist) { |
foreach (@$partlist) { |
$gradeTable.='<td> </td>'; |
$gradeTable.='<td> </td>'; |
} |
} |
Line 1084 LISTJAVASCRIPT
|
Line 1069 LISTJAVASCRIPT
|
} elsif ($ctr == 1) { |
} elsif ($ctr == 1) { |
$gradeTable =~ s/type="checkbox"/type="checkbox" checked="checked"/; |
$gradeTable =~ s/type="checkbox"/type="checkbox" checked="checked"/; |
} |
} |
$gradeTable.=&show_grading_menu_form($symb); |
|
$request->print($gradeTable); |
$request->print($gradeTable); |
return ''; |
return ''; |
} |
} |
Line 1138 sub check_buttons {
|
Line 1122 sub check_buttons {
|
|
|
# Displays the submissions for one student or a group of students |
# Displays the submissions for one student or a group of students |
sub processGroup { |
sub processGroup { |
my ($request) = shift; |
my ($request,$symb) = @_; |
my $ctr = 0; |
my $ctr = 0; |
my @stuchecked = &Apache::loncommon::get_env_multiple('form.stuinfo'); |
my @stuchecked = &Apache::loncommon::get_env_multiple('form.stuinfo'); |
my $total = scalar(@stuchecked)-1; |
my $total = scalar(@stuchecked)-1; |
Line 1148 sub processGroup {
|
Line 1132 sub processGroup {
|
$env{'form.student'} = $uname; |
$env{'form.student'} = $uname; |
$env{'form.userdom'} = $udom; |
$env{'form.userdom'} = $udom; |
$env{'form.fullname'} = $fullname; |
$env{'form.fullname'} = $fullname; |
&submission($request,$ctr,$total); |
&submission($request,$ctr,$total,$symb); |
$ctr++; |
$ctr++; |
} |
} |
return ''; |
return ''; |
Line 1286 sub sub_page_js {
|
Line 1270 sub sub_page_js {
|
|
|
} |
} |
if (val == "Grade Student") { |
if (val == "Grade Student") { |
formname.showgrading.value = "yes"; |
|
if (formname.Status.value == "") { |
if (formname.Status.value == "") { |
formname.Status.value = "Active"; |
formname.Status.value = "Active"; |
} |
} |
Line 1750 sub gradeBox {
|
Line 1733 sub gradeBox {
|
} |
} |
|
|
sub handback_box { |
sub handback_box { |
my ($symb,$uname,$udom,$counter,$partid,$record,$res_error) = @_; |
my ($symb,$uname,$udom,$counter,$partid,$record,$res_error_pointer) = @_; |
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error); |
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error_pointer); |
my (@respids); |
my (@respids); |
my @part_response_id = &flatten_responseType($responseType); |
my @part_response_id = &flatten_responseType($responseType); |
foreach my $part_response_id (@part_response_id) { |
foreach my $part_response_id (@part_response_id) { |
Line 1855 sub files_exist {
|
Line 1838 sub files_exist {
|
|
|
sub download_all_link { |
sub download_all_link { |
my ($r,$symb) = @_; |
my ($r,$symb) = @_; |
|
unless (&files_exist($r, $symb)) { |
|
$r->print(&mt('There are currently no submitted documents.')); |
|
return; |
|
} |
|
|
my $all_students = |
my $all_students = |
join("\n", &Apache::loncommon::get_env_multiple('form.stuinfo')); |
join("\n", &Apache::loncommon::get_env_multiple('form.stuinfo')); |
|
|
Line 1867 sub download_all_link {
|
Line 1855 sub download_all_link {
|
'cgi.'.$identifier.'.parts' => $parts,}); |
'cgi.'.$identifier.'.parts' => $parts,}); |
$r->print('<a href="/cgi-bin/multidownload.pl?'.$identifier.'">'. |
$r->print('<a href="/cgi-bin/multidownload.pl?'.$identifier.'">'. |
&mt('Download All Submitted Documents').'</a>'); |
&mt('Download All Submitted Documents').'</a>'); |
return |
return; |
|
} |
|
|
|
sub submit_download_link { |
|
my ($request,$symb) = @_; |
|
if (!$symb) { return ''; } |
|
#FIXME: Figure out which type of problem this is and provide appropriate download |
|
&download_all_link($request,$symb); |
} |
} |
|
|
sub build_section_inputs { |
sub build_section_inputs { |
Line 1898 sub submission {
|
Line 1893 sub submission {
|
$request->print('<span class="LC_warning">Unable to view requested student.('. |
$request->print('<span class="LC_warning">Unable to view requested student.('. |
$uname.':'.$udom.' in section '.$usec.' in course id '. |
$uname.':'.$udom.' in section '.$usec.' in course id '. |
$env{'request.course.id'}.')</span>'); |
$env{'request.course.id'}.')</span>'); |
$request->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
|
|
Line 1914 sub submission {
|
Line 1908 sub submission {
|
# header info |
# header info |
if ($counter == 0) { |
if ($counter == 0) { |
&sub_page_js($request); |
&sub_page_js($request); |
&sub_page_kw_js($request) if ($env{'form.handgrade'} eq 'yes'); |
&sub_page_kw_js($request); |
if ($env{'form.handgrade'} eq 'yes' && &files_exist($request, $symb)) { |
|
&download_all_link($request, $symb); |
|
} |
|
$request->print('<h3> <span class="LC_info">'.&mt('Submission Record').'</span></h3>'); |
$request->print('<h3> <span class="LC_info">'.&mt('Submission Record').'</span></h3>'); |
|
|
# option to display problem, only once else it cause problems |
# option to display problem, only once else it cause problems |
Line 1938 sub submission {
|
Line 1929 sub submission {
|
# kwclr is the only variable that is guaranteed to be non blank |
# kwclr is the only variable that is guaranteed to be non blank |
# if this subroutine has been called once. |
# if this subroutine has been called once. |
my %keyhash = (); |
my %keyhash = (); |
if ($env{'form.kwclr'} eq '' && $env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.kwclr'} eq '' && $env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
%keyhash = &Apache::lonnet::dump('nohist_handgrade', |
%keyhash = &Apache::lonnet::dump('nohist_handgrade', |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
Line 1956 sub submission {
|
Line 1948 sub submission {
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n". |
$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n". |
'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
'<input type="hidden" name="studentNo" value="" />'."\n". |
'<input type="hidden" name="studentNo" value="" />'."\n". |
'<input type="hidden" name="gradeOpt" value="" />'."\n". |
'<input type="hidden" name="gradeOpt" value="" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" />'."\n". |
|
'<input type="hidden" name="vProb" value="'.$env{'form.vProb'}.'" />'."\n". |
'<input type="hidden" name="vProb" value="'.$env{'form.vProb'}.'" />'."\n". |
'<input type="hidden" name="vAns" value="'.$env{'form.vAns'}.'" />'."\n". |
'<input type="hidden" name="vAns" value="'.$env{'form.vAns'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$env{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$env{'form.lastSub'}.'" />'."\n". |
&build_section_inputs(). |
&build_section_inputs(). |
'<input type="hidden" name="submitonly" value="'.$env{'form.submitonly'}.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$env{'form.submitonly'}.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" />'."\n". |
|
'<input type="hidden" name="NCT"'. |
'<input type="hidden" name="NCT"'. |
' value="'.($env{'form.NTSTU'} ne '' ? $env{'form.NTSTU'} : $total+1).'" />'."\n"); |
' value="'.($env{'form.NTSTU'} ne '' ? $env{'form.NTSTU'} : $total+1).'" />'."\n"); |
if ($env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
$request->print('<input type="hidden" name="keywords" value="'.$env{'form.keywords'}.'" />'."\n". |
$request->print('<input type="hidden" name="keywords" value="'.$env{'form.keywords'}.'" />'."\n". |
'<input type="hidden" name="kwclr" value="'.$env{'form.kwclr'}.'" />'."\n". |
'<input type="hidden" name="kwclr" value="'.$env{'form.kwclr'}.'" />'."\n". |
'<input type="hidden" name="kwsize" value="'.$env{'form.kwsize'}.'" />'."\n". |
'<input type="hidden" name="kwsize" value="'.$env{'form.kwsize'}.'" />'."\n". |
Line 1997 sub submission {
|
Line 1987 sub submission {
|
} |
} |
$request->print($prnmsg); |
$request->print($prnmsg); |
|
|
if ($env{'form.handgrade'} eq 'yes' && $env{'form.showgrading'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
# |
# |
# Print out the keyword options line |
# Print out the keyword options line |
# |
# |
Line 2073 KEYWORDS
|
Line 2064 KEYWORDS
|
.'<h3 class="LC_hcell">'.&mt('Submissions').'</h3>'; |
.'<h3 class="LC_hcell">'.&mt('Submissions').'</h3>'; |
$result.='<input type="hidden" name="name'.$counter. |
$result.='<input type="hidden" name="name'.$counter. |
'" value="'.$env{'form.fullname'}.'" />'."\n"; |
'" value="'.$env{'form.fullname'}.'" />'."\n"; |
if ($env{'form.handgrade'} eq 'no') { |
# if ($env{'form.handgrade'} eq 'no') { |
|
if (1) { |
$result.='<p class="LC_info">' |
$result.='<p class="LC_info">' |
.&mt('Part(s) graded correct by the computer is marked with a [_1] symbol.',$checkIcon) |
.&mt('Part(s) graded correct by the computer is marked with a [_1] symbol.',$checkIcon) |
."</p>\n"; |
."</p>\n"; |
Line 2082 KEYWORDS
|
Line 2074 KEYWORDS
|
# If any part of the problem is an essay-response (handgraded), then check for collaborators |
# If any part of the problem is an essay-response (handgraded), then check for collaborators |
my $fullname; |
my $fullname; |
my $col_fullnames = []; |
my $col_fullnames = []; |
if ($env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
(my $sub_result,$fullname,$col_fullnames)= |
(my $sub_result,$fullname,$col_fullnames)= |
&check_collaborators($symb,$uname,$udom,\%record,$handgrade, |
&check_collaborators($symb,$uname,$udom,\%record,$handgrade, |
$counter); |
$counter); |
Line 2133 KEYWORDS
|
Line 2126 KEYWORDS
|
$lastsubonly.="\n".'<div class="LC_grade_submission_part">'. |
$lastsubonly.="\n".'<div class="LC_grade_submission_part">'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
' <span class="LC_internal_info">'. |
' <span class="LC_internal_info">'. |
'('.&mt('Part ID: [_1]',$respid).')'. |
'('.&mt('Response ID: [_1]',$respid).')'. |
'</span> '. |
'</span> '. |
'<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>'; |
'<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>'; |
next; |
next; |
Line 2178 KEYWORDS
|
Line 2171 KEYWORDS
|
$lastsubonly.='<div class="LC_grade_submission_part">'. |
$lastsubonly.='<div class="LC_grade_submission_part">'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
' <span class="LC_internal_info">'. |
' <span class="LC_internal_info">'. |
'('.&mt('Part ID: [_1]',$respid).')'. |
'('.&mt('Response ID: [_1]',$respid).')'. |
'</span> '; |
'</span> '; |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
if (@$files) { |
if (@$files) { |
Line 2209 KEYWORDS
|
Line 2202 KEYWORDS
|
} |
} |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
# my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); |
my ($parts,$handgrade,$responseType) = &response_type($symb,\$res_error); |
my ($parts,$handgrade,$responseType) = &response_type($symb); |
|
|
|
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
Line 2219 KEYWORDS
|
Line 2210 KEYWORDS
|
$last,'.submission', |
$last,'.submission', |
'Apache::grades::keywords_highlight')); |
'Apache::grades::keywords_highlight')); |
} |
} |
|
|
$request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
$request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
.$udom.'" />'."\n"); |
.$udom.'" />'."\n"); |
# return if view submission with no grading option |
# return if view submission with no grading option |
if ($env{'form.showgrading'} eq '' || (!&canmodify($usec))) { |
# FIXME: the logic seems off here. Why show the grade button if you cannot grade? |
|
if (!&canmodify($usec)) { |
my $toGrade.='<input type="button" value="Grade Student" '. |
my $toGrade.='<input type="button" value="Grade Student" '. |
'onclick="javascript:checksubmit(this.form,\'Grade Student\',\'' |
'onclick="javascript:checksubmit(this.form,\'Grade Student\',\'' |
.$counter.'\');" target="_self" /> '."\n" if (&canmodify($usec)); |
.$counter.'\');" target="_self" /> '."\n" if (&canmodify($usec)); |
$toGrade.='</div>'."\n"; |
$toGrade.='</div>'."\n"; |
if (($env{'form.command'} eq 'submission') || |
|
($env{'form.command'} eq 'processGroup' && $counter == $total)) { |
|
$toGrade.='</form>'.&show_grading_menu_form($symb); |
|
} |
|
$request->print($toGrade); |
$request->print($toGrade); |
return; |
return; |
} else { |
} else { |
Line 2239 KEYWORDS
|
Line 2226 KEYWORDS
|
} |
} |
|
|
# essay grading message center |
# essay grading message center |
if ($env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
my $result='<div class="LC_grade_message_center">'; |
my $result='<div class="LC_grade_message_center">'; |
|
|
$result.='<div class="LC_grade_message_center_header">'. |
$result.='<div class="LC_grade_message_center_header">'. |
Line 2331 KEYWORDS
|
Line 2319 KEYWORDS
|
$endform.="<input type='hidden' value='".&get_increment(). |
$endform.="<input type='hidden' value='".&get_increment(). |
"' name='increment' />"; |
"' name='increment' />"; |
$endform.='</td></tr></table></form>'; |
$endform.='</td></tr></table></form>'; |
$endform.=&show_grading_menu_form($symb); |
|
$request->print($endform); |
$request->print($endform); |
} |
} |
return ''; |
return ''; |
Line 2545 sub processHandGrade {
|
Line 2532 sub processHandGrade {
|
} |
} |
} |
} |
|
|
if ($env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
# Keywords sorted in alphabatical order |
# Keywords sorted in alphabatical order |
my $loginuser = $env{'user.name'}.':'.$env{'user.domain'}; |
my $loginuser = $env{'user.name'}.':'.$env{'user.domain'}; |
my %keyhash = (); |
my %keyhash = (); |
Line 2606 sub processHandGrade {
|
Line 2594 sub processHandGrade {
|
|
|
# Go directly to grade student - from submission or link from chart page |
# Go directly to grade student - from submission or link from chart page |
if ($button eq 'Grade Student') { |
if ($button eq 'Grade Student') { |
# (undef,undef,$env{'form.handgrade'},undef,undef) = &showResourceInfo($symb); |
|
my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}}; |
my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}}; |
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser); |
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser); |
$env{'form.fullname'} = $$fullname{$processUser}; |
$env{'form.fullname'} = $$fullname{$processUser}; |
Line 2704 sub processHandGrade {
|
Line 2691 sub processHandGrade {
|
my $the_end = '<h3><span class="LC_info">'.&mt('LON-CAPA User Message').'</span></h3><br />'."\n"; |
my $the_end = '<h3><span class="LC_info">'.&mt('LON-CAPA User Message').'</span></h3><br />'."\n"; |
$the_end.=&mt('<b>Message: </b> No more students for this section or class.').'<br /><br />'."\n"; |
$the_end.=&mt('<b>Message: </b> No more students for this section or class.').'<br /><br />'."\n"; |
$the_end.=&mt('Click on the button below to return to the grading menu.').'<br /><br />'."\n"; |
$the_end.=&mt('Click on the button below to return to the grading menu.').'<br /><br />'."\n"; |
$the_end.=&show_grading_menu_form($symb); |
|
$request->print($the_end); |
$request->print($the_end); |
} |
} |
return ''; |
return ''; |
Line 3289 sub viewgrades {
|
Line 3275 sub viewgrades {
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
&build_section_inputs(). |
&build_section_inputs(). |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="Status" value="'.$env{'stu_status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'stu_status'}.'" />'."\n". |
|
|
my ($common_header,$specific_header); |
my ($common_header,$specific_header); |
Line 3436 sub viewgrades {
|
Line 3421 sub viewgrades {
|
$section_display, $stu_status). |
$section_display, $stu_status). |
'</span>'; |
'</span>'; |
} |
} |
$result.=&show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
Line 3719 sub editgrades {
|
Line 3703 sub editgrades {
|
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
$result .= &Apache::loncommon::end_data_table(). |
$result .= &Apache::loncommon::end_data_table(); |
&show_grading_menu_form($symb); |
|
my $msg = '<p><b>'. |
my $msg = '<p><b>'. |
&mt('Number of records updated = [_1] for [quant,_2,student].', |
&mt('Number of records updated = [_1] for [quant,_2,student].', |
$rec_update,$count).'</b><br />'. |
$rec_update,$count).'</b><br />'. |
Line 3856 to this page if the data selected is ins
|
Line 3839 to this page if the data selected is ins
|
<input type="hidden" name="upfile_associate" |
<input type="hidden" name="upfile_associate" |
value="$env{'form.upfile_associate'}" /> |
value="$env{'form.upfile_associate'}" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
|
<input type="hidden" name="command" value="csvuploadoptions" /> |
<input type="hidden" name="command" value="csvuploadoptions" /> |
<hr /> |
<hr /> |
ENDPICK |
ENDPICK |
Line 3934 sub upcsvScores_form {
|
Line 3916 sub upcsvScores_form {
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="command" value="csvuploadmap" /> |
<input type="hidden" name="command" value="csvuploadmap" /> |
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
|
$upfile_select |
$upfile_select |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
<label><input type="checkbox" name="noFirstLine" />$ignore</label> |
<label><input type="checkbox" name="noFirstLine" />$ignore</label> |
Line 3944 ENDUPFORM
|
Line 3925 ENDUPFORM
|
&mt("How do I create a CSV file from a spreadsheet")) |
&mt("How do I create a CSV file from a spreadsheet")) |
.'</td></tr></table>'."\n"; |
.'</td></tr></table>'."\n"; |
$result.='</td></tr></table><br /><br />'."\n"; |
$result.='</td></tr></table><br /><br />'."\n"; |
$result.=&show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
Line 3991 sub csvuploadmap {
|
Line 3971 sub csvuploadmap {
|
} |
} |
} |
} |
&csvuploadmap_footer($request,$i,$keyfields); |
&csvuploadmap_footer($request,$i,$keyfields); |
$request->print(&show_grading_menu_form($symb)); |
|
|
|
return ''; |
return ''; |
} |
} |
Line 4035 ENDPICK
|
Line 4014 ENDPICK
|
# FIXME do a check for any invalid user ids?... |
# FIXME do a check for any invalid user ids?... |
$request->print('<input type="submit" value="Assign Grades" /><br /> |
$request->print('<input type="submit" value="Assign Grades" /><br /> |
<hr /></form>'."\n"); |
<hr /></form>'."\n"); |
$request->print(&show_grading_menu_form($symb)); |
|
return ''; |
return ''; |
} |
} |
|
|
Line 4164 sub csvuploadassign {
|
Line 4142 sub csvuploadassign {
|
$request->print(join(', ',@notallowed)); |
$request->print(join(', ',@notallowed)); |
} |
} |
$request->print("<br />\n"); |
$request->print("<br />\n"); |
$request->print(&show_grading_menu_form($symb)); |
|
return $error_msg; |
return $error_msg; |
} |
} |
#------------- end of section for handling csv file upload --------- |
#------------- end of section for handling csv file upload --------- |
Line 4248 LISTJAVASCRIPT
|
Line 4225 LISTJAVASCRIPT
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
$result.='<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
$result.='<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."<br />\n"; |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n"; |
|
|
|
$result.=' <b>'.&mt('Use CODE').': </b> <input type="text" name="CODE" value="" /> <br />'."\n"; |
$result.=' <b>'.&mt('Use CODE').': </b> <input type="text" name="CODE" value="" /> <br />'."\n"; |
|
|
Line 4295 LISTJAVASCRIPT
|
Line 4271 LISTJAVASCRIPT
|
$studentTable.='<input type="button" '. |
$studentTable.='<input type="button" '. |
'onclick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' →" /></form>'."\n"; |
'onclick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' →" /></form>'."\n"; |
|
|
$studentTable.=&show_grading_menu_form($symb); |
|
$request->print($studentTable); |
$request->print($studentTable); |
|
|
return ''; |
return ''; |
Line 4350 sub displayPage {
|
Line 4325 sub displayPage {
|
|
|
if (!&canview($usec)) { |
if (!&canview($usec)) { |
$request->print('<span class="LC_warning">'.&mt('Unable to view requested student. ([_1])',$env{'form.student'}).'</span>'); |
$request->print('<span class="LC_warning">'.&mt('Unable to view requested student. ([_1])',$env{'form.student'}).'</span>'); |
$request->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
my $result='<h3><span class="LC_info"> '.$env{'form.title'}.'</span></h3>'; |
my $result='<h3><span class="LC_info"> '.$env{'form.title'}.'</span></h3>'; |
Line 4368 sub displayPage {
|
Line 4342 sub displayPage {
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
unless (ref($navmap)) { |
unless (ref($navmap)) { |
$request->print(&navmap_errormsg()); |
$request->print(&navmap_errormsg()); |
$request->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
my ($mapUrl, $id, $resUrl)=&Apache::lonnet::decode_symb($env{'form.page'}); |
my ($mapUrl, $id, $resUrl)=&Apache::lonnet::decode_symb($env{'form.page'}); |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
if (!$map) { |
if (!$map) { |
$request->print('<span class="LC_warning">'.&mt('Unable to view requested sequence. ([_1])',$resUrl).'</span>'); |
$request->print('<span class="LC_warning">'.&mt('Unable to view requested sequence. ([_1])',$resUrl).'</span>'); |
$request->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
my $iterator = $navmap->getIterator($map->map_start(), |
my $iterator = $navmap->getIterator($map->map_start(), |
Line 4388 sub displayPage {
|
Line 4360 sub displayPage {
|
'<input type="hidden" name="page" value="'.$pageTitle.'" />'."\n". |
'<input type="hidden" name="page" value="'.$pageTitle.'" />'."\n". |
'<input type="hidden" name="title" value="'.$env{'form.title'}.'" />'."\n". |
'<input type="hidden" name="title" value="'.$env{'form.title'}.'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="overRideScore" value="no" />'."\n". |
'<input type="hidden" name="overRideScore" value="no" />'."\n"; |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n"; |
|
|
|
if (defined($env{'form.CODE'})) { |
if (defined($env{'form.CODE'})) { |
$studentTable.= |
$studentTable.= |
Line 4491 sub displayPage {
|
Line 4462 sub displayPage {
|
'<input type="button" value="'.&mt('Save').'" '. |
'<input type="button" value="'.&mt('Save').'" '. |
'onclick="javascript:checkSubmitPage(this.form,'.$question.');" />'. |
'onclick="javascript:checkSubmitPage(this.form,'.$question.');" />'. |
'</form>'."\n"; |
'</form>'."\n"; |
$studentTable.=&show_grading_menu_form($symb); |
|
$request->print($studentTable); |
$request->print($studentTable); |
|
|
return ''; |
return ''; |
Line 4629 sub updateGradeByPage {
|
Line 4599 sub updateGradeByPage {
|
my $usec=$classlist->{$env{'form.student'}}[5]; |
my $usec=$classlist->{$env{'form.student'}}[5]; |
if (!&canmodify($usec)) { |
if (!&canmodify($usec)) { |
$request->print('<span class="LC_warning">'.&mt('Unable to modify requested student ([_1])',$env{'form.student'}).'</span>'); |
$request->print('<span class="LC_warning">'.&mt('Unable to modify requested student ([_1])',$env{'form.student'}).'</span>'); |
$request->print(&show_grading_menu_form($env{'form.symb'})); |
|
return; |
return; |
} |
} |
my $result='<h3><span class="LC_info"> '.$env{'form.title'}.'</span></h3>'; |
my $result='<h3><span class="LC_info"> '.$env{'form.title'}.'</span></h3>'; |
Line 4648 sub updateGradeByPage {
|
Line 4617 sub updateGradeByPage {
|
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
if (!$map) { |
if (!$map) { |
$request->print('<span class="LC_warning">'.&mt('Unable to grade requested sequence ([_1]).',$resUrl).'</span>'); |
$request->print('<span class="LC_warning">'.&mt('Unable to grade requested sequence ([_1]).',$resUrl).'</span>'); |
$request->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
my $iterator = $navmap->getIterator($map->map_start(), |
my $iterator = $navmap->getIterator($map->map_start(), |
Line 4774 sub updateGradeByPage {
|
Line 4742 sub updateGradeByPage {
|
} |
} |
|
|
$studentTable.=&Apache::loncommon::end_data_table(); |
$studentTable.=&Apache::loncommon::end_data_table(); |
$studentTable.=&show_grading_menu_form($env{'form.symb'}); |
|
my $grademsg=($changeflag == 0 ? &mt('No score was changed or updated.') : |
my $grademsg=($changeflag == 0 ? &mt('No score was changed or updated.') : |
&mt('The scores were changed for [quant,_1,problem].', |
&mt('The scores were changed for [quant,_1,problem].', |
$changeflag)); |
$changeflag)); |
Line 4852 the homework problem.
|
Line 4819 the homework problem.
|
|
|
sub defaultFormData { |
sub defaultFormData { |
my ($symb)=@_; |
my ($symb)=@_; |
return '<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
return '<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'; |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'; |
|
} |
} |
|
|
|
|
Line 5148 sub scantron_selectphase {
|
Line 5114 sub scantron_selectphase {
|
return; |
return; |
} |
} |
my $default_form_data=&defaultFormData($symb); |
my $default_form_data=&defaultFormData($symb); |
my $grading_menu_button=&show_grading_menu_form($symb); |
|
my $file_selector=&scantron_uploads($file2grade); |
my $file_selector=&scantron_uploads($file2grade); |
my $format_selector=&scantron_scantab(); |
my $format_selector=&scantron_scantab(); |
my $CODE_selector=&scantron_CODElist(); |
my $CODE_selector=&scantron_CODElist(); |
Line 5310 sub scantron_selectphase {
|
Line 5275 sub scantron_selectphase {
|
&Apache::loncommon::end_data_table_row()."\n". |
&Apache::loncommon::end_data_table_row()."\n". |
&Apache::loncommon::end_data_table()."\n". |
&Apache::loncommon::end_data_table()."\n". |
'</form><br />'); |
'</form><br />'); |
$r->print($grading_menu_button); |
|
return; |
return; |
} |
} |
|
|
Line 6235 sub scantron_do_warning {
|
Line 6199 sub scantron_do_warning {
|
<input type="hidden" name="command" value="scantron_validate" /> |
<input type="hidden" name="command" value="scantron_validate" /> |
'); |
'); |
} |
} |
$r->print("</form><br />".&show_grading_menu_form($symb)); |
$r->print("</form><br />"); |
return ''; |
return ''; |
} |
} |
|
|
Line 6383 sub scantron_validate_file {
|
Line 6347 sub scantron_validate_file {
|
$r->print(" ".&mt("this scanline saving it for later.")); |
$r->print(" ".&mt("this scanline saving it for later.")); |
} |
} |
} |
} |
$r->print(" </form><br />".&show_grading_menu_form($symb)); |
$r->print(" </form><br />"); |
return ''; |
return ''; |
} |
} |
|
|
Line 7646 SCANTRONFORM
|
Line 7610 SCANTRONFORM
|
if ($ssi_error) { |
if ($ssi_error) { |
$r->print("</form>"); |
$r->print("</form>"); |
&ssi_print_error($r); |
&ssi_print_error($r); |
$r->print(&show_grading_menu_form($symb)); |
|
&Apache::lonnet::remove_lock($lock); |
&Apache::lonnet::remove_lock($lock); |
return ''; # Dunno why the other returns return '' rather than just returning. |
return ''; # Dunno why the other returns return '' rather than just returning. |
} |
} |
Line 7724 SCANTRONFORM
|
Line 7687 SCANTRONFORM
|
$ssi_error = 0; # So end of handler error message does not trigger. |
$ssi_error = 0; # So end of handler error message does not trigger. |
$r->print("</form>"); |
$r->print("</form>"); |
&ssi_print_error($r); |
&ssi_print_error($r); |
$r->print(&show_grading_menu_form($symb)); |
|
&Apache::lonnet::remove_lock($lock); |
&Apache::lonnet::remove_lock($lock); |
return ''; # Why return ''? Beats me. |
return ''; # Why return ''? Beats me. |
} |
} |
Line 7752 SCANTRONFORM
|
Line 7714 SCANTRONFORM
|
$ssi_error = 0; # So end of handler error message does not trigger. |
$ssi_error = 0; # So end of handler error message does not trigger. |
$r->print("</form>"); |
$r->print("</form>"); |
&ssi_print_error($r); |
&ssi_print_error($r); |
$r->print(&show_grading_menu_form($symb)); |
|
&Apache::lonnet::remove_lock($lock); |
&Apache::lonnet::remove_lock($lock); |
delete($completedstudents{$uname}); |
delete($completedstudents{$uname}); |
return ''; |
return ''; |
Line 7808 SCANTRONFORM
|
Line 7769 SCANTRONFORM
|
# $r->print("<p>took $lasttime</p>"); |
# $r->print("<p>took $lasttime</p>"); |
|
|
$r->print("</form>"); |
$r->print("</form>"); |
$r->print(&show_grading_menu_form($symb)); |
|
return ''; |
return ''; |
} |
} |
|
|
Line 7944 sub scantron_upload_scantron_data_save {
|
Line 7904 sub scantron_upload_scantron_data_save {
|
!&Apache::lonnet::allowed('usc', |
!&Apache::lonnet::allowed('usc', |
$env{'form.domainid'}.'_'.$env{'form.courseid'})) { |
$env{'form.domainid'}.'_'.$env{'form.courseid'})) { |
$r->print(&mt("You are not allowed to upload bubblesheet data to the requested course.")."<br />"); |
$r->print(&mt("You are not allowed to upload bubblesheet data to the requested course.")."<br />"); |
if ($symb) { |
unless ($symb) { |
$r->print(&show_grading_menu_form($symb)); |
|
} else { |
|
$r->print($doanotherupload); |
$r->print($doanotherupload); |
} |
} |
return ''; |
return ''; |
Line 7974 sub scantron_upload_scantron_data_save {
|
Line 7932 sub scantron_upload_scantron_data_save {
|
} |
} |
} |
} |
if ($symb) { |
if ($symb) { |
$r->print(&scantron_selectphase($r,$uploadedfile)); |
$r->print(&scantron_selectphase($r,$uploadedfile,$symb)); |
} else { |
} else { |
$r->print($doanotherupload); |
$r->print($doanotherupload); |
} |
} |
Line 8087 sub scantron_download_scantron_data {
|
Line 8045 sub scantron_download_scantron_data {
|
'.&mt('The requested file name was invalid.').' |
'.&mt('The requested file name was invalid.').' |
</p> |
</p> |
'); |
'); |
$r->print(&show_grading_menu_form($symb)); |
|
return; |
return; |
} |
} |
my $orig='/uploaded/'.$cdom.'/'.$cname.'/scantron_orig_'.$file; |
my $orig='/uploaded/'.$cdom.'/'.$cname.'/scantron_orig_'.$file; |
Line 8110 sub scantron_download_scantron_data {
|
Line 8067 sub scantron_download_scantron_data {
|
'<a href="'.$skipped.'">','</a>').' |
'<a href="'.$skipped.'">','</a>').' |
</p> |
</p> |
'); |
'); |
$r->print(&show_grading_menu_form($symb)); |
|
return ''; |
return ''; |
} |
} |
|
|
sub checkscantron_results { |
sub checkscantron_results { |
my ($r,$symb) = @_; |
my ($r,$symb) = @_; |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $grading_menu_button=&show_grading_menu_form($symb); |
|
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my %lettdig = &letter_to_digits(); |
my %lettdig = &letter_to_digits(); |
my $numletts = scalar(keys(%lettdig)); |
my $numletts = scalar(keys(%lettdig)); |
Line 8270 sub checkscantron_results {
|
Line 8225 sub checkscantron_results {
|
&Apache::loncommon::end_data_table()).'<br />'. |
&Apache::loncommon::end_data_table()).'<br />'. |
&mt('Differences can occur if submissions were modified using manual grading after a bubblesheet grading pass.').'<br />'.&mt('If unexpected discrepancies were detected, it is recommended that you inspect the original bubblesheets.'); |
&mt('Differences can occur if submissions were modified using manual grading after a bubblesheet grading pass.').'<br />'.&mt('If unexpected discrepancies were detected, it is recommended that you inspect the original bubblesheets.'); |
} |
} |
$r->print('</form><br />'.$grading_menu_button); |
$r->print('</form><br />'); |
return; |
return; |
} |
} |
|
|
Line 8412 sub letter_to_digits {
|
Line 8367 sub letter_to_digits {
|
|
|
#-------------------------- Menu interface ------------------------- |
#-------------------------- Menu interface ------------------------- |
# |
# |
#--- Show a Grading Menu button - Calls the next routine --- |
#--- Href with symb and command --- |
sub show_grading_menu_form { |
|
my ($symb)=@_; |
sub href_symb_cmd { |
my $result.='<br /><form action="/adm/grades" method="post">'."\n". |
my ($symb,$cmd)=@_; |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
return '/adm/grades?symb='.&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb),'<>&"').'&command='.$cmd; |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="command" value="gradingmenu" />'."\n". |
|
'<input type="submit" name="submit" value="'.&mt('Grading Menu').'" />'."\n". |
|
'</form>'."\n"; |
|
return $result; |
|
} |
} |
|
|
sub grading_menu { |
sub grading_menu { |
Line 8429 sub grading_menu {
|
Line 8379 sub grading_menu {
|
if (!$symb) {return '';} |
if (!$symb) {return '';} |
|
|
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb), |
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb), |
'command'=>'individual', |
'command'=>'individual'); |
'gradingMenu'=>1, |
|
'showgrading'=>"yes"); |
|
|
|
my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
Line 8444 sub grading_menu {
|
Line 8392 sub grading_menu {
|
$fields{'command'}='all_for_one'; |
$fields{'command'}='all_for_one'; |
my $url1d=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url1d=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
|
$fields{'command'}='downloadfilesselect'; |
|
my $url1e=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
$fields{'command'} = 'csvform'; |
$fields{'command'} = 'csvform'; |
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
Line 8477 sub grading_menu {
|
Line 8428 sub grading_menu {
|
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
linktitle => 'Grade current resource for all students.' |
linktitle => 'Grade current resource for all students.' |
}, |
}, |
{ linktext => 'Grade complete page/sequence/folder for one student', |
{ linktext => 'Grade page/folder for one student', |
url => $url1d, |
url => $url1d, |
permission => 'F', |
permission => 'F', |
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
linktitle => 'Grade all resources in current page/sequence/folder for one student.' |
linktitle => 'Grade all resources in current page/sequence/folder for one student.' |
|
}, |
|
{ linktext => 'Download submissions', |
|
url => $url1e, |
|
permission => 'F', |
|
icon => 'edit-find-replace.png', |
|
linktitle => 'Download all students submissions.' |
}]}, |
}]}, |
{ categorytitle=>'Automated Grading', |
{ categorytitle=>'Automated Grading', |
items =>[ |
items =>[ |
Line 8504 sub grading_menu {
|
Line 8461 sub grading_menu {
|
icon => 'stat.png', |
icon => 'stat.png', |
linktitle => 'Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.' |
linktitle => 'Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.' |
}, |
}, |
{ linktext => 'Verify Receipt No.', |
{ linktext => 'Verify Receipt Number', |
url => $url5, |
url => $url5, |
permission => 'F', |
permission => 'F', |
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
Line 8518 sub grading_menu {
|
Line 8475 sub grading_menu {
|
my $Str; |
my $Str; |
$Str .= '<form method="post" action="" name="gradingMenu">'; |
$Str .= '<form method="post" action="" name="gradingMenu">'; |
$Str .= '<input type="hidden" name="command" value="" />'. |
$Str .= '<input type="hidden" name="command" value="" />'. |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n"; |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
$Str .= &Apache::lonhtmlcommon::generate_menu(@menu); |
$Str .= &Apache::lonhtmlcommon::generate_menu(@menu); |
return $Str; |
return $Str; |
Line 8539 sub submit_options_sequence {
|
Line 8494 sub submit_options_sequence {
|
my $result; |
my $result; |
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n"; |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
$result.=' |
$result.=' |
<h2> |
<h2> |
'.&mt('Grade complete page/sequence/folder for one student').' |
'.&mt('Grade page/folder for one student').' |
</h2>'. |
</h2>'. |
&selectfield(0). |
&selectfield(0). |
'<input type="hidden" name="command" value="pickStudentPage" /> |
'<input type="hidden" name="command" value="pickStudentPage" /> |
Line 8554 sub submit_options_sequence {
|
Line 8506 sub submit_options_sequence {
|
</div> |
</div> |
</div> |
</div> |
</form>'; |
</form>'; |
$result .= &show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
Line 8565 sub submit_options_table {
|
Line 8516 sub submit_options_table {
|
my $result; |
my $result; |
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n"; |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
$result.=' |
$result.=' |
<h2> |
<h2> |
Line 8580 sub submit_options_table {
|
Line 8529 sub submit_options_table {
|
</div> |
</div> |
</div> |
</div> |
</form>'; |
</form>'; |
$result .= &show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
|
sub submit_options_download { |
|
my ($request,$symb) = @_; |
|
if (!$symb) {return '';} |
|
|
|
&commonJSfunctions($request); |
|
|
|
my $result='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n"; |
|
$result.=' |
|
<h2> |
|
'.&mt('Select Students for Which to Download Submissions').' |
|
</h2>'.&selectfield(1).' |
|
<input type="hidden" name="command" value="downloadfileslink" /> |
|
<input type="submit" value="'.&mt('Next').' →" /> |
|
</div> |
|
</div> |
|
|
|
|
|
</form>'; |
|
return $result; |
|
} |
|
|
#--- Displays the submissions first page ------- |
#--- Displays the submissions first page ------- |
sub submit_options { |
sub submit_options { |
Line 8595 sub submit_options {
|
Line 8563 sub submit_options {
|
my $result; |
my $result; |
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n"; |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
$result.=' |
$result.=' |
<h2> |
<h2> |
'.&mt('Select individual students to grade').' |
'.&mt('Select individual students to grade').' |
Line 8610 sub submit_options {
|
Line 8575 sub submit_options {
|
|
|
|
|
</form>'; |
</form>'; |
$result .= &show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
Line 8822 ENDUPFORM
|
Line 8786 ENDUPFORM
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
|
<input type="file" name="upfile" size="50" /> |
<input type="file" name="upfile" size="50" /> |
<br /><label>$type: $selectform</label> |
<br /><label>$type: $selectform</label> |
<br /><label><input type="radio" name="gradingmechanism" value="attendance"$checked{'attendance'} onclick="sanitycheck()" />$attendance </label> |
<br /><label><input type="radio" name="gradingmechanism" value="attendance"$checked{'attendance'} onclick="sanitycheck()" />$attendance </label> |
Line 8840 ENDUPFORM
|
Line 8803 ENDUPFORM
|
ENDUPFORM |
ENDUPFORM |
$result.='</td></tr></table>'."\n". |
$result.='</td></tr></table>'."\n". |
'</td></tr></table><br /><br />'."\n"; |
'</td></tr></table><br /><br />'."\n"; |
$result.=&show_grading_menu_form($symb); |
|
return $result; |
return $result; |
} |
} |
|
|
Line 8854 sub process_clicker_file {
|
Line 8816 sub process_clicker_file {
|
my $result=''; |
my $result=''; |
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) { |
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) { |
$result.='<span class="LC_error">'.&mt('You need to specify a clicker ID for the correct answer').'</span>'; |
$result.='<span class="LC_error">'.&mt('You need to specify a clicker ID for the correct answer').'</span>'; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
if (($env{'form.gradingmechanism'} eq 'given') && ($env{'form.givenanswer'}!~/\S/)) { |
if (($env{'form.gradingmechanism'} eq 'given') && ($env{'form.givenanswer'}!~/\S/)) { |
$result.='<span class="LC_error">'.&mt('You need to specify the correct answer').'</span>'; |
$result.='<span class="LC_error">'.&mt('You need to specify the correct answer').'</span>'; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
my $foundgiven=0; |
my $foundgiven=0; |
if ($env{'form.gradingmechanism'} eq 'given') { |
if ($env{'form.gradingmechanism'} eq 'given') { |
Line 8905 sub process_clicker_file {
|
Line 8867 sub process_clicker_file {
|
$result.="</p>\n"; |
$result.="</p>\n"; |
if ($number==0) { |
if ($number==0) { |
$result.='<span class="LC_error">'.&mt('No IDs found to determine correct answer').'</span>'; |
$result.='<span class="LC_error">'.&mt('No IDs found to determine correct answer').'</span>'; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
} |
} |
if (length($env{'form.upfile'}) < 2) { |
if (length($env{'form.upfile'}) < 2) { |
Line 8913 sub process_clicker_file {
|
Line 8875 sub process_clicker_file {
|
'<span class="LC_error">', |
'<span class="LC_error">', |
'</span>', |
'</span>', |
'<span class="LC_filename">'.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').'</span>'); |
'<span class="LC_filename">'.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').'</span>'); |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
|
|
# Were able to get all the info needed, now analyze the file |
# Were able to get all the info needed, now analyze the file |
Line 8928 sub process_clicker_file {
|
Line 8890 sub process_clicker_file {
|
<form method="post" action="/adm/grades" name="clickeranalysis"> |
<form method="post" action="/adm/grades" name="clickeranalysis"> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="command" value="assignclickergrades" /> |
<input type="hidden" name="command" value="assignclickergrades" /> |
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
|
<input type="hidden" name="gradingmechanism" value="$env{'form.gradingmechanism'}" /> |
<input type="hidden" name="gradingmechanism" value="$env{'form.gradingmechanism'}" /> |
<input type="hidden" name="pcorrect" value="$env{'form.pcorrect'}" /> |
<input type="hidden" name="pcorrect" value="$env{'form.pcorrect'}" /> |
<input type="hidden" name="pincorrect" value="$env{'form.pincorrect'}" /> |
<input type="hidden" name="pincorrect" value="$env{'form.pincorrect'}" /> |
Line 8953 ENDHEADER
|
Line 8914 ENDHEADER
|
'<br />'; |
'<br />'; |
if (($env{'form.gradingmechanism'} eq 'given') && ($number!=$foundgiven)) { |
if (($env{'form.gradingmechanism'} eq 'given') && ($number!=$foundgiven)) { |
$result.='<span class="LC_error">'.&mt('Number of given answers does not agree with number of questions in file.').'</span>'; |
$result.='<span class="LC_error">'.&mt('Number of given answers does not agree with number of questions in file.').'</span>'; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
# Remember Question Titles |
# Remember Question Titles |
# FIXME: Possibly need delimiter other than ":" |
# FIXME: Possibly need delimiter other than ":" |
Line 9015 ENDHEADER
|
Line 8976 ENDHEADER
|
} |
} |
$result.='</form></td></tr></table>'."\n". |
$result.='</form></td></tr></table>'."\n". |
'</td></tr></table><br /><br />'."\n"; |
'</td></tr></table><br /><br />'."\n"; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
|
|
sub iclicker_eval { |
sub iclicker_eval { |
Line 9185 ENDHEADER
|
Line 9146 ENDHEADER
|
$result.='<br />'.&mt('Successfully stored grades for [quant,_1,student].',$storecount). |
$result.='<br />'.&mt('Successfully stored grades for [quant,_1,student].',$storecount). |
'</td></tr></table>'."\n". |
'</td></tr></table>'."\n". |
'</td></tr></table><br /><br />'."\n"; |
'</td></tr></table><br /><br />'."\n"; |
return $result.&show_grading_menu_form($symb); |
return $result; |
} |
} |
|
|
sub navmap_errormsg { |
sub navmap_errormsg { |
Line 9196 sub navmap_errormsg {
|
Line 9157 sub navmap_errormsg {
|
} |
} |
|
|
sub startpage { |
sub startpage { |
my ($r,$symb,$crumbs,$onlyfolderflag) = @_; |
my ($r,$symb,$crumbs,$onlyfolderflag,$nodisplayflag) = @_; |
my $breadcrumbs= [{href=>"/adm/grades?command=gradingmenu&symb=".&HTML::Entities::encode($symb,'<>&"'),text=>"Grading"}]; |
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); |
# if ($crumbs) { |
|
# push(@$breadcrumbs,$crumbs); |
|
# } |
|
$r->print(&Apache::loncommon::start_page('Grading',undef, |
$r->print(&Apache::loncommon::start_page('Grading',undef, |
{'bread_crumbs' => $breadcrumbs})); |
{'bread_crumbs' => $crumbs})); |
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag)); |
unless ($nodisplayflag) { |
|
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag)); |
|
} |
|
} |
|
|
|
sub select_problem { |
|
my ($r)=@_; |
|
$r->print('<h2>'.&mt('Select the problem or one of the problems you want to grade').'</h2><form action="/adm/grades">'); |
|
$r->print(&Apache::lonstathelpers::problem_selector('.',undef,1)); |
|
$r->print('<input type="hidden" name="command" value="gradingmenu" />'); |
|
$r->print('<input type="submit" value="'.&mt('Next').' →" /></form>'); |
} |
} |
|
|
sub handler { |
sub handler { |
Line 9237 sub handler {
|
Line 9205 sub handler {
|
&Apache::lonenc::check_decrypt(\$symb); |
&Apache::lonenc::check_decrypt(\$symb); |
|
|
$ssi_error = 0; |
$ssi_error = 0; |
if ($symb eq '' && $command eq '') { |
if ($symb eq '' || $command eq '') { |
# |
# |
# Not called from a resource |
# Not called from a resource |
# |
# |
|
&startpage($request,undef,[],1,1); |
|
&select_problem($request); |
} else { |
} else { |
&init_perm(); |
&init_perm(); |
if ($command eq 'submission' && $perm{'vgr'}) { |
if ($command eq 'submission' && $perm{'vgr'}) { |
&startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]); |
&startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]); |
($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 '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); |
&pickStudentPage($request,$symb); |
} elsif ($command eq 'displayPage' && $perm{'vgr'}) { |
} 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); |
&displayPage($request,$symb); |
&displayPage($request,$symb); |
} elsif ($command eq 'gradeByPage' && $perm{'mgr'}) { |
} 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); |
&updateGradeByPage($request,$symb); |
} elsif ($command eq 'processGroup' && $perm{'vgr'}) { |
} elsif ($command eq 'processGroup' && $perm{'vgr'}) { |
|
&startpage($request,$symb,[{href=>'',text=>'...'}, |
|
{href=>'',text=>'Modify grades'}]); |
&processGroup($request,$symb); |
&processGroup($request,$symb); |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
&startpage($request,$symb); |
&startpage($request,$symb); |
$request->print(&grading_menu($request,$symb)); |
$request->print(&grading_menu($request,$symb)); |
} elsif ($command eq 'individual' && $perm{'vgr'}) { |
} 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'}) { |
} elsif ($command eq 'ungraded' && $perm{'vgr'}) { |
$request->print(&submit_options($request,$symb)); |
&startpage($request,$symb,[{href=>'',text=>'Grade ungraded submissions'}]); |
|
$request->print(&listStudents($request,$symb,'graded')); |
} elsif ($command eq 'table' && $perm{'vgr'}) { |
} elsif ($command eq 'table' && $perm{'vgr'}) { |
$request->print(&submit_options_table($request),$symb); |
&startpage($request,$symb,[{href=>"", text=>"Grading table"}]); |
|
$request->print(&submit_options_table($request,$symb)); |
} elsif ($command eq 'all_for_one' && $perm{'vgr'}) { |
} 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)); |
$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)); |
$request->print(&viewgrades($request,$symb)); |
} elsif ($command eq 'handgrade' && $perm{'mgr'}) { |
} elsif ($command eq 'handgrade' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'',text=>'...'}, |
|
{href=>'',text=>'Store grades'}]); |
$request->print(&processHandGrade($request,$symb)); |
$request->print(&processHandGrade($request,$symb)); |
} elsif ($command eq 'editgrades' && $perm{'mgr'}) { |
} 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'}) { |
} elsif ($command eq 'initialverifyreceipt' && $perm{'vgr'}) { |
$request->print(&initialverifyreceipt($request),$symb); |
&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'}) { |
} elsif ($command eq 'processclicker' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'', text=>'Process clicker'}]); |
$request->print(&process_clicker($request,$symb)); |
$request->print(&process_clicker($request,$symb)); |
} elsif ($command eq 'processclickerfile' && $perm{'mgr'}) { |
} elsif ($command eq 'processclickerfile' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>&href_symb_cmd($symb,'processclicker'), text=>'Process clicker'}, |
|
{href=>'', text=>'Process clicker file'}]); |
$request->print(&process_clicker_file($request,$symb)); |
$request->print(&process_clicker_file($request,$symb)); |
} elsif ($command eq 'assignclickergrades' && $perm{'mgr'}) { |
} elsif ($command eq 'assignclickergrades' && $perm{'mgr'}) { |
|
&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)); |
$request->print(&assign_clicker_grades($request,$symb)); |
} elsif ($command eq 'csvform' && $perm{'mgr'}) { |
} elsif ($command eq 'csvform' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&upcsvScores_form($request,$symb)); |
$request->print(&upcsvScores_form($request,$symb)); |
} elsif ($command eq 'csvupload' && $perm{'mgr'}) { |
} elsif ($command eq 'csvupload' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&csvupload($request,$symb)); |
$request->print(&csvupload($request,$symb)); |
} elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) { |
} elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&csvuploadmap($request,$symb)); |
$request->print(&csvuploadmap($request,$symb)); |
} elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) { |
} elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) { |
if ($env{'form.associate'} ne 'Reverse Association') { |
if ($env{'form.associate'} ne 'Reverse Association') { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&csvuploadoptions($request,$symb)); |
$request->print(&csvuploadoptions($request,$symb)); |
} else { |
} else { |
if ( $env{'form.upfile_associate'} ne 'reverse' ) { |
if ( $env{'form.upfile_associate'} ne 'reverse' ) { |
Line 9297 sub handler {
|
Line 9302 sub handler {
|
} else { |
} else { |
$env{'form.upfile_associate'} = 'forward'; |
$env{'form.upfile_associate'} = 'forward'; |
} |
} |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&csvuploadmap($request,$symb)); |
$request->print(&csvuploadmap($request,$symb)); |
} |
} |
} elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) { |
} elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&csvuploadassign($request,$symb)); |
$request->print(&csvuploadassign($request,$symb)); |
} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) { |
} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) { |
$request->print(&scantron_selectphase($request,$symb)); |
&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'}) { |
} 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)); |
$request->print(&scantron_do_warning($request,$symb)); |
} elsif ($command eq 'scantron_validate' && $perm{'mgr'}) { |
} elsif ($command eq 'scantron_validate' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&scantron_validate_file($request,$symb)); |
$request->print(&scantron_validate_file($request,$symb)); |
} elsif ($command eq 'scantron_process' && $perm{'mgr'}) { |
} elsif ($command eq 'scantron_process' && $perm{'mgr'}) { |
|
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&scantron_process_students($request,$symb)); |
$request->print(&scantron_process_students($request,$symb)); |
} elsif ($command eq 'scantronupload' && |
} elsif ($command eq 'scantronupload' && |
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})|| |
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})|| |
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) { |
&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($request,$symb)); |
$request->print(&scantron_upload_scantron_data($request,$symb)); |
} elsif ($command eq 'scantronupload_save' && |
} elsif ($command eq 'scantronupload_save' && |
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})|| |
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})|| |
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) { |
&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)); |
$request->print(&scantron_upload_scantron_data_save($request,$symb)); |
} elsif ($command eq 'scantron_download' && |
} elsif ($command eq 'scantron_download' && |
&Apache::lonnet::allowed('usc',$env{'request.course.id'})) { |
&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'}) { |
} elsif ($command eq 'checksubmissions' && $perm{'vgr'}) { |
$request->print(&checkscantron_results($request,$symb)); |
&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) { |
} elsif ($command) { |
|
&startpage($request,$symb,[{href=>'', text=>'Access denied'}]); |
$request->print('<p class="LC_error">'.&mt('Access Denied ([_1])',$command).'</p>'); |
$request->print('<p class="LC_error">'.&mt('Access Denied ([_1])',$command).'</p>'); |
} |
} |
} |
} |