version 1.469, 2007/10/26 20:18:43
|
version 1.472, 2007/10/30 01:04:31
|
Line 5239 sub scan_data {
|
Line 5239 sub scan_data {
|
|
|
sub scantron_parse_scanline { |
sub scantron_parse_scanline { |
my ($line,$whichline,$scantron_config,$scan_data,$just_header)=@_; |
my ($line,$whichline,$scantron_config,$scan_data,$just_header)=@_; |
|
|
my %record; |
my %record; |
my $questions=substr($line,$$scantron_config{'Qstart'}-1); # Answers |
my $questions=substr($line,$$scantron_config{'Qstart'}-1); # Answers |
my $data=substr($line,0,$$scantron_config{'Qstart'}-1); # earlier stuff |
my $data=substr($line,0,$$scantron_config{'Qstart'}-1); # earlier stuff |
Line 5277 sub scantron_parse_scanline {
|
Line 5278 sub scantron_parse_scanline {
|
my $questnum=0; |
my $questnum=0; |
my $ansnum =1; # Multiple 'answer lines'/question. |
my $ansnum =1; # Multiple 'answer lines'/question. |
|
|
while ($questions) { |
chomp($questions); # Get rid of any trailing \n. |
|
$questions =~ s/\r$//; # Get rid of trailing \r too (MAC or Win uploads). |
|
while (length($questions)) { |
my $answers_needed = $bubble_lines_per_response{$questnum}; |
my $answers_needed = $bubble_lines_per_response{$questnum}; |
my $answer_length = $$scantron_config{'Qlength'} * $answers_needed; |
my $answer_length = $$scantron_config{'Qlength'} * $answers_needed; |
|
|
Line 5320 sub scantron_parse_scanline {
|
Line 5323 sub scantron_parse_scanline {
|
} |
} |
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
push(@{$record{"scantron.missingerror"}},$questnum); |
push(@{$record{"scantron.missingerror"}},$questnum); |
$ansnum += $answers_needed; |
# $ansnum += $answers_needed; |
} |
} |
|
|
} 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); |
$record{"scantron.$ansnum.answer"} = substr($currentquest, $ans, 1); |
Line 6480 ENDSCRIPT
|
Line 6482 ENDSCRIPT
|
join(',',@{$arg}).'" />'); |
join(',',@{$arg}).'" />'); |
foreach my $question (@{$arg}) { |
foreach my $question (@{$arg}) { |
my $selected = &get_response_bubbles($scan_record, $question); |
my $selected = &get_response_bubbles($scan_record, $question); |
&scantron_bubble_selector($r,$scan_config,$question); |
my @select_array = split(/:/,$selected); # ought to be an array of empties. |
|
&scantron_bubble_selector($r,$scan_config,$question, @select_array); |
} |
} |
} else { |
} else { |
$r->print("\n<ul>"); |
$r->print("\n<ul>"); |
Line 6500 ENDSCRIPT
|
Line 6503 ENDSCRIPT
|
$r - Apache request object |
$r - Apache request object |
$scan_config - hash from &get_scantron_config() |
$scan_config - hash from &get_scantron_config() |
$quest - number of the bubble line to make a corrector for |
$quest - number of the bubble line to make a corrector for |
$lines - array of answer lines. |
@lines - array of answer lines. |
|
|
=cut |
=cut |
|
|
Line 6871 sub scantron_validate_missingbubbles {
|
Line 6874 sub scantron_validate_missingbubbles {
|
$scan_data); |
$scan_data); |
if (!defined($$scan_record{'scantron.missingerror'})) { next; } |
if (!defined($$scan_record{'scantron.missingerror'})) { next; } |
my @to_correct; |
my @to_correct; |
|
|
|
# Probably here's where the error is... |
|
|
foreach my $missing (@{$$scan_record{'scantron.missingerror'}}) { |
foreach my $missing (@{$$scan_record{'scantron.missingerror'}}) { |
if ($missing > $max_bubble) { next; } |
if ($missing > $max_bubble) { next; } |
push(@to_correct,$missing); |
push(@to_correct,$missing); |
Line 7403 GRADINGMENUJS
|
Line 7409 GRADINGMENUJS
|
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
$result.='<table border="0"><tr><td bgcolor=#777777>'."\n". |
$result.=' |
'<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n". |
<div class="LC_grade_select_mode"> |
' <b>Select a Grading/Viewing Option</b></td></tr>'."\n". |
<div class="LC_grade_select_mode_header"> |
'<tr bgcolor="#ffffe6" valign="top"><td>'."\n"; |
'.&mt('Select a Grading/Viewing Option').' |
|
</div> |
$result.='<table width="100%" border="0">'; |
<div class="LC_grade_select_mode_body"> |
$result.='<tr bgcolor="#ffffe6" valign="top">'."\n"; |
<div class="LC_grade_select_mode_selector"> |
$result.='<td><b>'.&mt('Sections').'</b></td>'; |
<div class="LC_grade_select_mode_selector_header"> |
$result.='<td><b>'.&mt('Groups').'</b></td>'; |
'.&mt('Sections').' |
$result.='<td><b>'.&mt('Access Status').'</td>'."\n"; |
</div> |
$result.='<td><b>'.&mt('Submission Status').'</td>'."\n"; |
<div class="LC_grade_select_mode_selector_body"> |
$result.='</tr>'; |
<select name="section" multiple="multiple" size="5">'."\n"; |
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n". |
|
' <select name="section" multiple="multiple" size="3">'."\n"; |
|
if (ref($sections)) { |
if (ref($sections)) { |
foreach (sort (@$sections)) { |
foreach my $section (sort (@$sections)) { |
$result.='<option value="'.$_.'" '. |
$result.='<option value="'.$section.'" '. |
($saveSec eq $_ ? 'selected="selected"':'').'>'.$_.'</option>'."\n"; |
($saveSec eq $section ? 'selected="selected"':'').'>'.$section.'</option>'."\n"; |
} |
} |
} |
} |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
$result.= '</td><td>'."\n"; |
$result.=' |
$result.= &Apache::lonstatistics::GroupSelect('group','multiple',3); |
</div> |
$result.='</td><td>'."\n"; |
</div> |
$result.=&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,3,undef,'mult'); |
<div class="LC_grade_select_mode_selector"> |
|
<div class="LC_grade_select_mode_selector_header"> |
$result.='</td>'; |
'.&mt('Groups').' |
$result.='<td><select name="submitonly" size="3">'. |
</div> |
'<option value="yes" '. |
<div class="LC_grade_select_mode_selector_body"> |
($saveSub eq 'yes' ? 'selected="selected"' : '').'>'.&mt('with submissions').'</option>'. |
'.&Apache::lonstatistics::GroupSelect('group','multiple',5).' |
'<option value="queued" '. |
</div> |
($saveSub eq 'queued' ? 'selected="selected"' : '').'>'.&mt('in grading queue').'</option>'. |
</div> |
'<option value="graded" '. |
<div class="LC_grade_select_mode_selector"> |
($saveSub eq 'graded' ? 'selected="selected"' : '').'>'.&mt('with ungraded submissions').'</option>'. |
<div class="LC_grade_select_mode_selector_header"> |
'<option value="incorrect" '. |
'.&mt('Access Status').' |
($saveSub eq 'incorrect' ? 'selected="selected"' : '').'>'.&mt('with incorrect submissions').'</option>'. |
</div> |
'<option value="all" '. |
<div class="LC_grade_select_mode_selector_body"> |
($saveSub eq 'all' ? 'selected="selected"' : '').'>'.&mt('with any status').'</option></select></td></tr>'; |
'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').' |
|
</div> |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="3"><label>'. |
</div> |
'<input type="radio" name="radioChoice" value="submission" '. |
<div class="LC_grade_select_mode_selector"> |
($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '.'<b>'.&mt('Current Resource').':</b> '.&mt('For one or more students'). |
<div class="LC_grade_select_mode_selector_header"> |
'</label> </td></tr>'."\n"; |
'.&mt('Submission Status').' |
|
</div> |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="3">'. |
<div class="LC_grade_select_mode_selector_body"> |
'<label><input type="radio" name="radioChoice" value="viewgrades" '. |
<select name="submitonly" size="5"> |
|
<option value="yes" '. ($saveSub eq 'yes' ? 'selected="selected"' : '').'>'.&mt('with submissions').'</option> |
|
<option value="queued" '. ($saveSub eq 'queued' ? 'selected="selected"' : '').'>'.&mt('in grading queue').'</option> |
|
<option value="graded" '. ($saveSub eq 'graded' ? 'selected="selected"' : '').'>'.&mt('with ungraded submissions').'</option> |
|
<option value="incorrect" '.($saveSub eq 'incorrect' ? 'selected="selected"' : '').'>'.&mt('with incorrect submissions').'</option> |
|
<option value="all" '. ($saveSub eq 'all' ? 'selected="selected"' : '').'>'.&mt('with any status').'</option> |
|
</select> |
|
</div> |
|
</div> |
|
<div class="LC_grade_select_mode_type_body"> |
|
<div class="LC_grade_select_mode_type"> |
|
<label> |
|
<input type="radio" name="radioChoice" value="submission" '. |
|
($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '.&mt('<b>Current Resource:</b> For one or more students').' |
|
</label> |
|
</div> |
|
<div class="LC_grade_select_mode_type"> |
|
<label> |
|
<input type="radio" name="radioChoice" value="viewgrades" '. |
($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '. |
($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '. |
'<b>Current Resource:</b> For all students in selected section or course</label></td></tr>'."\n"; |
&mt('<b>Current Resource:</b> For all students in selected section or course').' |
|
</label> |
$result.='<tr bgcolor="#ffffe6"><td colspan="3"><br />'. |
</div> |
'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="Next->" />'. |
<div class="LC_grade_select_mode_type"> |
'</td></tr>'."\n"; |
<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next->').'" /> |
|
</div> |
|
<div class="LC_grade_select_mode_type"> |
$result.='<tr bgcolor="#ffffe6" valign="top"><td colspan="3">'. |
<label> |
'<br /><label><input type="radio" name="radioChoice" value="pickStudentPage" '. |
<input type="radio" name="radioChoice" value="pickStudentPage" '. |
($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '. |
($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '. |
'The <b>complete</b> set/page/sequence/folder: For one student</label></td></tr>'."\n"; |
&mt('The <b>complete</b> set/page/sequence/folder: For one student').' |
|
</label> |
$result.='<tr bgcolor="#ffffe6"><td colspan="3"><br />'. |
</div> |
'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="Next->" />'. |
<div class="LC_grade_select_mode_type"> |
'</td></tr></table>'."\n"; |
<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next->').'" /> |
|
</div> |
$result.='</td>'; #<td valign="top">'; |
</div> |
|
</div> |
# $result.='<table width="100%" border="0">'; |
</div> |
# $result.='<tr bgcolor="#ffffe6"><td>'. |
</form>'; |
# '<input type="button" onClick="javascript:checkChoice(this.form,\'3\',\'csvform\');" value="'.&mt('Upload').'" />'. |
|
# ' '.&mt('scores from file').' </td></tr>'."\n"; |
|
# |
|
# $result.='<tr bgcolor="#ffffe6"><td>'. |
|
# '<input type="button" onClick="javascript:checkChoice(this.form,\'6\',\'processclicker\');" value="'.&mt('Process').'" />'. |
|
# ' '.&mt('clicker file').' </td></tr>'."\n"; |
|
# |
|
# $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
|
# '<input type="button" onClick="javascript:checkChoice(this.form,\'4\',\'scantron_selectphase\');'. |
|
# '" value="'.&mt('Grade').'" /> scantron forms</td></tr>'."\n"; |
|
# |
|
# if ((&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) && ($symb)) { |
|
# $result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
|
# '<input type="button" onClick="javascript:checkChoice(this.form,\'5\',\'verify\');" value="'.&mt('Verify').'" />'. |
|
# ' '.&mt('receipt').': '. |
|
# &Apache::lonnet::recprefix($env{'request.course.id'}). |
|
# '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />'. |
|
# '</td></tr>'."\n"; |
|
# } |
|
# $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
|
# '<input type="button" onClick="javascript:this.form.action=\'/adm/helper/resettimes.helper\';this.form.submit();'. |
|
# '" value="'.&mt('Manage').'" /> access times.</td></tr>'."\n"; |
|
# $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
|
# '<input type="button" onClick="javascript:this.form.command.value=\'codelist\';this.form.action=\'/adm/pickcode\';this.form.submit();'. |
|
# '" value="'.&mt('View').'" /> saved CODEs.</td></tr>'."\n"; |
|
# |
|
# $result.='</table>'."\n".'</td>'; |
|
$result.= '</tr></table>'."\n". |
|
'</td></tr></table></form>'."\n"; |
|
return $result; |
return $result; |
} |
} |
|
|