version 1.6, 2005/04/07 06:56:23
|
version 1.8, 2005/12/20 18:54:54
|
Line 43 sub get_code_freq {
|
Line 43 sub get_code_freq {
|
$r->rflush(); |
$r->rflush(); |
my ($scanlines,$scan_data)=&Apache::grades::scantron_getfile(); |
my ($scanlines,$scan_data)=&Apache::grades::scantron_getfile(); |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
my $line=&Apache::grades::scantron_get_line($scanlines,$i); |
my $line=&Apache::grades::scantron_get_line($scanlines,$scan_data,$i); |
if ($line=~/^[\s\cz]*$/) { next; } |
if ($line=~/^[\s\cz]*$/) { next; } |
my $scan_record= |
my $scan_record= |
&Apache::grades::scantron_parse_scanline($line,$i, |
&Apache::grades::scantron_parse_scanline($line,$i, |
Line 68 $html
|
Line 68 $html
|
</head> |
</head> |
ENDDOCUMENT |
ENDDOCUMENT |
|
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['curCODE','scantron_selectfile', |
['curCODE','scantron_selectfile', |
'form','scantron_format', |
'form','scantron_format','symb', |
'scantron_CODElist']); |
'scantron_CODElist','command']); |
|
|
if (!($env{'request.course.id'}) && |
if (!($env{'request.course.id'}) && |
(&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) { |
(&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) { |
$r->print('<body>Access not allowed.</body>'); |
$r->print('<body>Access not allowed.</body>'); |
return OK; |
return OK; |
} |
} |
|
if ($env{'form.command'} eq 'codelist') { |
|
&code_list($r); |
|
} elsif ($env{'form.command'} eq 'showcodes') { |
|
&show_codes($r); |
|
} else { |
|
&picking_a_code($r); |
|
} |
|
$r->print('</body></html>'); |
|
return OK; |
|
} |
|
|
|
sub code_list { |
|
my ($r,$secondview)=@_; |
|
if (!$secondview) { |
|
$r->print(&Apache::loncommon::bodytag("View CODEs")); |
|
$r->print("<p>".&mt('Select a set of saved CODEs to view.')."</p>"); |
|
} else { |
|
$r->print("<p>".&mt('Select another set of saved CODEs to view.')."</p>"); |
|
} |
|
$r->print("<form method='POST' action='/adm/pickcode' name='pickcode'>"); |
|
$r->print(&Apache::grades::scantron_CODElist()); |
|
$r->print("<input type='hidden' name='command' value='showcodes' />"); |
|
$r->print("<input type='hidden' name='symb' value='".$env{'form.symb'}."' />"); |
|
$r->print("<input type='hidden' name='url' value='".$env{'form.url'}."' />"); |
|
$r->print("<input type='submit' name='submit' value='".&mt("View")."' />"); |
|
$r->print("</form>"); |
|
$r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'}, |
|
$env{'form.url'})); |
|
} |
|
|
|
sub show_codes { |
|
my ($r)=@_; |
|
$r->print(&Apache::loncommon::bodytag("View CODEs")); |
|
my %codes=&Apache::grades::get_codes(); |
|
$r->print("<h2>".$env{'form.scantron_CODElist'}."</h2>"); |
|
$r->print('<pre>'); |
|
foreach my $code (sort(keys(%codes))) { |
|
$r->print($code."\n"); |
|
} |
|
$r->print('</pre>'); |
|
&code_list($r,1); |
|
} |
|
|
|
sub picking_a_code { |
|
my ($r)=@_; |
$r->print(&Apache::loncommon::bodytag("Selecting a CODE")); |
$r->print(&Apache::loncommon::bodytag("Selecting a CODE")); |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
<script> |
<script> |
Line 125 ENDSCRIPT
|
Line 168 ENDSCRIPT
|
$to_print.='</table>'; |
$to_print.='</table>'; |
if ($print) { $r->print($to_print); } |
if ($print) { $r->print($to_print); } |
} |
} |
$r->print('</form></body></html>'); |
$r->print('</form>'); |
return OK; |
|
} |
} |
|
|
1; |
1; |