version 1.328, 2006/03/07 02:50:15
|
version 1.330, 2006/03/10 23:49:29
|
Line 1497 sub handback_box {
|
Line 1497 sub handback_box {
|
sub show_problem { |
sub show_problem { |
my ($request,$symb,$uname,$udom,$removeform,$viewon,$mode) = @_; |
my ($request,$symb,$uname,$udom,$removeform,$viewon,$mode) = @_; |
my $rendered; |
my $rendered; |
|
&Apache::lonxml::remember_problem_counter(); |
if ($mode eq 'both' or $mode eq 'text') { |
if ($mode eq 'both' or $mode eq 'text') { |
$rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
$rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
Line 1508 sub show_problem {
|
Line 1509 sub show_problem {
|
} |
} |
my $companswer; |
my $companswer; |
if ($mode eq 'both' or $mode eq 'answer') { |
if ($mode eq 'both' or $mode eq 'answer') { |
|
&Apache::lonxml::restore_problem_counter(); |
$companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
$companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
} |
} |
Line 1594 sub submission {
|
Line 1596 sub submission {
|
} elsif ($env{'form.vAns'} eq 'yes') { |
} elsif ($env{'form.vAns'} eq 'yes') { |
$mode='answer'; |
$mode='answer'; |
} |
} |
|
&Apache::lonxml::clear_problem_counter(); |
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode)); |
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode)); |
} |
} |
|
|
Line 1692 KEYWORDS
|
Line 1695 KEYWORDS
|
} elsif ($env{'form.vAns'} eq 'all') { |
} elsif ($env{'form.vAns'} eq 'all') { |
$mode='answer'; |
$mode='answer'; |
} |
} |
|
&Apache::lonxml::clear_problem_counter(); |
$request->print(&show_problem($request,$symb,$uname,$udom,1,1,$mode)); |
$request->print(&show_problem($request,$symb,$uname,$udom,1,1,$mode)); |
} |
} |
|
|
Line 3755 sub displayPage {
|
Line 3759 sub displayPage {
|
'<td align="center"><b> Prob. </b></td>'. |
'<td align="center"><b> Prob. </b></td>'. |
'<td><b> '.($env{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade</b></td></tr>'; |
'<td><b> '.($env{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade</b></td></tr>'; |
|
|
|
&Apache::lonxml::clear_problem_counter(); |
my ($depth,$question,$prob) = (1,1,1); |
my ($depth,$question,$prob) = (1,1,1); |
$iterator->next(); # skip the first BEGIN_MAP |
$iterator->next(); # skip the first BEGIN_MAP |
my $curRes = $iterator->next(); # for "current resource" |
my $curRes = $iterator->next(); # for "current resource" |
Line 4746 sub scantron_validate_file {
|
Line 4751 sub scantron_validate_file {
|
$r->print("<p>Gathering neccessary info.</p>");$r->rflush(); |
$r->print("<p>Gathering neccessary info.</p>");$r->rflush(); |
#get the student pick code ready |
#get the student pick code ready |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
my $max_bubble=&scantron_get_maxbubble($r); |
my $max_bubble=&scantron_get_maxbubble(); |
my $result=&scantron_form_start($max_bubble).$default_form_data; |
my $result=&scantron_form_start($max_bubble).$default_form_data; |
$r->print($result); |
$r->print($result); |
|
|
Line 5245 sub scantron_validate_doublebubble {
|
Line 5250 sub scantron_validate_doublebubble {
|
return (0,$currentphase+1); |
return (0,$currentphase+1); |
} |
} |
|
|
sub scantron_get_maxbubble { |
sub scantron_get_maxbubble { |
my ($r)=@_; |
|
if (defined($env{'form.scantron_maxbubble'}) && |
if (defined($env{'form.scantron_maxbubble'}) && |
$env{'form.scantron_maxbubble'}) { |
$env{'form.scantron_maxbubble'}) { |
return $env{'form.scantron_maxbubble'}; |
return $env{'form.scantron_maxbubble'}; |
} |
} |
|
|
my $navmap=Apache::lonnavmaps::navmap->new(); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
my (undef,undef,$sequence)= |
my (undef,undef,$sequence)= |
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
|
|
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
&Apache::lonnet::delenv('form.counter'); |
|
|
&Apache::lonxml::clear_problem_counter(); |
|
|
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |
my $result=&Apache::lonnet::ssi($resource->src().'?symb='.&Apache::lonnet::escape($resource->symb())); |
my $result=&Apache::lonnet::ssi($resource->src(), |
|
('symb' => $resource->symb())); |
} |
} |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
my $envfile=$env{'user.environment'}; |
$env{'form.scantron_maxbubble'} = |
$envfile=~/\/([^\/]+)\.id$/; |
&Apache::lonxml::get_problem_counter()-1; |
$envfile=$1; |
|
&Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), |
|
$envfile); |
|
$env{'form.scantron_maxbubble'}=$env{'form.counter'}-1; |
|
return $env{'form.scantron_maxbubble'}; |
return $env{'form.scantron_maxbubble'}; |
} |
} |
|
|
Line 5360 SCANTRONFORM
|
Line 5366 SCANTRONFORM
|
next; |
next; |
} |
} |
($uname,$udom)=split(/:/,$uname); |
($uname,$udom)=split(/:/,$uname); |
&Apache::lonnet::delenv('form.counter'); |
|
|
&Apache::lonxml::clear_problem_counter(); |
&Apache::lonnet::appenv(%$scan_record); |
&Apache::lonnet::appenv(%$scan_record); |
|
|
my $i=0; |
my $i=0; |
Line 5388 SCANTRONFORM
|
Line 5395 SCANTRONFORM
|
$completedstudents{$uname}={'line'=>$line}; |
$completedstudents{$uname}={'line'=>$line}; |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
} continue { |
} continue { |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonxml::clear_problem_counter(); |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
} |
} |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |