version 1.204.2.5, 2004/09/24 21:09:52
|
version 1.229, 2004/11/17 20:42:35
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# 2/9,2/13 Guy Albertelli |
|
# 6/8 Gerd Kortemeyer |
|
# 7/26 H.K. Ng |
|
# 8/20 Gerd Kortemeyer |
|
# Year 2002 |
|
# June-August H.K. Ng |
|
# Year 2003 |
|
# February, March H.K. Ng |
|
# July, H. K. Ng |
|
# |
|
|
|
package Apache::grades; |
package Apache::grades; |
use strict; |
use strict; |
Line 101 sub get_symb_and_url {
|
Line 91 sub get_symb_and_url {
|
return ($symb,$url); |
return ($symb,$url); |
} |
} |
|
|
# --- Retrieve the fullname for a user. Return lastname, first middle --- |
|
# --- Generation is attached next to the lastname if it exists. --- |
|
sub get_fullname { |
|
my ($uname,$udom) = @_; |
|
my %name=&Apache::lonnet::get('environment', ['lastname','generation', |
|
'firstname','middlename'], |
|
$udom,$uname); |
|
my $fullname; |
|
my ($tmp) = keys(%name); |
|
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
|
$fullname = &Apache::loncoursedata::ProcessFullName |
|
(@name{qw/lastname generation firstname middlename/}); |
|
} else { |
|
&Apache::lonnet::logthis('grades.pm: no name data for '.$uname. |
|
'@'.$udom.':'.$tmp); |
|
} |
|
return $fullname; |
|
} |
|
|
|
#--- Format fullname, username:domain if different for display |
#--- Format fullname, username:domain if different for display |
#--- Use anywhere where the student names are listed |
#--- Use anywhere where the student names are listed |
sub nameUserString { |
sub nameUserString { |
Line 174 sub get_display_part {
|
Line 145 sub get_display_part {
|
if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) } |
if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) } |
} |
} |
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb); |
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb); |
&Apache::lonnet::logthis("\nsymb $symb\n url $url\npartID $partID\ndisplay $display \n"); |
|
if (defined($display) and $display ne '') { |
if (defined($display) and $display ne '') { |
$display.= " (<font color=\"#999900\">id $partID</font>)"; |
$display.= " (<font color=\"#999900\">id $partID</font>)"; |
} else { |
} else { |
Line 365 sub getclasslist {
|
Line 335 sub getclasslist {
|
# |
# |
my %sections; |
my %sections; |
my %fullnames; |
my %fullnames; |
foreach (keys(%$classlist)) { |
foreach my $student (keys(%$classlist)) { |
# the following undefs are for 'domain', and 'username' respectively. |
my $end = |
my (undef,undef,$end,$start,$id,$section,$fullname,$status)= |
$classlist->{$student}->[&Apache::loncoursedata::CL_END()]; |
@{$classlist->{$_}}; |
my $start = |
|
$classlist->{$student}->[&Apache::loncoursedata::CL_START()]; |
|
my $id = |
|
$classlist->{$student}->[&Apache::loncoursedata::CL_ID()]; |
|
my $section = |
|
$classlist->{$student}->[&Apache::loncoursedata::CL_SECTION()]; |
|
my $fullname = |
|
$classlist->{$student}->[&Apache::loncoursedata::CL_FULLNAME()]; |
|
my $status = |
|
$classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()]; |
# filter students according to status selected |
# filter students according to status selected |
if ($filterlist && $ENV{'form.Status'} ne 'Any') { |
if ($filterlist && $ENV{'form.Status'} ne 'Any') { |
if ($ENV{'form.Status'} ne $status) { |
if ($ENV{'form.Status'} ne $status) { |
delete ($classlist->{$_}); |
delete ($classlist->{$student}); |
next; |
next; |
} |
} |
} |
} |
$section = ($section ne '' ? $section : 'no'); |
$section = ($section ne '' ? $section : 'none'); |
if (&canview($section)) { |
if (&canview($section)) { |
if ($getsec eq 'all' || $getsec eq $section) { |
if ($getsec eq 'all' || $getsec eq $section) { |
$sections{$section}++; |
$sections{$section}++; |
$fullnames{$_}=$fullname; |
$fullnames{$student}=$fullname; |
} else { |
} else { |
delete($classlist->{$_}); |
delete($classlist->{$student}); |
} |
} |
} else { |
} else { |
delete($classlist->{$_}); |
delete($classlist->{$student}); |
} |
} |
} |
} |
my %seen = (); |
my %seen = (); |
Line 993 sub sub_page_kw_js {
|
Line 972 sub sub_page_kw_js {
|
my $request = shift; |
my $request = shift; |
my $iconpath = $request->dir_config('lonIconsURL'); |
my $iconpath = $request->dir_config('lonIconsURL'); |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
|
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
$request->print(<<SUBJAVASCRIPT); |
$request->print(<<SUBJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
|
|
Line 1105 sub sub_page_kw_js {
|
Line 1085 sub sub_page_kw_js {
|
pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height); |
pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height); |
pWin.focus(); |
pWin.focus(); |
pDoc = pWin.document; |
pDoc = pWin.document; |
pDoc.open('text/html','replace'); |
pDoc.$docopen; |
pDoc.write("<html><head>"); |
pDoc.write("<html><head>"); |
pDoc.write("<title>Message Central</title>"); |
pDoc.write("<title>Message Central</title>"); |
|
|
Line 1236 sub sub_page_kw_js {
|
Line 1216 sub sub_page_kw_js {
|
hwdWin = window.open('', 'KeywordHighlightCentral', 'resizeable=yes,toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx='+xpos+',screeny='+ypos); |
hwdWin = window.open('', 'KeywordHighlightCentral', 'resizeable=yes,toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx='+xpos+',screeny='+ypos); |
hwdWin.focus(); |
hwdWin.focus(); |
var hDoc = hwdWin.document; |
var hDoc = hwdWin.document; |
hDoc.open('text/html','replace'); |
hDoc.$docopen; |
hDoc.write("<html><head>"); |
hDoc.write("<html><head>"); |
hDoc.write("<title>Highlight Central</title>"); |
hDoc.write("<title>Highlight Central</title>"); |
|
|
Line 1405 sub submission {
|
Line 1385 sub submission {
|
my ($uname,$udom) = ($ENV{'form.student'},$ENV{'form.userdom'}); |
my ($uname,$udom) = ($ENV{'form.student'},$ENV{'form.userdom'}); |
$udom = ($udom eq '' ? $ENV{'user.domain'} : $udom); #has form.userdom changed for a student? |
$udom = ($udom eq '' ? $ENV{'user.domain'} : $udom); #has form.userdom changed for a student? |
my $usec = &Apache::lonnet::getsection($udom,$uname,$ENV{'request.course.id'}); |
my $usec = &Apache::lonnet::getsection($udom,$uname,$ENV{'request.course.id'}); |
$ENV{'form.fullname'} = &get_fullname ($uname,$udom) if $ENV{'form.fullname'} eq ''; |
$ENV{'form.fullname'} = &Apache::loncommon::plainname($uname,$udom,'lastname') if $ENV{'form.fullname'} eq ''; |
|
|
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); |
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
|
|
if (!&canview($usec)) { |
if (!&canview($usec)) { |
$request->print('<font color="red">Unable to view requested student.('. |
$request->print('<font color="red">Unable to view requested student.('. |
$uname.$udom.$usec.$ENV{'request.course.id'}.')</font>'); |
$uname.'@'.$udom.' in section '.$usec.' in course id '. |
|
$ENV{'request.course.id'}.')</font>'); |
$request->print(&show_grading_menu_form($symb,$url)); |
$request->print(&show_grading_menu_form($symb,$url)); |
return; |
return; |
} |
} |
Line 2320 sub viewgrades {
|
Line 2301 sub viewgrades {
|
my $sectionClass; |
my $sectionClass; |
if ($ENV{'form.section'} eq 'all') { |
if ($ENV{'form.section'} eq 'all') { |
$sectionClass='Class </h3>'; |
$sectionClass='Class </h3>'; |
} elsif ($ENV{'form.section'} eq 'no') { |
} elsif ($ENV{'form.section'} eq 'none') { |
$sectionClass='Students in no Section </h3>'; |
$sectionClass='Students in no Section </h3>'; |
} else { |
} else { |
$sectionClass='Students in Section '.$ENV{'form.section'}.'</h3>'; |
$sectionClass='Students in Section '.$ENV{'form.section'}.'</h3>'; |
Line 3071 sub getSymbMap {
|
Line 3052 sub getSymbMap {
|
$minder++; |
$minder++; |
} |
} |
} |
} |
|
|
$navmap->untieHashes(); |
|
return \@titles,\%symbx; |
return \@titles,\%symbx; |
} |
} |
|
|
Line 3205 sub displayPage {
|
Line 3184 sub displayPage {
|
$curRes = $iterator->next(); |
$curRes = $iterator->next(); |
} |
} |
|
|
$navmap->untieHashes(); |
|
|
|
$studentTable.='</td></tr></table></td></tr></table>'."\n". |
$studentTable.='</td></tr></table></td></tr></table>'."\n". |
'<input type="button" value="Save" '. |
'<input type="button" value="Save" '. |
'onClick="javascript:checkSubmitPage(this.form,'.$question.');" TARGET=_self />'. |
'onClick="javascript:checkSubmitPage(this.form,'.$question.');" TARGET=_self />'. |
Line 3219 sub displayPage {
|
Line 3196 sub displayPage {
|
|
|
sub displaySubByDates { |
sub displaySubByDates { |
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_; |
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_; |
|
my $isCODE=0; |
|
if (exists($record->{'resource.CODE'})) { $isCODE=1; } |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
'<td><b>Date/Time</b></td>'. |
'<td><b>Date/Time</b></td>'. |
|
($isCODE?'<td><b>CODE</b></td>':''). |
'<td><b>Submission</b></td>'. |
'<td><b>Submission</b></td>'. |
'<td><b>Status </b></td></tr>'; |
'<td><b>Status </b></td></tr>'; |
my ($version); |
my ($version); |
Line 3234 sub displaySubByDates {
|
Line 3214 sub displaySubByDates {
|
for ($version=1;$version<=$$record{'version'};$version++) { |
for ($version=1;$version<=$$record{'version'};$version++) { |
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
|
if ($isCODE) { |
|
$studentTable.='<td>'.$record->{$version.':resource.CODE'}.'</td>'; |
|
} |
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @displaySub = (); |
my @displaySub = (); |
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
Line 3402 sub updateGradeByPage {
|
Line 3385 sub updateGradeByPage {
|
$curRes = $iterator->next(); |
$curRes = $iterator->next(); |
} |
} |
|
|
$navmap->untieHashes(); |
|
|
|
$studentTable.='</td></tr></table></td></tr></table>'; |
$studentTable.='</td></tr></table></td></tr></table>'; |
$studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'}); |
$studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'}); |
my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' : |
my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' : |
Line 3464 sub scantron_filenames {
|
Line 3445 sub scantron_filenames {
|
} |
} |
|
|
sub scantron_uploads { |
sub scantron_uploads { |
|
my ($file2grade) = @_; |
my $result= '<select name="scantron_selectfile">'; |
my $result= '<select name="scantron_selectfile">'; |
$result.="<option></option>"; |
$result.="<option></option>"; |
foreach my $filename (sort(&scantron_filenames())) { |
foreach my $filename (sort(&scantron_filenames())) { |
$result.="<option>$filename</option>\n"; |
$result.="<option".($filename eq $file2grade ? ' selected="on"':'').">$filename</option>\n"; |
} |
} |
$result.="</select>"; |
$result.="</select>"; |
return $result; |
return $result; |
Line 3492 sub scantron_CODElist {
|
Line 3474 sub scantron_CODElist {
|
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum); |
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum); |
my $namechoice='<option></option>'; |
my $namechoice='<option></option>'; |
foreach my $name (sort(@names)) { |
foreach my $name (sort {uc($a) cmp uc($b)} @names) { |
if ($name =~ /^error: 2 /) { next; } |
if ($name =~ /^error: 2 /) { next; } |
$namechoice.='<option value="'.$name.'">'.$name.'</option>'; |
$namechoice.='<option value="'.$name.'">'.$name.'</option>'; |
} |
} |
Line 3513 sub scantron_CODEunique {
|
Line 3495 sub scantron_CODEunique {
|
} |
} |
|
|
sub scantron_selectphase { |
sub scantron_selectphase { |
my ($r) = @_; |
my ($r,$file2grade) = @_; |
my ($symb,$url)=&get_symb_and_url($r); |
my ($symb,$url)=&get_symb_and_url($r); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $sequence_selector=&getSequenceDropDown($r,$symb); |
my $sequence_selector=&getSequenceDropDown($r,$symb); |
my $default_form_data=&defaultFormData($symb,$url); |
my $default_form_data=&defaultFormData($symb,$url); |
my $grading_menu_button=&show_grading_menu_form($symb,$url); |
my $grading_menu_button=&show_grading_menu_form($symb,$url); |
my $file_selector=&scantron_uploads(); |
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(); |
my $CODE_unique=&scantron_CODEunique(); |
my $CODE_unique=&scantron_CODEunique(); |
Line 3529 sub scantron_selectphase {
|
Line 3511 sub scantron_selectphase {
|
$result.= <<SCANTRONFORM; |
$result.= <<SCANTRONFORM; |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
<tr> |
<tr> |
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
<td bgcolor="#777777"> |
<td bgcolor="#777777"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
|
<input type="hidden" name="command" value="scantron_warning" /> |
<input type="hidden" name="command" value="scantron_warning" /> |
$default_form_data |
$default_form_data |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
Line 3567 sub scantron_selectphase {
|
Line 3549 sub scantron_selectphase {
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</form> |
</td> |
</td> |
</form> |
</tr> |
</tr> |
SCANTRONFORM |
SCANTRONFORM |
|
|
Line 3624 SCANTRONFORM
|
Line 3606 SCANTRONFORM
|
} |
} |
$r->print(<<SCANTRONFORM); |
$r->print(<<SCANTRONFORM); |
<tr> |
<tr> |
<td bgcolor="#777777"> |
<form action='/adm/grades' name='scantron_download'> |
<form action='/adm/grades' name='scantron_download'> |
<td bgcolor="#777777"> |
<input type="hidden" name="command" value="scantron_download" /> |
<input type="hidden" name="command" value="scantron_download" /> |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
<tr bgcolor="#e6ffff"> |
<tr bgcolor="#e6ffff"> |
Line 3642 SCANTRONFORM
|
Line 3624 SCANTRONFORM
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</form> |
</td> |
</td> |
</form> |
</tr> |
</tr> |
SCANTRONFORM |
SCANTRONFORM |
|
|
$r->print(<<SCANTRONFORM); |
$r->print(<<SCANTRONFORM); |
</table> |
</table> |
</form> |
|
$grading_menu_button |
$grading_menu_button |
SCANTRONFORM |
SCANTRONFORM |
|
|
Line 3846 sub scantron_find_student {
|
Line 3827 sub scantron_find_student {
|
|
|
sub scantron_filter { |
sub scantron_filter { |
my ($curres)=@_; |
my ($curres)=@_; |
if (ref($curres) && $curres->is_problem() && !$curres->randomout) { |
# randomout is dysfunctional at best for this purpose |
|
if (ref($curres) && $curres->is_problem()) { #&& !$curres->randomout) { |
return 1; |
return 1; |
} |
} |
return 0; |
return 0; |
Line 3998 sub scantron_form_start {
|
Line 3980 sub scantron_form_start {
|
<input type="hidden" name="selectpage" value="$ENV{'form.selectpage'}" /> |
<input type="hidden" name="selectpage" value="$ENV{'form.selectpage'}" /> |
<input type="hidden" name="scantron_format" value="$ENV{'form.scantron_format'}" /> |
<input type="hidden" name="scantron_format" value="$ENV{'form.scantron_format'}" /> |
<input type="hidden" name="scantron_selectfile" value="$ENV{'form.scantron_selectfile'}" /> |
<input type="hidden" name="scantron_selectfile" value="$ENV{'form.scantron_selectfile'}" /> |
<input type="hidden" name="scantron_maxbubble" value="$max_bubble'" /> |
<input type="hidden" name="scantron_maxbubble" value="$max_bubble" /> |
<input type="hidden" name="scantron_CODElist" value="$ENV{'form.scantron_CODElist'}" /> |
<input type="hidden" name="scantron_CODElist" value="$ENV{'form.scantron_CODElist'}" /> |
<input type="hidden" name="scantron_CODEunique" value="$ENV{'form.scantron_CODEunique'}" /> |
<input type="hidden" name="scantron_CODEunique" value="$ENV{'form.scantron_CODEunique'}" /> |
<input type="hidden" name="scantron_options_redo" value="$ENV{'form.scantron_options_redo'}" /> |
<input type="hidden" name="scantron_options_redo" value="$ENV{'form.scantron_options_redo'}" /> |
Line 4318 sub scantron_get_correction {
|
Line 4300 sub scantron_get_correction {
|
} elsif ($error eq 'duplicateCODE') { |
} elsif ($error eq 'duplicateCODE') { |
$r->print("</p><p>The encoded CODE has also been used by a previous paper ".join(', ',@{$arg}).", and CODEs are supposed to be unique</p>\n"); |
$r->print("</p><p>The encoded CODE has also been used by a previous paper ".join(', ',@{$arg}).", and CODEs are supposed to be unique</p>\n"); |
} |
} |
$r->print("<p>The CODE on the form is <tt>". |
$r->print("<p>The CODE on the form is <tt>'". |
$$scan_record{'scantron.CODE'}."</tt><br />\n"); |
$$scan_record{'scantron.CODE'}."'</tt><br />\n"); |
$r->print("<p>The ID on the form is <tt>". |
$r->print("<p>The ID on the form is <tt>". |
$$scan_record{'scantron.ID'}."</tt><br />\n"); |
$$scan_record{'scantron.ID'}."</tt><br />\n"); |
$r->print("The name on the paper is ". |
$r->print("The name on the paper is ". |
Line 4465 sub scantron_validate_CODE {
|
Line 4447 sub scantron_validate_CODE {
|
$scan_data); |
$scan_data); |
my $CODE=$$scan_record{'scantron.CODE'}; |
my $CODE=$$scan_record{'scantron.CODE'}; |
my $error=0; |
my $error=0; |
if (!exists($allcodes{$CODE}) && !$$scan_record{'scantron.useCODE'}) { |
if (!&Apache::lonnet::validCODE($CODE)) { |
|
&scantron_get_correction($r,$i,$scan_record, |
|
\%scantron_config, |
|
$line,'incorrectCODE',\%allcodes); |
|
return(1,$currentphase); |
|
} |
|
if (%allcodes && !exists($allcodes{$CODE}) |
|
&& !$$scan_record{'scantron.useCODE'}) { |
&scantron_get_correction($r,$i,$scan_record, |
&scantron_get_correction($r,$i,$scan_record, |
\%scantron_config, |
\%scantron_config, |
$line,'incorrectCODE',\%allcodes); |
$line,'incorrectCODE',\%allcodes); |
Line 4637 SCANTRONFORM
|
Line 4626 SCANTRONFORM
|
if (exists($scan_record->{'scantron.CODE'}) && |
if (exists($scan_record->{'scantron.CODE'}) && |
$scan_record->{'scantron.CODE'}) { |
$scan_record->{'scantron.CODE'}) { |
$form{'CODE'}=$scan_record->{'scantron.CODE'}; |
$form{'CODE'}=$scan_record->{'scantron.CODE'}; |
|
} else { |
|
$form{'CODE'}=''; |
} |
} |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
|
if ($result ne '') { |
|
&Apache::lonnet::logthis("scantron grading error -> $result"); |
|
&Apache::lonnet::logthis("scantron grading error info name $uname domain $udom course $ENV{'request.course.id'} url ".$resource->src()); |
|
} |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
} |
} |
$completedstudents{$uname}={'line'=>$line}; |
$completedstudents{$uname}={'line'=>$line}; |
Line 4651 SCANTRONFORM
|
Line 4646 SCANTRONFORM
|
# my $lasttime = &Time::HiRes::time()-$start; |
# my $lasttime = &Time::HiRes::time()-$start; |
# $r->print("<p>took $lasttime</p>"); |
# $r->print("<p>took $lasttime</p>"); |
|
|
$navmap->untieHashes(); |
|
$r->print("</form>"); |
$r->print("</form>"); |
$r->print(&show_grading_menu_form($symb,$url)); |
$r->print(&show_grading_menu_form($symb,$url)); |
return ''; |
return ''; |
Line 4712 sub scantron_upload_scantron_data_save {
|
Line 4706 sub scantron_upload_scantron_data_save {
|
} |
} |
return ''; |
return ''; |
} |
} |
$r->print("Doing upload to ".$ENV{'form.courseid'}." <br />"); |
my %coursedata=&Apache::lonnet::coursedescription($ENV{'form.domainid'}.'_'.$ENV{'form.courseid'}); |
|
$r->print("Doing upload to ".$coursedata{'description'}." <br />"); |
my $home=&Apache::lonnet::homeserver($ENV{'form.courseid'}, |
my $home=&Apache::lonnet::homeserver($ENV{'form.courseid'}, |
$ENV{'form.domainid'}); |
$ENV{'form.domainid'}); |
my $fname=$ENV{'form.upfile.filename'}; |
my $fname=$ENV{'form.upfile.filename'}; |
Line 4729 sub scantron_upload_scantron_data_save {
|
Line 4724 sub scantron_upload_scantron_data_save {
|
$fname=~s/[^\w\.\-]//g; |
$fname=~s/[^\w\.\-]//g; |
# See if there is anything left |
# See if there is anything left |
unless ($fname) { return 'error: no uploaded file'; } |
unless ($fname) { return 'error: no uploaded file'; } |
|
my $uploadedfile=$fname; |
$fname='scantron_orig_'.$fname; |
$fname='scantron_orig_'.$fname; |
if (length($ENV{'form.upfile'}) < 2) { |
if (length($ENV{'form.upfile'}) < 2) { |
$r->print("<font color='red'>Error:</font> The file you attempted to upload, <tt>".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"')."</tt>, contained no information. Please check that you entered the correct filename."); |
$r->print("<font color='red'>Error:</font> The file you attempted to upload, <tt>".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"')."</tt>, contained no information. Please check that you entered the correct filename."); |
Line 4737 sub scantron_upload_scantron_data_save {
|
Line 4733 sub scantron_upload_scantron_data_save {
|
if ($result =~ m|^/uploaded/|) { |
if ($result =~ m|^/uploaded/|) { |
$r->print("<font color='green'>Success:</font> Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location <tt>".$result."</tt>"); |
$r->print("<font color='green'>Success:</font> Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location <tt>".$result."</tt>"); |
} else { |
} else { |
$r->print("<font color='red'>Error:</font> An error (".$result.") occured when attempting to upload the file, <tt>".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"')."</tt>"); |
$r->print("<font color='red'>Error:</font> An error (".$result.") occurred when attempting to upload the file, <tt>".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"')."</tt>"); |
} |
} |
} |
} |
if ($symb) { |
if ($symb) { |
$r->print(&show_grading_menu_form($symb,$url)); |
$r->print(&scantron_selectphase($r,$uploadedfile)); |
} else { |
} else { |
$r->print($doanotherupload); |
$r->print($doanotherupload); |
} |
} |
Line 4906 GRADINGMENUJS
|
Line 4902 GRADINGMENUJS
|
|
|
$result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
$result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
|
|
if (ref($sections) && (grep /no/,@$sections)) { |
|
$result.=' (Section "no" implies the students were not assigned a section.)<br />'; |
|
} |
|
$result.='</td></tr>'; |
$result.='</td></tr>'; |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |