version 1.319, 2005/11/09 12:04:23
|
version 1.323, 2005/11/18 20:29:13
|
Line 346 sub initialize_storage {
|
Line 346 sub initialize_storage {
|
sub finalize_storage { |
sub finalize_storage { |
my $result; |
my $result; |
if (%Apache::lonhomework::results) { |
if (%Apache::lonhomework::results) { |
|
my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results)); |
|
delete(@Apache::lonhomework::results{@remove}); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
if ($env{'request.state'} eq 'construct' || $symb eq '') { |
if ($env{'request.state'} eq 'construct' || $symb eq '') { |
$Apache::lonhomework::results{'rndseed'}=$env{'form.rndseed'}; |
$Apache::lonhomework::results{'rndseed'}=$env{'form.rndseed'}; |
Line 360 sub finalize_storage {
|
Line 362 sub finalize_storage {
|
&store_aggregates($symb,$courseid); |
&store_aggregates($symb,$courseid); |
} |
} |
} |
} |
|
} else { |
|
&Apache::lonxml::debug('Nothing to store'); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 513 sub start_problem {
|
Line 517 sub start_problem {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
|
# We'll use the redirection to fix up printing of duedates. |
# We'll use the redirection to fix up printing of duedates. |
&Apache::lonxml::startredirection(); |
if (!$Apache::lonxml::metamode) { |
|
&Apache::lonxml::startredirection(); |
|
} |
|
|
# Problems don't nest and we don't allow more than one <problem> in |
# Problems don't nest and we don't allow more than one <problem> in |
# a .problem file. |
# a .problem file. |
Line 683 sub start_problem {
|
Line 689 sub start_problem {
|
|
|
sub end_problem { |
sub end_problem { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $result= &Apache::lonxml::endredirection(); # started in &start_problem |
my $result; |
|
|
# Figure out the front matter which was too deeply coupled for me to easily |
if (!$Apache::lonxml::metamode) { |
# unravel and replace the INSERTTEXFRONTMATTERHERE in result with it. |
$result = &Apache::lonxml::endredirection(); #started in &start_problem |
# note that we do this in end_problem because whether or not we display |
} |
# due dates depends on whether due dates have already been displayed in the problem parts. |
|
|
|
if ($target eq 'tex') { |
if ($target eq 'tex') { |
|
|
|
# Figure out the front matter and replace the |
|
# INSERTTEXFRONTMATTERHERE in result with it. note that we do |
|
# this in end_problem because whether or not we display due |
|
# dates depends on whether due dates have already been |
|
# displayed in the problem parts. |
|
|
my $frontmatter = ''; |
my $frontmatter = ''; |
my $startminipage = ''; |
my $startminipage = ''; |
if (not $env{'form.problem_split'}=~/yes/) { |
if (not $env{'form.problem_split'}=~/yes/) { |
Line 841 sub end_problem {
|
Line 853 sub end_problem {
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
&Apache::lonxml::debug("in end_problem with $target, edit"); |
&Apache::lonxml::debug("in end_problem with $target, edit"); |
$result .= &problem_edit_footer(); |
$result .= &problem_edit_footer(); |
|
} elsif ($target eq 'modified') { |
|
$result .= $token->[2]; |
|
$result.=&Apache::edit::handle_insertafter($token->[1]); |
} |
} |
|
|
if ($env{'request.state'} eq 'construct' && $target eq 'web') { |
if ($env{'request.state'} eq 'construct' && $target eq 'web') { |
Line 1212 sub ordered_show_check {
|
Line 1227 sub ordered_show_check {
|
|
|
sub start_part { |
sub start_part { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
&Apache::lonxml::startredirection(); # we'll use redirection to fix up |
if (!$Apache::lonxml::metamode) { |
# duedates. |
&Apache::lonxml::startredirection(); # we'll use redirection to fix up |
|
# duedates. |
|
} |
my $result=''; |
my $result=''; |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } |
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } |
Line 1322 sub end_part {
|
Line 1339 sub end_part {
|
my $status=$Apache::inputtags::status['-1']; |
my $status=$Apache::inputtags::status['-1']; |
my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part); |
my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part); |
my $in_order_show=&ordered_show_check(); |
my $in_order_show=&ordered_show_check(); |
my $result= &Apache::lonxml::endredirection(); # started in &start_part |
my $result; |
|
if (!$Apache::lonxml::metamode) { |
|
$result = &Apache::lonxml::endredirection(); # started in &start_part |
|
} |
if ($target eq 'grade') { |
if ($target eq 'grade') { |
if (($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) && |
if (($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) && |
!$hidden && $in_order_show) { |
!$hidden && $in_order_show) { |
Line 1342 sub end_part {
|
Line 1362 sub end_part {
|
if ($$tagstack[-2] eq 'td' and $target eq 'tex') {$result.='\end{minipage}';} |
if ($$tagstack[-2] eq 'td' and $target eq 'tex') {$result.='\end{minipage}';} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::end_table(); |
$result.=&Apache::edit::end_table(); |
|
} elsif ($target eq 'modified') { |
|
$result .= $token->[2]; |
|
$result.=&Apache::edit::handle_insertafter($token->[1]); |
} |
} |
pop @Apache::inputtags::status; |
pop @Apache::inputtags::status; |
$Apache::inputtags::part=''; |
$Apache::inputtags::part=''; |