');
foreach my $student (@skipped) { $request->print("$student \n"); }
}
if (@notallowed) {
- $request->print('
Students Not Allowed to Modify
');
+ $request->print('
'.&mt('Students Not Allowed to Modify').'
');
foreach my $student (@notallowed) { $request->print("$student \n"); }
}
$request->print(" \n");
@@ -4681,9 +4681,10 @@ my %bubble_lines_per_response; # no.
my %first_bubble_line; # First bubble line no. for each bubble.
-my %subdivided_bubble_lines; # no. bubble lines for optionresponse
- # or matchresponse where an individual
- # response can have multiple lines
+my %subdivided_bubble_lines; # no. bubble lines for optionresponse,
+ # matchresponse or rankresponse, where
+ # an individual response can have multiple
+ # lines
my %responsetype_per_response; # responsetype for each response
@@ -5524,6 +5525,10 @@ sub scantron_validator_positional {
# If the split only gives us one element.. the full length of the
# answer string, no bubbles are filled in:
+ if ($answers_needed eq '') {
+ return;
+ }
+
if (length($array[0]) eq $$scantron_config{'Qlength'}*$answers_needed) {
for (my $ans=0; $ans<$answers_needed; $ans++ ) {
$record->{"scantron.$ansnum.answer"}='';
@@ -5950,6 +5955,8 @@ SCANTRONFORM
''."\n";
$chunk .=
''."\n";
+ $chunk .=
+ ''."\n";
$result .= $chunk;
$line++;
}
@@ -6760,7 +6767,7 @@ sub questions_to_line_list {
$first = $first_bubble_line{$question-1} + 1;
$count = $bubble_lines_per_response{$question-1};
}
- my $last = $first+$count-1;
+ $last = $first+$count-1;
push(@lines, ($first..$last));
}
return join(',', @lines);
@@ -6786,8 +6793,8 @@ for multi and missing bubble cases).
Numbered from 0 (but question numbers are from
1.
%first_bubble_line - Starting bubble line for each question.
- %subdivided_bubble_lines - optionresponse and matchresponse type
- problems render as separate sub-questions,
+ %subdivided_bubble_lines - optionresponse, matchresponse and rankresponse
+ type problems render as separate sub-questions,
in exam mode. This hash contains a
comma-separated list of the lines per
sub-question.
@@ -7107,7 +7114,7 @@ sub scantron_validate_doublebubble {
which are the total number of bubble, lines, the number of bubble
lines for response n and number of the first bubble line for response n,
and a comma separated list of numbers of bubble lines for sub-questions
- (for optionresponse items only), for response n.
+ (for optionresponse, matchresponse, and rankresponse items), for response n.
=cut
@@ -7180,10 +7187,11 @@ sub scantron_get_maxbubble {
# TODO - make this a persistent hash not an array.
- # optionresponse and matchresponse type items render as
- # separate sub-questions in exam mode.
+ # optionresponse, matchresponse and rankresponse type items
+ # render as separate sub-questions in exam mode.
if (($analysis{$part_id.'.type'} eq 'optionresponse') ||
- ($analysis{$part_id.'.type'} eq 'matchresponse')) {
+ ($analysis{$part_id.'.type'} eq 'matchresponse') ||
+ ($analysis{$part_id.'.type'} eq 'rankresponse')) {
my ($numbub,$numshown);
if ($analysis{$part_id.'.type'} eq 'optionresponse') {
if (ref($analysis{$part_id.'.options'}) eq 'ARRAY') {
@@ -7193,6 +7201,10 @@ sub scantron_get_maxbubble {
if (ref($analysis{$part_id.'.items'}) eq 'ARRAY') {
$numbub = scalar(@{$analysis{$part_id.'.items'}});
}
+ } elsif ($analysis{$part_id.'.type'} eq 'rankresponse') {
+ if (ref($analysis{$part_id.'.foils'}) eq 'ARRAY') {
+ $numbub = scalar(@{$analysis{$part_id.'.foils'}});
+ }
}
if (ref($analysis{$part_id.'.shown'}) eq 'ARRAY') {
$numshown = scalar(@{$analysis{$part_id.'.shown'}});
@@ -7260,7 +7272,25 @@ sub scantron_validate_missingbubbles {
# Probably here's where the error is...
foreach my $missing (@{$$scan_record{'scantron.missingerror'}}) {
- if ($missing > $max_bubble) { next; }
+ my $lastbubble;
+ if ($missing =~ /^(\d+)\.(\d+)$/) {
+ my $question = $1;
+ my $subquestion = $2;
+ if (!defined($first_bubble_line{$question -1})) { next; }
+ my $first = $first_bubble_line{$question-1};
+ my @subans = split(/,/,$subdivided_bubble_lines{$question-1});
+ my $subcount = 1;
+ while ($subcount<$subquestion) {
+ $first += $subans[$subcount-1];
+ $subcount ++;
+ }
+ my $count = $subans[$subquestion-1];
+ $lastbubble = $first + $count;
+ } else {
+ if (!defined($first_bubble_line{$missing - 1})) { next; }
+ $lastbubble = $first_bubble_line{$missing - 1} + $bubble_lines_per_response{$missing - 1};
+ }
+ if ($lastbubble > $max_bubble) { next; }
push(@to_correct,$missing);
}
if (@to_correct) {