version 1.486, 2007/11/08 19:57:30
|
version 1.491, 2007/11/16 07:55:01
|
Line 733 sub verifyreceipt {
|
Line 733 sub verifyreceipt {
|
$receipt =~ s/[^\-\d]//g; |
$receipt =~ s/[^\-\d]//g; |
my ($symb) = &get_symb($request); |
my ($symb) = &get_symb($request); |
|
|
my $title.='<h3><span class="LC_info">Verifying Submission Receipt '. |
my $title.= |
$receipt.'</h3></span>'."\n". |
'<h3><span class="LC_info">'. |
'<h4><b>Resource: </b>'.$env{'form.probTitle'}.'</h4><br /><br />'."\n"; |
&mt('Verifying Submission Receipt [_1]',$receipt). |
|
'</span></h3>'."\n". |
|
'<h4>'.&mt('<b>Resource: </b>[_1]',$env{'form.probTitle'}). |
|
'</h4>'."\n"; |
|
|
my ($string,$contents,$matches) = ('','',0); |
my ($string,$contents,$matches) = ('','',0); |
my (undef,undef,$fullname) = &getclasslist('all','0'); |
my (undef,undef,$fullname) = &getclasslist('all','0'); |
Line 749 sub verifyreceipt {
|
Line 752 sub verifyreceipt {
|
my $header = |
my $header = |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th> Fullname </th>'."\n". |
'<th> '.&mt('Fullname').' </th>'."\n". |
'<th> Username </th>'."\n". |
'<th> '.&mt('Username').' </th>'."\n". |
'<th> Domain </th>'; |
'<th> '.&mt('Domain').' </th>'; |
if ($receiptparts) { |
if ($receiptparts) { |
$header.='<th> Problem Part </th>'; |
$header.='<th> '.&mt('Problem Part').' </th>'; |
} |
} |
$header.= |
$header.= |
&Apache::loncommon::end_data_table_header_row(); |
&Apache::loncommon::end_data_table_header_row(); |
Line 786 sub verifyreceipt {
|
Line 789 sub verifyreceipt {
|
} |
} |
} |
} |
if ($matches == 0) { |
if ($matches == 0) { |
$string = $title.'No match found for the above receipt.'; |
$string = $title.&mt('No match found for the above receipt.'); |
} else { |
} else { |
$string = &jscriptNform($symb).$title. |
$string = &jscriptNform($symb).$title. |
'The above receipt matches the following student'. |
'<p>'. |
($matches <= 1 ? '.' : 's.')."\n". |
&mt('The above receipt matches the following [numerate,_1,student].',$matches). |
|
'</p>'. |
$header. |
$header. |
$contents. |
$contents. |
&Apache::loncommon::end_data_table()."\n"; |
&Apache::loncommon::end_data_table()."\n"; |
Line 4897 sub scantron_selectphase {
|
Line 4901 sub scantron_selectphase {
|
|
|
# Chunk of form to prompt for a file to grade and how: |
# Chunk of form to prompt for a file to grade and how: |
|
|
$result.= <<SCANTRONFORM; |
$result.= ' |
<table width="100%" border="0"> |
<br /> |
<tr> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
<input type="hidden" name="command" value="scantron_warning" /> |
<td bgcolor="#777777"> |
'.$default_form_data.' |
<input type="hidden" name="command" value="scantron_warning" /> |
'.&Apache::loncommon::start_data_table('LC_scantron_action').' |
$default_form_data |
'.&Apache::loncommon::start_data_table_header_row().' |
<table width="100%" border="0"> |
<th colspan="2"> |
<tr bgcolor="#e6ffff"> |
Specify file and which Folder/Sequence to grade |
<td colspan="2"> |
</th> |
<b>Specify file and which Folder/Sequence to grade</b> |
'.&Apache::loncommon::end_data_table_header_row().' |
</td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
<td> Sequence to grade: </td><td> '.$sequence_selector.' </td> |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::end_data_table_row().' |
<td> Sequence to grade: </td><td> $sequence_selector </td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
<td> Filename of scoring office file: </td><td> '.$file_selector.' </td> |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::end_data_table_row().' |
<td> Filename of scoring office file: </td><td> $file_selector </td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
<td> Format of data file: </td><td> '.$format_selector.' </td> |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::end_data_table_row().' |
<td> Format of data file: </td><td> $format_selector </td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
<td> Saved CODEs to validate against: </td><td> '.$CODE_selector.' </td> |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::end_data_table_row().' |
<td> Saved CODEs to validate against: </td><td> $CODE_selector</td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
<td> Each CODE is only to be used once:</td><td> '.$CODE_unique.' </td> |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::end_data_table_row().' |
<td> Each CODE is only to be used once:</td><td> $CODE_unique </td> |
'.&Apache::loncommon::start_data_table_row().' |
</tr> |
|
<tr bgcolor="#ffffe6"> |
|
<td> Options: </td> |
<td> Options: </td> |
<td> |
<td> |
<label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br /> |
<label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br /> |
<label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all existing corrections</label> <br /> |
<label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all existing corrections</label> <br /> |
<label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label> |
<label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label> |
</td> |
</td> |
</tr> |
'.&Apache::loncommon::end_data_table_row().' |
<tr bgcolor="#ffffe6"> |
'.&Apache::loncommon::start_data_table_row().' |
<td colspan="2"> |
<td colspan="2"> |
<input type="submit" value="Grading: Validate Scantron Records" /> |
<input type="submit" value="Grading: Validate Scantron Records" /> |
</td> |
</td> |
</tr> |
'.&Apache::loncommon::end_data_table_row().' |
</table> |
'.&Apache::loncommon::end_data_table().' |
</td> |
</form> |
</form> |
'; |
</tr> |
|
SCANTRONFORM |
|
|
|
$r->print($result); |
$r->print($result); |
|
|
Line 4951 SCANTRONFORM
|
Line 4951 SCANTRONFORM
|
|
|
# Chunk of form to prompt for a scantron file upload. |
# Chunk of form to prompt for a scantron file upload. |
|
|
$r->print(<<SCANTRONFORM); |
$r->print(' |
<tr> |
<br /> |
<td bgcolor="#777777"> |
'.&Apache::loncommon::start_data_table('LC_scantron_action').' |
<table width="100%" border="0"> |
'.&Apache::loncommon::start_data_table_header_row().' |
<tr bgcolor="#e6ffff"> |
<th> |
<td> |
Specify a Scantron data file to upload. |
<b>Specify a Scantron data file to upload.</b> |
</th> |
</td> |
'.&Apache::loncommon::end_data_table_header_row().' |
</tr> |
'.&Apache::loncommon::start_data_table_row().' |
<tr bgcolor="#ffffe6"> |
|
<td> |
<td> |
SCANTRONFORM |
'); |
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 4988 SCANTRONFORM
|
Line 4987 SCANTRONFORM
|
</form> |
</form> |
UPLOAD |
UPLOAD |
|
|
$r->print(<<SCANTRONFORM); |
$r->print(' |
</td> |
</td> |
</tr> |
'.&Apache::loncommon::end_data_table_row().' |
</table> |
'.&Apache::loncommon::end_data_table().' |
</td> |
'); |
</tr> |
|
SCANTRONFORM |
|
} |
} |
|
|
# Chunk of the form that prompts to view a scoring office file, |
# Chunk of the form that prompts to view a scoring office file, |
# corrected file, skipped records in a file. |
# corrected file, skipped records in a file. |
|
|
$r->print(<<SCANTRONFORM); |
$r->print(' |
<tr> |
<br /> |
<form action='/adm/grades' name='scantron_download'> |
<form action="/adm/grades" name="scantron_download"> |
<td bgcolor="#777777"> |
'.$default_form_data.' |
$default_form_data |
<input type="hidden" name="command" value="scantron_download" /> |
<input type="hidden" name="command" value="scantron_download" /> |
'.&Apache::loncommon::start_data_table('LC_scantron_action').' |
<table width="100%" border="0"> |
'.&Apache::loncommon::start_data_table_header_row().' |
<tr bgcolor="#e6ffff"> |
<th> |
<td colspan="2"> |
Download a scoring office file |
<b>Download a scoring office file</b> |
</th> |
</td> |
'.&Apache::loncommon::end_data_table_header_row().' |
</tr> |
'.&Apache::loncommon::start_data_table_row().' |
<tr bgcolor="#ffffe6"> |
<td> Filename of scoring office file: '.$file_selector.' |
<td> Filename of scoring office file: </td><td> $file_selector </td> |
<br /> |
</tr> |
|
<tr bgcolor="#ffffe6"> |
|
<td colspan="2"> |
|
<input type="submit" value="Download: Show List of Associated Files" /> |
<input type="submit" value="Download: Show List of Associated Files" /> |
</td> |
'.&Apache::loncommon::end_data_table_row().' |
</tr> |
'.&Apache::loncommon::end_data_table().' |
</table> |
</form> |
</td> |
<br /> |
</form> |
'); |
</tr> |
|
SCANTRONFORM |
|
|
|
$r->print('<tr><td bgcolor="#777777">'); |
|
&Apache::lonpickcode::code_list($r,2); |
&Apache::lonpickcode::code_list($r,2); |
$r->print('</td></tr></table>'); |
|
$r->print($grading_menu_button); |
$r->print($grading_menu_button); |
return |
return |
} |
} |
Line 5416 sub scantron_parse_scanline {
|
Line 5406 sub scantron_parse_scanline {
|
my $answer_length = $$scantron_config{'Qlength'} * $answers_needed; |
my $answer_length = $$scantron_config{'Qlength'} * $answers_needed; |
|
|
|
|
|
|
$questnum++; |
$questnum++; |
my $currentquest = substr($questions,0,$answer_length); |
my $currentquest = substr($questions,0,$answer_length); |
$questions = substr($questions,0,$answer_length)=''; |
$questions = substr($questions,$answer_length); |
if (length($currentquest) < $answer_length) { next; } |
if (length($currentquest) < $answer_length) { next; } |
|
|
# Qon letter implies for each slot in currentquest we have: |
# Qon letter implies for each slot in currentquest we have: |
Line 5429 sub scantron_parse_scanline {
|
Line 5418 sub scantron_parse_scanline {
|
|
|
|
|
if ($$scantron_config{'Qon'} eq 'letter') { |
if ($$scantron_config{'Qon'} eq 'letter') { |
|
|
if ($currentquest =~ /\?/ |
if ($currentquest =~ /\?/ |
|| $currentquest =~ /\*/ |
|| $currentquest =~ /\*/ |
|| (&occurence_count($currentquest, "[A-Z]") > 1)) { |
|| (&occurence_count($currentquest, "[A-Z]") > 1)) { |
Line 5458 sub scantron_parse_scanline {
|
Line 5446 sub scantron_parse_scanline {
|
} |
} |
} else { |
} else { |
for (my $ans = 0; $ans < $answers_needed; $ans++) { |
for (my $ans = 0; $ans < $answers_needed; $ans++) { |
$record{"scantron.$ansnum.answer"} = substr($currentquest, $ans, 1); |
my $bubble = substr($currentquest, $ans, 1); |
|
$record{"scantron.$ansnum.answer"} = $bubble; |
$ansnum++; |
$ansnum++; |
} |
} |
} |
} |
Line 5525 sub scantron_parse_scanline {
|
Line 5514 sub scantron_parse_scanline {
|
push(@{$record{"scantron.missingerror"}},$questnum); |
push(@{$record{"scantron.missingerror"}},$questnum); |
} |
} |
|
|
# If the bubble is not the last position, there will be |
|
# 2 elements. If it is the last position, there will be 1 element. |
|
|
|
} elsif (scalar(@array) le 2) { |
|
|
} elsif (scalar(@array) eq 2) { |
|
|
my $location = length($array[0]); |
my $location = length($array[0]); |
my $line_num = int($location / $$scantron_config{'Qlength'}); |
my $line_num = int($location / $$scantron_config{'Qlength'}); |
Line 6089 sub scantron_remove_scan_data {
|
Line 6077 sub scantron_remove_scan_data {
|
} |
} |
my $result; |
my $result; |
if (@todelete) { |
if (@todelete) { |
$result=&Apache::lonnet::del('nohist_scantrondata',\@todelete,$cdom,$cname); |
$result = &Apache::lonnet::del('nohist_scantrondata', |
|
\@todelete,$cdom,$cname); |
|
} else { |
|
$result = 'ok'; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 6961 sub scantron_get_maxbubble {
|
Line 6952 sub scantron_get_maxbubble {
|
|
|
foreach my $part_id (@{$analysis{'parts'}}) { |
foreach my $part_id (@{$analysis{'parts'}}) { |
|
|
|
|
my $lines = $analysis{"$part_id.bubble_lines"};; |
my $lines = $analysis{"$part_id.bubble_lines"};; |
|
|
|
|
|
|
# TODO - make this a persistent hash not an array. |
# TODO - make this a persistent hash not an array. |
|
|
|
|