version 1.130, 2002/11/03 19:16:19
|
version 1.132, 2002/11/06 23:05:02
|
Line 290 sub start_problem {
|
Line 290 sub start_problem {
|
my $expression='$external::datestatus="'.$status.'";'; |
my $expression='$external::datestatus="'.$status.'";'; |
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.0.solved"}.'";'; |
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.0.solved"}.'";'; |
&Apache::run::run($expression,$safeeval); |
&Apache::run::run($expression,$safeeval); |
|
&Apache::lonxml::debug("Got $status"); |
if (( $status eq 'CLOSED' ) || |
if (( $status eq 'CLOSED' ) || |
( $status eq 'UNCHECKEDOUT') || |
( $status eq 'UNCHECKEDOUT') || |
( $status eq 'BANNED')) { |
( $status eq 'BANNED')) { |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser); |
if ( $target eq "web" ) { |
if ( $target eq "web" ) { |
$result.= $head_tag_start.'</head>'; |
$result.= $head_tag_start.'</head>'; |
my $msg=$body_tag_start. |
my $msg=$body_tag_start. |
Line 481 sub end_library {
|
Line 482 sub end_library {
|
} |
} |
|
|
sub start_block { |
sub start_block { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
|
|
my $result; |
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
my $code = @$parstack[$#$parstack]; |
$target eq 'tex' || $target eq 'analyze') { |
$code =~ s/\"//g; |
my $code = @$parstack[$#$parstack]; |
$code .=';return $condition;'; |
if ($code) { |
# print "<br />$code<br />"; |
$code =~ s/\"//g; |
my $result = &Apache::run::run($code,$safeeval); |
$code .=';return $condition;'; |
&Apache::lonxml::debug("block :$code: returned :$result:"); |
$result = &Apache::run::run($code,$safeeval); |
if ( ! $result ) { |
&Apache::lonxml::debug("block :$code: returned :$result:"); |
my $skip=&Apache::lonxml::get_all_text("/block",$$parser[$#$parser]); |
} else { |
&Apache::lonxml::debug("skipping ahead :$skip: $$parser[$#$parser]"); |
$result='1'; |
|
} |
|
if ( ! $result ) { |
|
my $skip=&Apache::lonxml::get_all_text("/block",$$parser[-1]); |
|
&Apache::lonxml::debug("skipping ahead :$skip: $$parser[-1]"); |
|
} |
|
$result=''; |
|
} elsif ($target eq 'edit') { |
|
$result .=&Apache::edit::tag_start($target,$token); |
|
$result .=&Apache::edit::text_arg('Test Condition:','condition', |
|
$token,40); |
|
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
|
} elsif ($target eq 'modified') { |
|
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
|
$safeeval,'condition'); |
|
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
} |
} |
} |
return $result; |
return ""; |
|
} |
} |
|
|
sub end_block { |
sub end_block { |