version 1.80, 2003/03/28 20:49:55
|
version 1.81, 2003/03/28 23:44:31
|
Line 2779 sub updateGradeByPage {
|
Line 2779 sub updateGradeByPage {
|
# |
# |
#------ start of section for handling grading by page/sequence --------- |
#------ start of section for handling grading by page/sequence --------- |
|
|
|
sub defaultFormData { |
|
my ($symb,$url)=@_; |
|
return ' |
|
<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
|
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
|
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n"; |
|
} |
|
|
sub getSequenceDropDown { |
sub getSequenceDropDown { |
my ($request,$symb)=@_; |
my ($request,$symb)=@_; |
my $result='<select name="selectpage">'."\n"; |
my $result='<select name="selectpage">'."\n"; |
Line 2796 sub getSequenceDropDown {
|
Line 2805 sub getSequenceDropDown {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub scantron_uploads { |
|
if (!-e $Apache::lonnet::perlvar{'lonScansDir'}) { return ''}; |
|
my $result= '<select name="scantron_selectfile">'; |
|
opendir(DIR,$Apache::lonnet::perlvar{'lonScansDir'}); |
|
my @files=sort(readdir(DIR)); |
|
foreach my $filename (@files) { |
|
if ($filename eq '.' or $filename eq '..') { next; } |
|
$result.="<option>$filename</option>\n"; |
|
} |
|
closedir(DIR); |
|
$result.="</select>"; |
|
return $result; |
|
} |
|
|
sub scantron_selectphase { |
sub scantron_selectphase { |
my ($r) = @_; |
my ($r) = @_; |
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 $grading_menu_button=&show_grading_menu_form($symb,$url); |
|
my $file_selector=&scantron_uploads(); |
my $result; |
my $result; |
$result.= <<SCANTRONFORM; |
$result.= <<SCANTRONFORM; |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantronupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantronupload"> |
<input type="hidden" name="symb" value="$symb" /> |
|
<input type="hidden" name="url" value="$url" /> |
|
<input type="hidden" name="command" value="scantron_configphase" /> |
<input type="hidden" name="command" value="scantron_configphase" /> |
|
$default_form_data |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
<tr> |
<tr> |
<td bgcolor="#777777"> |
<td bgcolor="#777777"> |
Line 2823 sub scantron_selectphase {
|
Line 2848 sub scantron_selectphase {
|
</tr> |
</tr> |
<tr bgcolor="#ffffe6"> |
<tr bgcolor="#ffffe6"> |
<td> |
<td> |
<!-- FIXME I need to present a list of files from a specfic directory that has been configured, or any existing delay queues --> |
Filename of scoring office file: $file_selector |
Filename of scoring office file: |
|
<select name="selectfile"> |
|
<option value="filname1">filename1</option> |
|
<option value="filname2">filename2</option> |
|
</select> |
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 2837 sub scantron_selectphase {
|
Line 2857 sub scantron_selectphase {
|
</table> |
</table> |
<input type="submit" value="Submit" /> |
<input type="submit" value="Submit" /> |
</form> |
</form> |
|
$grading_menu_button |
SCANTRONFORM |
SCANTRONFORM |
|
|
return $result; |
return $result; |
Line 2844 SCANTRONFORM
|
Line 2865 SCANTRONFORM
|
|
|
sub scantron_configphase { |
sub scantron_configphase { |
my ($r) = @_; |
my ($r) = @_; |
my $sequence=$ENV{'form.selectpage'}; |
my (undef,undef,$sequence)=split(/___/,$ENV{'form.selectpage'}); |
my $result; |
my $result; |
$result.="got page $sequence"; |
my ($symb,$url)=&get_symb_and_url($r); |
$Apache::lonxml::debug=1; |
if (!$symb) {return '';} |
&Apache::lonhomework::showhash(%ENV); |
my $default_form_data=&defaultFormData($symb,$url); |
$Apache::lonxml::debug=0; |
my $grading_menu_button=&show_grading_menu_form($symb,$url); |
|
my $file_selector; |
|
$result.= <<SCANTRONFORM; |
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantronupload"> |
|
<input type="hidden" name="command" value="scantron_configphase" /> |
|
$default_form_data |
|
<table width="100%" border="0"> |
|
<tr> |
|
<td bgcolor="#777777"> |
|
<table width="100%" border="0"> |
|
<tr bgcolor="#e6ffff"> |
|
<td> |
|
<b>Select a format for the data file.</b> |
|
</td> |
|
</tr> |
|
<tr bgcolor="#ffffe6"> |
|
<td> |
|
Format of data file: |
|
</td> |
|
</tr> |
|
<tr bgcolor="#ffffe6"> |
|
<td> |
|
Filename of scoring office file: $file_selector |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
<input type="submit" value="Submit" /> |
|
</form> |
|
$grading_menu_button |
|
SCANTRONFORM |
#FIXME Needs to present some lines from the file and allow the instructor to specify which columns represent what data, possibly have some nice defaults setup, probably should do a pass through all problems for a student to get an idea of how many questions there are, and homw many lines we'll have, |
#FIXME Needs to present some lines from the file and allow the instructor to specify which columns represent what data, possibly have some nice defaults setup, probably should do a pass through all problems for a student to get an idea of how many questions there are, and homw many lines we'll have, |
return $result; |
return $result; |
} |
} |
Line 3088 GRADINGMENUJS
|
Line 3141 GRADINGMENUJS
|
'Upload scores from file</td></tr>'."\n"; |
'Upload scores from file</td></tr>'."\n"; |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
'<input type="radio" name="command" value="scantron_selectphase" /> '. |
'<input type="radio" name="command" value="scantron_selectphase" '. |
|
($saveCmd eq 'scantron_selectphase' ? 'checked="on"' : '').' /> '. |
'Grade scantron forms</td></tr>'."\n"; |
'Grade scantron forms</td></tr>'."\n"; |
|
|
if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { |
if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { |