'.
@@ -3363,7 +3400,7 @@ sub split_part_type {
my ($partstr) = @_;
my ($temp,@allparts)=split(/_/,$partstr);
my $type=pop(@allparts);
- my $part=join('.',@allparts);
+ my $part=join('_',@allparts);
return ($part,$type);
}
@@ -3866,9 +3903,9 @@ LISTJAVASCRIPT
''."\n".
''."\n".
''."\n";
-
- $result.=''."\n".
- ''."\n".
+
+ $result.=&build_section_inputs();
+ $result.=''."\n".
''."\n".
''."\n".
''." \n";
@@ -4382,7 +4419,7 @@ one of the predefined configurations for
like.
Next each scanline is checked for any errors of either 'missing
-bubbles' (it's an error because it may have been missed scanned
+bubbles' (it's an error because it may have been mis-scanned
because too light bubbling), 'double bubble' (each bubble line should
have no more that one letter picked), invalid or duplicated CODE,
invalid student ID
@@ -4393,7 +4430,7 @@ username:domain.
During the validation phase the instructor can choose to skip scanlines.
-After the validation phase, there is now 3 bubble sheet files
+After the validation phase, there are now 3 bubble sheet files
scantron_original_filename (unmodified original file)
scantron_corrected_filename (file where the corrected information has replaced the original information)
@@ -6463,6 +6500,7 @@ sub scantron_validate_doublebubble {
=cut
sub scantron_get_maxbubble {
+
if (defined($env{'form.scantron_maxbubble'}) &&
$env{'form.scantron_maxbubble'}) {
return $env{'form.scantron_maxbubble'};
@@ -6477,14 +6515,40 @@ sub scantron_get_maxbubble {
&Apache::lonxml::clear_problem_counter();
+ my $uname = $env{'form.student'};
+ my $udom = $env{'form.userdom'};
+ my $cid = $env{'request.course.id'};
+ my $total_lines = 0;
+ %bubble_lines_per_response = ();
+
foreach my $resource (@resources) {
+ my $symb = $resource->symb();
my $result=&Apache::lonnet::ssi($resource->src(),
- ('symb' => $resource->symb()));
+ ('symb' => $resource->symb()),
+ ('grade_target' => 'analyze'),
+ ('grade_courseid' => $cid),
+ ('grade_domain' => $udom),
+ ('grade_username' => $uname));
+ my (undef, $an) =
+ split(/_HASH_REF__/,$result, 2);
+
+ my %analysis = &Apache::lonnet::str2hash($an);
+
+
+
+ foreach my $part_id (@{$analysis{'parts'}}) {
+ my $bubble_lines = $analysis{"$part_id.bubble_lines"}[0];
+ if (!$bubble_lines) {
+ $bubble_lines = 1;
+ }
+ $bubble_lines_per_response{"$symb.$part_id"} = $bubble_lines;
+ $total_lines = $total_lines + $bubble_lines;
+ }
+
}
&Apache::lonnet::delenv('scantron\.');
$env{'form.scantron_maxbubble'} =
- &Apache::lonxml::get_problem_counter()-1;
-
+ $total_lines;
return $env{'form.scantron_maxbubble'};
}
@@ -7041,9 +7105,10 @@ sub gather_clicker_ids {
# Set up a couple variables.
my $username_idx = &Apache::loncoursedata::CL_SNAME();
my $domain_idx = &Apache::loncoursedata::CL_SDOM();
+ my $status_idx = &Apache::loncoursedata::CL_STATUS();
foreach my $student (keys(%$classlist)) {
-
+ if ($classlist->{$student}->[$status_idx] ne 'Active') { next; }
my $username = $classlist->{$student}->[$username_idx];
my $domain = $classlist->{$student}->[$domain_idx];
my $clickers =
@@ -7304,8 +7369,21 @@ ENDHEADER
$result.="\n".'';
$correct_count++;
} elsif ($clicker_ids{$id}) {
- $result.="\n".'';
- $student_count++;
+ if ($clicker_ids{$id}=~/\,/) {
+# More than one user with the same clicker!
+ $result.="\n".&mt('Clicker registered more than once').": ".$id." ";
+ $result.="\n".''.
+ "';
+ $unknown_count++;
+ } else {
+# Good: found one and only one user with the right clicker
+ $result.="\n".'';
+ $student_count++;
+ }
} else {
$result.="\n".&mt('Unregistered Clicker')." ".$id." ";
$result.="\n".''.
@@ -7456,6 +7534,8 @@ ENDHEADER
my $id=$1;
if (($env{'form.uname'.$id}) && ($env{'form.udom'.$id})) {
$user=$env{'form.uname'.$id}.':'.$env{'form.udom'.$id};
+ } elsif ($env{'form.multi'.$id}) {
+ $user=$env{'form.multi'.$id};
}
}
if ($user) {
@@ -7501,7 +7581,7 @@ ENDHEADER
sub handler {
my $request=$_[0];
- &reset_perm();
+ &reset_caches();
if ($env{'browser.mathml'}) {
&Apache::loncommon::content_type($request,'text/xml');
} else {
@@ -7545,10 +7625,6 @@ sub handler {
}
} else {
&init_perm();
-# &Apache::lonnet::logthis("command is $command");
-# foreach my $key (keys %perm) {
-# &Apache::lonnet::logthis("a key is $key");
-# }
if ($command eq 'submission' && $perm{'vgr'}) {
($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
@@ -7618,6 +7694,7 @@ sub handler {
}
}
$request->print(&Apache::loncommon::end_page());
+ &reset_caches();
return '';
}