version 1.620, 2010/04/16 18:29:33
|
version 1.634, 2010/05/03 10:51:22
|
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 818 sub listStudents {
|
Line 820 sub listStudents {
|
$submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'}; |
$submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'}; |
} |
} |
|
|
my $result='<h3><span class="LC_info"> ' |
my $result=''; |
.&mt("View/Grade/Regrade Submissions for a Student or a Group of Students") |
my $res_error; |
.'</span></h3>'; |
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
|
|
my ($partlist,$handgrade,$responseType) = &response_type($symb |
|
#,$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 862 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 878 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" /> '. |
&mt('last submission & parts info').' </label></span>'."\n". |
&mt('last submission & parts info').' </label></span>'."\n". |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<label><input type="radio" name="lastSub" value="datesub" /> '. |
'<label><input type="radio" name="lastSub" value="datesub" checked="checked" /> '. |
&mt('by dates and submissions').'</label></span>'."\n". |
&mt('by dates and submissions').'</label></span>'."\n". |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<label><input type="radio" name="lastSub" value="all" /> '. |
'<label><input type="radio" name="lastSub" value="all" /> '. |
Line 918 LISTJAVASCRIPT
|
Line 910 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="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"; |
|
|
Line 1276 sub sub_page_js {
|
Line 1267 sub sub_page_js {
|
} |
} |
|
|
} |
} |
if (val == "Grade Student") { |
|
if (formname.Status.value == "") { |
|
formname.Status.value = "Active"; |
|
} |
|
formname.studentNo.value = total; |
|
} |
|
formname.submit(); |
formname.submit(); |
} |
} |
|
|
Line 1330 sub sub_page_kw_js {
|
Line 1315 sub sub_page_kw_js {
|
my $iconpath = $request->dir_config('lonIconsURL'); |
my $iconpath = $request->dir_config('lonIconsURL'); |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
|
|
my $inner_js_msg_central= &Apache::lonhtmlcommon::scripttag(<<INNERJS); |
my $inner_js_msg_central= (<<INNERJS); |
|
<script type="text/javascript"> |
function checkInput() { |
function checkInput() { |
opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value); |
opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value); |
var nmsg = opener.document.SCORE.savemsgN.value; |
var nmsg = opener.document.SCORE.savemsgN.value; |
Line 1367 sub sub_page_kw_js {
|
Line 1353 sub sub_page_kw_js {
|
self.close() |
self.close() |
|
|
} |
} |
|
</script> |
INNERJS |
INNERJS |
|
|
my $inner_js_highlight_central= &Apache::lonhtmlcommon::scripttag(<<INNERJS); |
my $inner_js_highlight_central= (<<INNERJS); |
|
<script type="text/javascript"> |
function updateChoice(flag) { |
function updateChoice(flag) { |
opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr); |
opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr); |
opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize); |
opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize); |
Line 1380 INNERJS
|
Line 1368 INNERJS
|
} |
} |
self.close() |
self.close() |
} |
} |
|
</script> |
INNERJS |
INNERJS |
|
|
my $start_page_msg_central = |
my $start_page_msg_central = |
Line 1740 sub gradeBox {
|
Line 1729 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 1845 sub files_exist {
|
Line 1834 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 1857 sub download_all_link {
|
Line 1851 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 1903 sub submission {
|
Line 1904 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>'); |
|
|
|
# option to display problem, only once else it cause problems |
# option to display problem, only once else it cause problems |
# with the form later since the problem has a form. |
# with the form later since the problem has a form. |
Line 1927 sub submission {
|
Line 1924 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 1954 sub submission {
|
'<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 1984 sub submission {
|
Line 1982 sub submission {
|
} |
} |
$request->print($prnmsg); |
$request->print($prnmsg); |
|
|
if ($env{'form.handgrade'} eq 'yes') { |
# if ($env{'form.handgrade'} eq 'yes') { |
|
if (1) { |
# |
# |
# Print out the keyword options line |
# Print out the keyword options line |
# |
# |
Line 2060 KEYWORDS
|
Line 2059 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 2069 KEYWORDS
|
Line 2069 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 2120 KEYWORDS
|
Line 2121 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 2165 KEYWORDS
|
Line 2166 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 2196 KEYWORDS
|
Line 2197 KEYWORDS
|
} |
} |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
my ($parts,$handgrade,$responseType) = &response_type($symb); |
my ($parts,$handgrade,$responseType) = &response_type($symb,\$res_error); |
$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 2204 KEYWORDS
|
Line 2205 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 |
# FIXME: the logic seems off here. Why show the grade button if you cannot grade? |
|
if (!&canmodify($usec)) { |
if (!&canmodify($usec)) { |
my $toGrade.='<input type="button" value="Grade Student" '. |
$request->print('<p><span class="LC_warning">'.&mt('No grading privileges').'</span></p></div>'); |
'onclick="javascript:checksubmit(this.form,\'Grade Student\',\'' |
|
.$counter.'\');" target="_self" /> '."\n" if (&canmodify($usec)); |
|
$toGrade.='</div>'."\n"; |
|
$request->print($toGrade); |
|
return; |
return; |
} else { |
} else { |
$request->print('</div>'."\n"); |
$request->print('</div>'."\n"); |
} |
} |
|
|
# 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 sub check_collaborators {
|
Line 2327 sub check_collaborators {
|
next if ($record->{'resource.'.$part.'.collaborators'} eq ''); |
next if ($record->{'resource.'.$part.'.collaborators'} eq ''); |
my (@good_collaborators, @bad_collaborators); |
my (@good_collaborators, @bad_collaborators); |
foreach my $possible_collaborator |
foreach my $possible_collaborator |
(split(/,?\s+/,$record->{'resource.'.$part.'.collaborators'})) { |
(split(/[,;\s]+/,$record->{'resource.'.$part.'.collaborators'})) { |
$possible_collaborator =~ s/[\$\^\(\)]//g; |
$possible_collaborator =~ s/[\$\^\(\)]//g; |
next if ($possible_collaborator eq ''); |
next if ($possible_collaborator eq ''); |
my ($co_name,$co_dom) = split(/\@|:/,$possible_collaborator); |
my ($co_name,$co_dom) = split(/:/,$possible_collaborator); |
$co_dom = $udom if (! defined($co_dom) || $co_dom =~ /^domain$/i); |
$co_dom = $udom if (! defined($co_dom) || $co_dom =~ /^domain$/i); |
next if ($co_name eq $uname && $co_dom eq $udom); |
next if ($co_name eq $uname && $co_dom eq $udom); |
# Doing this grep allows 'fuzzy' specification |
# Doing this grep allows 'fuzzy' specification |
Line 2347 sub check_collaborators {
|
Line 2343 sub check_collaborators {
|
} |
} |
} |
} |
if (scalar(@good_collaborators) != 0) { |
if (scalar(@good_collaborators) != 0) { |
$result.='<br />'.&mt('Collaborators: '); |
$result.='<br />'.&mt('Collaborators:').'<ol>'; |
foreach my $name (@good_collaborators) { |
foreach my $name (@good_collaborators) { |
my ($lastname,$givenn) = split(/,/,$$fullname{$name}); |
my ($lastname,$givenn) = split(/,/,$$fullname{$name}); |
push(@col_fullnames, $givenn.' '.$lastname); |
push(@col_fullnames, $givenn.' '.$lastname); |
$result.=$fullname->{$name}.' '; |
$result.='<li>'.$fullname->{$name}.'</li>'; |
} |
} |
$result.='<br />'."\n"; |
$result.='</ol><br />'."\n"; |
my ($part)=split(/\./,$part); |
my ($part)=split(/\./,$part); |
$result.='<input type="hidden" name="collaborator'.$counter. |
$result.='<input type="hidden" name="collaborator'.$counter. |
'" value="'.$part.':'.(join ':',@good_collaborators).'" />'. |
'" value="'.$part.':'.(join ':',@good_collaborators).'" />'. |
Line 2526 sub processHandGrade {
|
Line 2522 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 2579 sub processHandGrade {
|
Line 2576 sub processHandGrade {
|
my $processUser = $env{'form.unamedom'.$ctr}; |
my $processUser = $env{'form.unamedom'.$ctr}; |
($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}; |
&submission($request,$ctr,$total-1); |
&submission($request,$ctr,$total-1,$symb); |
$ctr++; |
$ctr++; |
} |
} |
return ''; |
return ''; |
} |
} |
|
|
# Go directly to grade student - from submission or link from chart page |
|
if ($button eq 'Grade Student') { |
|
# (undef,undef,$env{'form.handgrade'},undef,undef) = &showResourceInfo($symb); |
|
my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}}; |
|
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser); |
|
$env{'form.fullname'} = $$fullname{$processUser}; |
|
&submission($request,0,0); |
|
return ''; |
|
} |
|
|
|
# Get the next/previous one or group of students |
# Get the next/previous one or group of students |
my $firststu = $env{'form.unamedom0'}; |
my $firststu = $env{'form.unamedom0'}; |
my $laststu = $env{'form.unamedom'.($ngrade-1)}; |
my $laststu = $env{'form.unamedom'.($ngrade-1)}; |
Line 2678 sub processHandGrade {
|
Line 2665 sub processHandGrade {
|
$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++; |
} |
} |
if ($total < 0) { |
if ($total < 0) { |
my $the_end = '<h3><span class="LC_info">'.&mt('LON-CAPA User Message').'</span></h3><br />'."\n"; |
my $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"; |
|
$request->print($the_end); |
$request->print($the_end); |
} |
} |
return ''; |
return ''; |
Line 3364 sub viewgrades {
|
Line 3349 sub viewgrades {
|
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
my ($partid) = &split_part_type($part); |
my ($partid) = &split_part_type($part); |
push(@partids,$partid); |
push(@partids,$partid); |
|
# |
|
# FIXME: Looks like $display looks at English text |
|
# |
my $display_part=&get_display_part($partid,$symb); |
my $display_part=&get_display_part($partid,$symb); |
if ($display =~ /^Partial Credit Factor/) { |
if ($display =~ /^Partial Credit Factor/) { |
$result.='<th>'. |
$result.='<th>'. |
Line 3810 sub csvuploadmap_header {
|
Line 3798 sub csvuploadmap_header {
|
$javascript=&csvupload_javascript_forward_associate(); |
$javascript=&csvupload_javascript_forward_associate(); |
} |
} |
|
|
my $result=''; |
|
my $checked=(($env{'form.noFirstLine'})?' checked="checked"':''); |
|
my $ignore=&mt('Ignore First Line'); |
|
$symb = &Apache::lonenc::check_encrypt($symb); |
$symb = &Apache::lonenc::check_encrypt($symb); |
|
$request->print('<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">'. |
|
&mt('Total number of records found in file: [_1]',$distotal).'<hr />'. |
|
&mt('Associate entries from the uploaded file with as many fields as you can.')); |
|
my $reverse=&mt("Reverse Association"); |
$request->print(<<ENDPICK); |
$request->print(<<ENDPICK); |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<br /> |
<h3><span class="LC_info">Uploading Class Grades</span></h3> |
<input type="button" value="$reverse" onclick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" /> |
$result |
|
<hr /> |
|
<h3>Identify fields</h3> |
|
Total number of records found in file: $distotal <hr /> |
|
Enter as many fields as you can. The system will inform you and bring you back |
|
to this page if the data selected is insufficient to run your class.<hr /> |
|
<input type="button" value="Reverse Association" onclick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" /> |
|
<label><input type="checkbox" name="noFirstLine" $checked />$ignore</label> |
|
<input type="hidden" name="associate" value="" /> |
<input type="hidden" name="associate" value="" /> |
<input type="hidden" name="phase" value="three" /> |
<input type="hidden" name="phase" value="three" /> |
<input type="hidden" name="datatoken" value="$datatoken" /> |
<input type="hidden" name="datatoken" value="$datatoken" /> |
Line 3880 ENDPICK
|
Line 3861 ENDPICK
|
} |
} |
|
|
sub checkforfile_js { |
sub checkforfile_js { |
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.'); |
my $alertmsg = &mt('Please use the "Choose File" button to select a file from your local directory.'); |
my $result = &Apache::lonhtmlcommon::scripttag(<<CSVFORMJS); |
my $result = &Apache::lonhtmlcommon::scripttag(<<CSVFORMJS); |
function checkUpload(formname) { |
function checkUpload(formname) { |
if (formname.upfile.value == "") { |
if (formname.upfile.value == "") { |
Line 3897 sub upcsvScores_form {
|
Line 3878 sub upcsvScores_form {
|
my ($request,$symb) = @_; |
my ($request,$symb) = @_; |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $result=&checkforfile_js(); |
my $result=&checkforfile_js(); |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.=&Apache::loncommon::start_data_table(). |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
&Apache::loncommon::start_data_table_header_row(). |
$result.=' <b>'.&mt('Specify a file containing the class scores for current resource.'). |
'<th>'.&mt('Specify a file containing the class scores for current resource.').'</th>'. |
'</b></td></tr>'."\n"; |
&Apache::loncommon::end_data_table_header_row(). |
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
&Apache::loncommon::start_data_table_row().'<td>'; |
my $upload=&mt("Upload Scores"); |
my $upload=&mt("Upload Scores"); |
my $upfile_select=&Apache::loncommon::upfile_select_html(); |
my $upfile_select=&Apache::loncommon::upfile_select_html(); |
my $ignore=&mt('Ignore First Line'); |
my $ignore=&mt('Ignore First Line'); |
Line 3912 sub upcsvScores_form {
|
Line 3893 sub upcsvScores_form {
|
<input type="hidden" name="command" value="csvuploadmap" /> |
<input type="hidden" name="command" value="csvuploadmap" /> |
$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> |
|
</form> |
</form> |
ENDUPFORM |
ENDUPFORM |
$result.=&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
$result.=&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
&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>'. |
$result.='</td></tr></table><br /><br />'."\n"; |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
|
|
Line 3935 sub csvuploadmap {
|
Line 3916 sub csvuploadmap {
|
&Apache::loncommon::load_tmp_file($request); |
&Apache::loncommon::load_tmp_file($request); |
} |
} |
my @records=&Apache::loncommon::upfile_record_sep(); |
my @records=&Apache::loncommon::upfile_record_sep(); |
if ($env{'form.noFirstLine'}) { shift(@records); } |
|
&csvuploadmap_header($request,$symb,$datatoken,$#records+1); |
&csvuploadmap_header($request,$symb,$datatoken,$#records+1); |
my ($i,$keyfields); |
my ($i,$keyfields); |
if (@records) { |
if (@records) { |
Line 3971 sub csvuploadmap {
|
Line 3951 sub csvuploadmap {
|
|
|
sub csvuploadoptions { |
sub csvuploadoptions { |
my ($request,$symb)= @_; |
my ($request,$symb)= @_; |
my $checked=(($env{'form.noFirstLine'})?'1':'0'); |
my $overwrite=&mt('Overwrite any existing score'); |
my $ignore=&mt('Ignore First Line'); |
|
$request->print(<<ENDPICK); |
$request->print(<<ENDPICK); |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<h3><span class="LC_info">Uploading Class Grade Options</span></h3> |
|
<input type="hidden" name="command" value="csvuploadassign" /> |
<input type="hidden" name="command" value="csvuploadassign" /> |
<!-- |
|
<p> |
|
<label> |
|
<input type="checkbox" name="show_full_results" /> |
|
Show a table of all changes |
|
</label> |
|
</p> |
|
--> |
|
<p> |
<p> |
<label> |
<label> |
<input type="checkbox" name="overwite_scores" checked="checked" /> |
<input type="checkbox" name="overwite_scores" checked="checked" /> |
Overwrite any existing score |
$overwrite |
</label> |
</label> |
</p> |
</p> |
ENDPICK |
ENDPICK |
my %fields=&get_fields(); |
my %fields=&get_fields(); |
if (!defined($fields{'domain'})) { |
if (!defined($fields{'domain'})) { |
my $domform = &Apache::loncommon::select_dom_form($env{'request.role.domain'},'default_domain'); |
my $domform = &Apache::loncommon::select_dom_form($env{'request.role.domain'},'default_domain'); |
$request->print("\n<p> Users are in domain: ".$domform."</p>\n"); |
$request->print("\n<p>".&mt('Users are in domain: [_1]',$domform)."</p>\n"); |
} |
} |
foreach my $key (sort(keys(%env))) { |
foreach my $key (sort(keys(%env))) { |
if ($key !~ /^form\.(.*)$/) { next; } |
if ($key !~ /^form\.(.*)$/) { next; } |
Line 4034 sub csvuploadassign {
|
Line 4004 sub csvuploadassign {
|
my $error_msg = ''; |
my $error_msg = ''; |
&Apache::loncommon::load_tmp_file($request); |
&Apache::loncommon::load_tmp_file($request); |
my @gradedata = &Apache::loncommon::upfile_record_sep(); |
my @gradedata = &Apache::loncommon::upfile_record_sep(); |
if ($env{'form.noFirstLine'}) { shift(@gradedata); } |
|
my %fields=&get_fields(); |
my %fields=&get_fields(); |
$request->print('<h3>Assigning Grades</h3>'); |
|
my $courseid=$env{'request.course.id'}; |
my $courseid=$env{'request.course.id'}; |
my ($classlist) = &getclasslist('all',0); |
my ($classlist) = &getclasslist('all',0); |
my @notallowed; |
my @notallowed; |
Line 4116 sub csvuploadassign {
|
Line 4084 sub csvuploadassign {
|
$env{'request.course.id'}, |
$env{'request.course.id'}, |
$domain,$username); |
$domain,$username); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
|
# Successfully stored |
$request->print('.'); |
$request->print('.'); |
} else { |
# Remove from grading queue |
|
&Apache::bridgetask::remove_from_queue('gradingqueue',$symb, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
|
$domain,$username); |
|
$countdone++; |
|
} else { |
$request->print("<p><span class=\"LC_error\">". |
$request->print("<p><span class=\"LC_error\">". |
&mt("Failed to save data for student [_1]. Message when trying to save was: [_2]", |
&mt("Failed to save data for student [_1]. Message when trying to save was: [_2]", |
"$username:$domain",$result)."</span></p>"); |
"$username:$domain",$result)."</span></p>"); |
} |
} |
$request->rflush(); |
$request->rflush(); |
$countdone++; |
|
} |
} |
} |
} |
$request->print('<br />'.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0)); |
$request->print('<br />'.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0)); |
Line 4519 sub displaySubByDates {
|
Line 4493 sub displaySubByDates {
|
$displaySub[0].='<span class="LC_nobreak"'; |
$displaySub[0].='<span class="LC_nobreak"'; |
$displaySub[0].='<b>'.&mt('Part: [_1]',$display_part).'</b>' |
$displaySub[0].='<b>'.&mt('Part: [_1]',$display_part).'</b>' |
.' <span class="LC_internal_info">' |
.' <span class="LC_internal_info">' |
.'('.&mt('Part ID: [_1]',$responseId).')' |
.'('.&mt('Response ID: [_1]',$responseId).')' |
.'</span>' |
.'</span>' |
.' <b>'; |
.' <b>'; |
if ($hidden) { |
if ($hidden) { |
Line 8386 sub grading_menu {
|
Line 8360 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 8424 sub grading_menu {
|
Line 8401 sub grading_menu {
|
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 8480 sub submit_options_sequence {
|
Line 8463 sub submit_options_sequence {
|
|
|
$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"; |
$result.=' |
$result.=&selectfield(0). |
<h2> |
|
'.&mt('Grade page/folder for one student').' |
|
</h2>'. |
|
&selectfield(0). |
|
'<input type="hidden" name="command" value="pickStudentPage" /> |
'<input type="hidden" name="command" value="pickStudentPage" /> |
<div> |
<div> |
<input type="submit" value="'.&mt('Next').' →" /> |
<input type="submit" value="'.&mt('Next').' →" /> |
Line 8503 sub submit_options_table {
|
Line 8482 sub submit_options_table {
|
$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"; |
|
|
$result.=' |
$result.=&selectfield(0). |
<h2> |
|
'.&mt('Grading table').' |
|
</h2>'. |
|
&selectfield(0). |
|
'<input type="hidden" name="command" value="viewgrades" /> |
'<input type="hidden" name="command" value="viewgrades" /> |
<div> |
<div> |
<input type="submit" value="'.&mt('Next').' →" /> |
<input type="submit" value="'.&mt('Next').' →" /> |
Line 8517 sub submit_options_table {
|
Line 8492 sub submit_options_table {
|
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 8529 sub submit_options {
|
Line 8524 sub submit_options {
|
|
|
$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"; |
$result.=' |
$result.=&selectfield(1).' |
<h2> |
|
'.&mt('Select individual students to grade').' |
|
</h2>'.&selectfield(1).' |
|
<input type="hidden" name="command" value="submission" /> |
<input type="hidden" name="command" value="submission" /> |
<input type="submit" value="'.&mt('Next').' →" /> |
<input type="submit" value="'.&mt('Next').' →" /> |
</div> |
</div> |
Line 8674 sub process_clicker {
|
Line 8666 sub process_clicker {
|
my ($r,$symb)=@_; |
my ($r,$symb)=@_; |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $result=&checkforfile_js(); |
my $result=&checkforfile_js(); |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.=&Apache::loncommon::start_data_table(). |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
&Apache::loncommon::start_data_table_header_row(). |
$result.=' <b>'.&mt('Specify a file containing the clicker information for this resource.'). |
'<th>'.&mt('Specify a file containing clicker information and set grading options.').'</th>'. |
'</b></td></tr>'."\n"; |
&Apache::loncommon::end_data_table_header_row(). |
$result.='<tr bgcolor="#ffffe6"><td>'."\n"; |
&Apache::loncommon::start_data_table_row()."<td>\n"; |
# Attempt to restore parameters from last session, set defaults if not present |
# Attempt to restore parameters from last session, set defaults if not present |
my %Saveable_Parameters=&clicker_grading_parameters(); |
my %Saveable_Parameters=&clicker_grading_parameters(); |
&Apache::loncommon::restore_course_settings('grades_clicker', |
&Apache::loncommon::restore_course_settings('grades_clicker', |
Line 8695 sub process_clicker {
|
Line 8687 sub process_clicker {
|
} |
} |
} |
} |
|
|
my $upload=&mt("Upload File"); |
my $upload=&mt("Evaluate File"); |
my $type=&mt("Type"); |
my $type=&mt("Type"); |
my $attendance=&mt("Award points just for participation"); |
my $attendance=&mt("Award points just for participation"); |
my $personnel=&mt("Correctness determined from response by course personnel"); |
my $personnel=&mt("Correctness determined from response by course personnel"); |
Line 8753 ENDUPFORM
|
Line 8745 ENDUPFORM
|
<input type="hidden" name="command" value="processclickerfile" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
<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> |
ENDUPFORM |
|
$result.='</td>'.&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::start_data_table_row().'<td>'.(<<ENDGRADINGFORM); |
|
<label><input type="radio" name="gradingmechanism" value="attendance"$checked{'attendance'} onclick="sanitycheck()" />$attendance </label> |
<br /><label><input type="radio" name="gradingmechanism" value="personnel"$checked{'personnel'} onclick="sanitycheck()" />$personnel</label> |
<br /><label><input type="radio" name="gradingmechanism" value="personnel"$checked{'personnel'} onclick="sanitycheck()" />$personnel</label> |
<br /><label><input type="radio" name="gradingmechanism" value="specific"$checked{'specific'} onclick="sanitycheck()" />$specific </label> |
<br /><label><input type="radio" name="gradingmechanism" value="specific"$checked{'specific'} onclick="sanitycheck()" />$specific </label> |
<input type="text" name="specificid" value="$env{'form.specificid'}" size="20" /> |
<input type="text" name="specificid" value="$env{'form.specificid'}" size="20" /> |
Line 8761 ENDUPFORM
|
Line 8756 ENDUPFORM
|
<br /> |
<br /> |
<input type="text" name="givenanswer" size="50" /> |
<input type="text" name="givenanswer" size="50" /> |
<input type="hidden" name="waschecked" value="$env{'form.gradingmechanism'}" /> |
<input type="hidden" name="waschecked" value="$env{'form.gradingmechanism'}" /> |
<br /><label>$pcorrect: <input type="text" name="pcorrect" size="4" value="$env{'form.pcorrect'}" onchange="sanitycheck()" /></label> |
ENDGRADINGFORM |
|
$result.='</td>'.&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::start_data_table_row().'<td>'.(<<ENDPERCFORM); |
|
<label>$pcorrect: <input type="text" name="pcorrect" size="4" value="$env{'form.pcorrect'}" onchange="sanitycheck()" /></label> |
<br /><label>$pincorrect: <input type="text" name="pincorrect" size="4" value="$env{'form.pincorrect'}" onchange="sanitycheck()" /></label> |
<br /><label>$pincorrect: <input type="text" name="pincorrect" size="4" value="$env{'form.pincorrect'}" onchange="sanitycheck()" /></label> |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
</form>' |
</form>' |
ENDUPFORM |
ENDPERCFORM |
$result.='</td></tr></table>'."\n". |
$result.='</td>'. |
'</td></tr></table><br /><br />'."\n"; |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
|
|
Line 8847 sub process_clicker_file {
|
Line 8846 sub process_clicker_file {
|
|
|
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$symb = &Apache::lonenc::check_encrypt($symb); |
$symb = &Apache::lonenc::check_encrypt($symb); |
my $heading=&mt('Scanning clicker file'); |
$result.=&Apache::loncommon::start_data_table(). |
$result.=(<<ENDHEADER); |
&Apache::loncommon::start_data_table_header_row(). |
<br /><table width="100%" border="0"><tr><td bgcolor="#777777"> |
'<th>'.&mt('Evaluate clicker file').'</th>'. |
<table width="100%" border="0"><tr bgcolor="#e6ffff"><td> |
&Apache::loncommon::end_data_table_header_row(). |
<b>$heading</b></td></tr><tr bgcolor=#ffffe6><td> |
&Apache::loncommon::start_data_table_row().(<<ENDHEADER); |
|
<td> |
<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" /> |
Line 8899 ENDHEADER
|
Line 8899 ENDHEADER
|
} elsif ($clicker_ids{$id}) { |
} elsif ($clicker_ids{$id}) { |
if ($clicker_ids{$id}=~/\,/) { |
if ($clicker_ids{$id}=~/\,/) { |
# More than one user with the same clicker! |
# More than one user with the same clicker! |
$result.="\n<hr />".&mt('Clicker registered more than once').": <tt>".$id."</tt><br />"; |
$result.="</td>".&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::start_data_table_row()."<td>". |
|
&mt('Clicker registered more than once').": <tt>".$id."</tt><br />"; |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
"<select name='multi".$id."'>"; |
"<select name='multi".$id."'>"; |
foreach my $reguser (sort(split(/\,/,$clicker_ids{$id}))) { |
foreach my $reguser (sort(split(/\,/,$clicker_ids{$id}))) { |
Line 8913 ENDHEADER
|
Line 8915 ENDHEADER
|
$student_count++; |
$student_count++; |
} |
} |
} else { |
} else { |
$result.="\n<hr />".&mt('Unregistered Clicker')." <tt>".$id."</tt><br />"; |
$result.="</td>".&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::start_data_table_row()."<td>". |
|
&mt('Unregistered Clicker')." <tt>".$id."</tt><br />"; |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
"\n".&mt("Username").": <input type='text' name='uname".$id."' /> ". |
"\n".&mt("Username").": <input type='text' name='uname".$id."' /> ". |
"\n".&mt("Domain").": ". |
"\n".&mt("Domain").": ". |
Line 8939 ENDHEADER
|
Line 8943 ENDHEADER
|
} else { |
} else { |
$result.='<br /><input type="submit" name="finalize" value="'.&mt('Finalize Grading').'" />'; |
$result.='<br /><input type="submit" name="finalize" value="'.&mt('Finalize Grading').'" />'; |
} |
} |
$result.='</form></td></tr></table>'."\n". |
$result.='</form></td>'. |
'</td></tr></table><br /><br />'."\n"; |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
|
|
Line 9014 sub assign_clicker_grades {
|
Line 9019 sub assign_clicker_grades {
|
# FIXME: This should probably look for the first handgradeable part |
# FIXME: This should probably look for the first handgradeable part |
my $part=$$partlist[0]; |
my $part=$$partlist[0]; |
# Start screen output |
# Start screen output |
my $result=''; |
my $result=&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
my $heading=&mt('Assigning grades based on clicker file'); |
'<th>'.&mt('Assigning grades based on clicker file').'</th>'. |
$result.=(<<ENDHEADER); |
&Apache::loncommon::end_data_table_header_row(). |
<br /><table width="100%" border="0"><tr><td bgcolor="#777777"> |
&Apache::loncommon::start_data_table_row().'<td>'; |
<table width="100%" border="0"><tr bgcolor="#e6ffff"><td> |
|
<b>$heading</b></td></tr><tr bgcolor=#ffffe6><td> |
|
ENDHEADER |
|
# Get correct result |
# Get correct result |
# FIXME: Possibly need delimiter other than ":" |
# FIXME: Possibly need delimiter other than ":" |
my @correct=(); |
my @correct=(); |
Line 9056 ENDHEADER
|
Line 9058 ENDHEADER
|
my $pcorrect=$env{'form.pcorrect'}; |
my $pcorrect=$env{'form.pcorrect'}; |
my $pincorrect=$env{'form.pincorrect'}; |
my $pincorrect=$env{'form.pincorrect'}; |
my $storecount=0; |
my $storecount=0; |
|
my %users=(); |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
my $user=''; |
my $user=''; |
if ($key=~/^form\.student\:(.*)$/) { |
if ($key=~/^form\.student\:(.*)$/) { |
Line 9069 ENDHEADER
|
Line 9072 ENDHEADER
|
$user=$env{'form.multi'.$id}; |
$user=$env{'form.multi'.$id}; |
} |
} |
} |
} |
if ($user) { |
if ($user) { |
|
if ($users{$user}) { |
|
$result.='<br /><span class="LC_warning">'. |
|
&mt("More than one entry found for <tt>[_1]</tt>!",$user). |
|
'</span><br />'; |
|
} |
|
$users{$user}=1; |
my @answer=split(/\,/,$env{$key}); |
my @answer=split(/\,/,$env{$key}); |
my $sum=0; |
my $sum=0; |
my $realnumber=$number; |
my $realnumber=$number; |
Line 9109 ENDHEADER
|
Line 9118 ENDHEADER
|
} |
} |
# We are done |
# We are done |
$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>'. |
'</td></tr></table><br /><br />'."\n"; |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
|
|
Line 9126 sub startpage {
|
Line 9136 sub startpage {
|
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); |
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); |
$r->print(&Apache::loncommon::start_page('Grading',undef, |
$r->print(&Apache::loncommon::start_page('Grading',undef, |
{'bread_crumbs' => $crumbs})); |
{'bread_crumbs' => $crumbs})); |
|
$r->print('<h3>'.$$crumbs[-1]{'text'}.'</h3>'); |
unless ($nodisplayflag) { |
unless ($nodisplayflag) { |
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag)); |
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag)); |
} |
} |
} |
} |
|
|
|
sub select_problem { |
|
my ($r)=@_; |
|
$r->print('<h3>'.&mt('Select the problem or one of the problems you want to grade').'</h3><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 { |
my $request=$_[0]; |
my $request=$_[0]; |
&reset_caches(); |
&reset_caches(); |
Line 9162 sub handler {
|
Line 9181 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'}) { |
Line 9240 sub handler {
|
Line 9260 sub handler {
|
{href=>'', text=>'Store grades'}]); |
{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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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 9258 sub handler {
|
Line 9278 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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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); |
&startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],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'}) { |
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
Line 9292 sub handler {
|
Line 9312 sub handler {
|
$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'}) { |
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
&startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1); |
$request->print(&checkscantron_results($request,$symb)); |
$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'}]); |
&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>'); |