version 1.174, 2004/02/09 22:37:54
|
version 1.183, 2004/03/19 04:20:24
|
Line 526 sub verifyreceipt {
|
Line 526 sub verifyreceipt {
|
|
|
my ($string,$contents,$matches) = ('','',0); |
my ($string,$contents,$matches) = ('','',0); |
my (undef,undef,$fullname) = &getclasslist('all','0'); |
my (undef,undef,$fullname) = &getclasslist('all','0'); |
|
|
|
my $receiptparts=0; |
|
if ($ENV{"course.$courseid.receiptalg"} eq 'receipt2') { $receiptparts=1; } |
|
my $parts=['0']; |
|
if ($receiptparts) { ($parts)=&response_type($url,$symb); } |
foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
my ($uname,$udom)=split(/\:/); |
my ($uname,$udom)=split(/\:/); |
if ($receipt eq |
foreach my $part (@$parts) { |
&Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) { |
if ($receipt eq &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb,$part)) { |
$contents.='<tr bgcolor="#ffffe6"><td> '."\n". |
$contents.='<tr bgcolor="#ffffe6"><td> '."\n". |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'\')"; TARGET=_self>'.$$fullname{$_}.'</a> </td>'."\n". |
'\')"; TARGET=_self>'.$$fullname{$_}.'</a> </td>'."\n". |
'<td> '.$uname.' </td>'. |
'<td> '.$uname.' </td>'. |
'<td> '.$udom.' </td></tr>'."\n"; |
'<td> '.$udom.' </td>'; |
|
if ($receiptparts) { |
$matches++; |
$contents.='<td> '.$part.' </td>'; |
|
} |
|
$contents.='</tr>'."\n"; |
|
|
|
$matches++; |
|
} |
} |
} |
} |
} |
if ($matches == 0) { |
if ($matches == 0) { |
Line 550 sub verifyreceipt {
|
Line 559 sub verifyreceipt {
|
'<table border="0"><tr bgcolor="#e6ffff">'."\n". |
'<table border="0"><tr bgcolor="#e6ffff">'."\n". |
'<td><b> Fullname </b></td>'."\n". |
'<td><b> Fullname </b></td>'."\n". |
'<td><b> Username </b></td>'."\n". |
'<td><b> Username </b></td>'."\n". |
'<td><b> Domain </b></td></tr>'."\n". |
'<td><b> Domain </b></td>'; |
$contents. |
if ($receiptparts) { |
|
$string.='<td> Problem Part </td>'; |
|
} |
|
$string.='</tr>'."\n".$contents. |
'</table></td></tr></table>'."\n"; |
'</table></td></tr></table>'."\n"; |
} |
} |
return $string.&show_grading_menu_form($symb,$url); |
return $string.&show_grading_menu_form($symb,$url); |
Line 1283 sub gradeBox {
|
Line 1295 sub gradeBox {
|
my $ctr = 0; |
my $ctr = 0; |
$result.='<table border="0"><tr>'."\n"; # display radio buttons in a nice table 10 across |
$result.='<table border="0"><tr>'."\n"; # display radio buttons in a nice table 10 across |
while ($ctr<=$wgt) { |
while ($ctr<=$wgt) { |
$result.= '<td><input type="radio" name="RADVAL'.$counter.'_'.$partid.'" '. |
$result.= '<td><nobr><input type="radio" name="RADVAL'.$counter.'_'.$partid.'" '. |
'onclick="javascript:writeBox(this.form,\''.$counter.'_'.$partid.'\','. |
'onclick="javascript:writeBox(this.form,\''.$counter.'_'.$partid.'\','. |
$ctr.')" value="'.$ctr.'" '. |
$ctr.')" value="'.$ctr.'" '. |
($score eq $ctr ? 'checked':'').' /> '.$ctr."</td>\n"; |
($score eq $ctr ? 'checked':'').' /> '.$ctr."</nobr></td>\n"; |
$result.=(($ctr+1)%10 == 0 ? '</tr><tr>' : ''); |
$result.=(($ctr+1)%10 == 0 ? '</tr><tr>' : ''); |
$ctr++; |
$ctr++; |
} |
} |
Line 1692 KEYWORDS
|
Line 1704 KEYWORDS
|
($ENV{'form.command'} eq 'processGroup' && $counter == $total)) { |
($ENV{'form.command'} eq 'processGroup' && $counter == $total)) { |
$toGrade.='</form>'.&show_grading_menu_form($symb,$url) |
$toGrade.='</form>'.&show_grading_menu_form($symb,$url) |
} |
} |
$request = print($toGrade); |
$request->print($toGrade); |
return; |
return; |
|
} else { |
|
$request->print('</td></tr></table></td></tr></table>'."\n"); |
} |
} |
|
|
# essay grading message center |
# essay grading message center |
Line 3843 sub scantron_getfile {
|
Line 3857 sub scantron_getfile {
|
} else { |
} else { |
$scanlines{'skipped'}=[(split("\n",$lines,-1))]; |
$scanlines{'skipped'}=[(split("\n",$lines,-1))]; |
} |
} |
my @tmp=&Apache::lonnet::dump('scantrondata',$cdom,$cname); |
my @tmp=&Apache::lonnet::dump('nohist_scantrondata',$cdom,$cname); |
if ($tmp[0] =~ /^(error:|no_such_host)/) { @tmp=(); } |
if ($tmp[0] =~ /^(error:|no_such_host)/) { @tmp=(); } |
my %scan_data = @tmp; |
my %scan_data = @tmp; |
return (\%scanlines,\%scan_data); |
return (\%scanlines,\%scan_data); |
Line 3875 sub scantron_putfile {
|
Line 3889 sub scantron_putfile {
|
&lonnet_putfile(join("\n",@{$scanlines->{'skipped'}}), |
&lonnet_putfile(join("\n",@{$scanlines->{'skipped'}}), |
$prefix.'skipped_'. |
$prefix.'skipped_'. |
$ENV{'form.scantron_selectfile'}); |
$ENV{'form.scantron_selectfile'}); |
&Apache::lonnet::put('scantrondata',$scan_data,$cdom,$cname); |
&Apache::lonnet::put('nohist_scantrondata',$scan_data,$cdom,$cname); |
} |
} |
|
|
sub scantron_get_line { |
sub scantron_get_line { |
Line 3992 sub scantron_get_correction {
|
Line 4006 sub scantron_get_correction {
|
'scantron_username','scantron_domain')); |
'scantron_username','scantron_domain')); |
$r->print(": <input type='text' name='scantron_username' value='' />"); |
$r->print(": <input type='text' name='scantron_username' value='' />"); |
$r->print("\n@". |
$r->print("\n@". |
&Apache::loncommon::select_dom_form(undef,'scantron_domain')); |
&Apache::loncommon::select_dom_form($ENV{'request.role..domain'},'scantron_domain')); |
|
|
$r->print('</li>'); |
$r->print('</li>'); |
} elsif ($error eq 'doublebubble') { |
} elsif ($error eq 'doublebubble') { |
Line 4190 sub scantron_upload_scantron_data {
|
Line 4204 sub scantron_upload_scantron_data {
|
my ($r)=@_; |
my ($r)=@_; |
$r->print(&Apache::loncommon::coursebrowser_javascript($ENV{'request.role.domain'})); |
$r->print(&Apache::loncommon::coursebrowser_javascript($ENV{'request.role.domain'})); |
my $select_link=&Apache::loncommon::selectcourse_link('rules','courseid', |
my $select_link=&Apache::loncommon::selectcourse_link('rules','courseid', |
'domainid'); |
'domainid', |
|
'coursename'); |
my $domsel=&Apache::loncommon::select_dom_form($ENV{'request.role.domain'}, |
my $domsel=&Apache::loncommon::select_dom_form($ENV{'request.role.domain'}, |
'domainid'); |
'domainid'); |
my $default_form_data=&defaultFormData(&get_symb_and_url($r,1)); |
my $default_form_data=&defaultFormData(&get_symb_and_url($r,1)); |
Line 4207 sub scantron_upload_scantron_data {
|
Line 4222 sub scantron_upload_scantron_data {
|
|
|
<form enctype='multipart/form-data' action='/adm/grades' name='rules' method='post'> |
<form enctype='multipart/form-data' action='/adm/grades' name='rules' method='post'> |
$default_form_data |
$default_form_data |
Course: <input name='courseid' type='text' /> |
<table> |
Domain: $domsel $select_link |
<tr><td>$select_link </td></tr> |
<br /> |
<tr><td>Course ID: </td><td><input name='courseid' type='text' /> </td></tr> |
|
<tr><td>Course Name: </td><td><input name='coursename' type='text' /></td></tr> |
|
<tr><td>Domain: </td><td>$domsel </td></tr> |
|
<tr><td>File to upload:</td><td><input type="file" name="upfile" size="50" /></td></tr> |
|
</table> |
<input name='command' value='scantronupload_save' type='hidden' /> |
<input name='command' value='scantronupload_save' type='hidden' /> |
File to upload:<input type="file" name="upfile" size="50" /> |
|
<br /> |
|
<input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scantron Data" /> |
<input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scantron Data" /> |
</form> |
</form> |
UPLOAD |
UPLOAD |
Line 4221 UPLOAD
|
Line 4238 UPLOAD
|
|
|
sub scantron_upload_scantron_data_save { |
sub scantron_upload_scantron_data_save { |
my($r)=@_; |
my($r)=@_; |
|
my ($symb,$url)=&get_symb_and_url($r,1); |
|
my $doanotherupload= |
|
'<br /><form action="/adm/grades" method="post">'."\n". |
|
'<input type="hidden" name="command" value="scantronupload" />'."\n". |
|
'<input type="submit" name="submit" value="Do Another Upload" />'."\n". |
|
'</form>'."\n"; |
if (!&Apache::lonnet::allowed('usc',$ENV{'form.domainid'}) && |
if (!&Apache::lonnet::allowed('usc',$ENV{'form.domainid'}) && |
!&Apache::lonnet::allowed('usc', |
!&Apache::lonnet::allowed('usc', |
$ENV{'form.domainid'}.'_'.$ENV{'form.courseid'})) { |
$ENV{'form.domainid'}.'_'.$ENV{'form.courseid'})) { |
$r->print("You are not allowed to upload Scantron data to the requested course.<br />"); |
$r->print("You are not allowed to upload Scantron data to the requested course.<br />"); |
$r->print(&show_grading_menu_form(&get_symb_and_url($r))); |
if ($symb) { |
|
$r->print(&show_grading_menu_form($symb,$url)); |
|
} else { |
|
$r->print($doanotherupload); |
|
} |
return ''; |
return ''; |
} |
} |
$r->print("Doing upload to ".$ENV{'form.courseid'}." <br />"); |
$r->print("Doing upload to ".$ENV{'form.courseid'}." <br />"); |
Line 4246 sub scantron_upload_scantron_data_save {
|
Line 4273 sub scantron_upload_scantron_data_save {
|
# 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'; } |
$fname='scantron_orig_'.$fname; |
$fname='scantron_orig_'.$fname; |
$r->print(&Apache::lonnet::finishuserfileupload($ENV{'form.courseid'}, |
if (length($ENV{'form.upfile'}) < 2) { |
$ENV{'form.domainid'}, |
$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."); |
$home,'upfile',$fname)); |
} else { |
my ($symb,$url)=&get_symb_and_url($r); |
my $result=&Apache::lonnet::finishuserfileupload($ENV{'form.courseid'},$ENV{'form.domainid'},$home,'upfile',$fname); |
|
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>"); |
|
} 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>"); |
|
} |
|
} |
if ($symb) { |
if ($symb) { |
$r->print(&show_grading_menu_form(&get_symb_and_url($r))); |
$r->print(&show_grading_menu_form($symb,$url)); |
} else { |
} else { |
$r->print('<br /><form action="/adm/grades" method="post">'."\n". |
$r->print($doanotherupload); |
'<input type="hidden" name="command" value="scantronupload" />'."\n". |
|
'<input type="submit" name="submit" value="Do Another Upload" />'."\n". |
|
'</form>'."\n"); |
|
} |
} |
return ''; |
return ''; |
} |
} |