version 1.489, 2007/11/13 01:47:36
|
version 1.490, 2007/11/13 11:06:54
|
Line 5406 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 5419 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 5448 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 5515 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 6951 sub scantron_get_maxbubble {
|
Line 6949 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. |
|
|
|
|