version 1.460, 2007/10/17 09:40:49
|
version 1.461, 2007/10/17 10:48:20
|
Line 91 sub get_response_bubbles {
|
Line 91 sub get_response_bubbles {
|
my $selected = ""; |
my $selected = ""; |
|
|
for (my $bline = 0; $bline < $bubble_lines; $bline++) { |
for (my $bline = 0; $bline < $bubble_lines; $bline++) { |
$selected .= $$parsed_line{"scantron.$bubble_line.answer"}; |
$selected .= $$parsed_line{"scantron.$bubble_line.answer"}.":"; |
$bubble_line++; |
$bubble_line++; |
} |
} |
return $selected; |
return $selected; |
Line 5312 sub scantron_parse_scanline {
|
Line 5312 sub scantron_parse_scanline {
|
if ($bubble =~ /\d/) { |
if ($bubble =~ /\d/) { |
$record{"scantron.$ansnum.answer"} = $alphabet[$bubble]; |
$record{"scantron.$ansnum.answer"} = $alphabet[$bubble]; |
} else { |
} else { |
$record{"scantron.$ansnum.answer"}=''; |
$record{"scantron.$ansnum.answer"}=' '; |
} |
} |
$ansnum++; |
$ansnum++; |
} |
} |
Line 6432 ENDSCRIPT
|
Line 6432 ENDSCRIPT
|
$r->print("<p>Please indicate which bubble should be used for grading</p>"); |
$r->print("<p>Please indicate which bubble should be used for grading</p>"); |
foreach my $question (@{$arg}) { |
foreach my $question (@{$arg}) { |
my $selected = &get_response_bubbles($scan_record, $question); |
my $selected = &get_response_bubbles($scan_record, $question); |
my @select_array = split('',$selected); |
my @select_array = split(/:/,$selected); |
&scantron_bubble_selector($r,$scan_config,$question, |
&scantron_bubble_selector($r,$scan_config,$question, |
@select_array); |
@select_array); |
} |
} |
Line 6465 ENDSCRIPT
|
Line 6465 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 |
$selected - array of letters of previously selected bubbles |
$lines - array of answer lines. |
|
|
=cut |
=cut |
|
|
sub scantron_bubble_selector { |
sub scantron_bubble_selector { |
my ($r,$scan_config,$quest,@selected)=@_; |
my ($r,$scan_config,$quest,@lines)=@_; |
my $max=$$scan_config{'Qlength'}; |
my $max=$$scan_config{'Qlength'}; |
|
|
|
|
my $scmode=$$scan_config{'Qon'}; |
my $scmode=$$scan_config{'Qon'}; |
|
|
my $bubble_length = scalar(@selected); |
my $bubble_length = scalar(@lines); |
|
|
|
|
if ($scmode eq 'number' || $scmode eq 'letter') { $max=10; } |
if ($scmode eq 'number' || $scmode eq 'letter') { $max=10; } |
Line 6491 sub scantron_bubble_selector {
|
Line 6492 sub scantron_bubble_selector {
|
if ($l != 0) { |
if ($l != 0) { |
$r->print('<tr>'); |
$r->print('<tr>'); |
} |
} |
|
|
for (my $i=0;$i<$max;$i++) { |
for (my $i=0;$i<$max;$i++) { |
|
my @selected = split(//,$lines[$l]); |
$r->print("\n".'<td align="center">'); |
$r->print("\n".'<td align="center">'); |
if ($selected[0] eq $alphabet[$i]) { |
if ($selected[0] eq $alphabet[$i]) { |
$r->print('X'); |
$r->print('X'); |