version 1.76, 2002/07/24 20:10:43
|
version 1.78, 2002/10/14 20:47:11
|
Line 57 sub start_script {
|
Line 57 sub start_script {
|
if ( $target eq "modified" ) { |
if ( $target eq "modified" ) { |
$result=$token->[4].&Apache::edit::modifiedfield(); |
$result=$token->[4].&Apache::edit::modifiedfield(); |
} elsif ( $target eq 'web' || $target eq 'tex' || |
} elsif ( $target eq 'web' || $target eq 'tex' || |
$target eq 'grade' || $target eq 'answer') { |
$target eq 'grade' || $target eq 'answer' || |
|
$target eq 'analyze' ) { |
&Apache::run::run($bodytext,$safeeval); |
&Apache::run::run($bodytext,$safeeval); |
if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) { |
if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) { |
$Apache::lonxml::evaluate--; |
$Apache::lonxml::evaluate--; |
Line 71 sub start_script {
|
Line 72 sub start_script {
|
#&Apache::run::run($bodytext,$safeeval); |
#&Apache::run::run($bodytext,$safeeval); |
#$result="<br /> <$token->[1]> output: <br />$bodytext<br />Source:<br />"; |
#$result="<br /> <$token->[1]> output: <br />$bodytext<br />Source:<br />"; |
$result=&Apache::edit::tag_start($target,$token,'Script'); |
$result=&Apache::edit::tag_start($target,$token,'Script'); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',50,4); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4); |
} |
} |
} else { |
} else { |
if ($target ne "meta") { |
if ($target ne "meta") { |
Line 93 sub end_script {
|
Line 94 sub end_script {
|
return $token->[2]; |
return $token->[2]; |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
return &Apache::edit::end_table(); |
return &Apache::edit::end_table(); |
} elsif (($target eq 'answer')) { |
} elsif ($target eq 'answer') { |
$Apache::lonxml::evaluate++; |
$Apache::lonxml::evaluate++; |
} |
} |
return ''; |
return ''; |
Line 108 sub start_display {
|
Line 109 sub start_display {
|
if ( $target eq "modified" ) { |
if ( $target eq "modified" ) { |
$result=$token->[4].&Apache::edit::modifiedfield(); |
$result=$token->[4].&Apache::edit::modifiedfield(); |
} elsif ( $target eq 'web' || $target eq 'tex' || |
} elsif ( $target eq 'web' || $target eq 'tex' || |
$target eq 'grade' || $target eq 'answer') { |
$target eq 'grade' || $target eq 'answer' || |
|
$target eq 'analyze') { |
$result=&Apache::run::run($bodytext,$safeeval); |
$result=&Apache::run::run($bodytext,$safeeval); |
if ($target eq 'grade' || $target eq 'answer' ) { |
if ($target eq 'grade' || $target eq 'answer' || |
|
$target eq 'analyze') { |
$result=''; # grade should produce no output |
$result=''; # grade should produce no output |
} |
} |
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
Line 118 sub start_display {
|
Line 121 sub start_display {
|
# "<br /> <$token->[1]> output: <br />$bodytext<br />Source:<br />"; |
# "<br /> <$token->[1]> output: <br />$bodytext<br />Source:<br />"; |
#$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); |
#$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); |
$result=&Apache::edit::tag_start($target,$token,'Script With Display'); |
$result=&Apache::edit::tag_start($target,$token,'Script With Display'); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1) |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,1) |
} |
} |
return $result; |
return $result; |
} |
} |
Line 135 sub start_scriptlib {
|
Line 138 sub start_scriptlib {
|
my $result =''; |
my $result =''; |
my $error=''; |
my $error=''; |
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit' || $target eq 'answer') { |
if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || |
|
$target eq 'edit' || $target eq 'answer' || $target eq 'analyze') { |
$bodytext=$$parser[$#$parser]->get_text("/scriptlib"); |
$bodytext=$$parser[$#$parser]->get_text("/scriptlib"); |
$bodytext=&Apache::run::evaluate($bodytext,$safeeval, |
$bodytext=&Apache::run::evaluate($bodytext,$safeeval, |
$$parstack[$#$parstack]); |
$$parstack[$#$parstack]); |
Line 180 sub start_parserlib {
|
Line 184 sub start_parserlib {
|
my $bodytext; |
my $bodytext; |
my $result =""; |
my $result =""; |
my $error=''; |
my $error=''; |
if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit' || $target eq 'answer') { |
if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || |
|
$target eq 'edit' || $target eq 'answer' || $target eq 'analyze') { |
$bodytext=$$parser[$#$parser]->get_text("/parserlib"); |
$bodytext=$$parser[$#$parser]->get_text("/parserlib"); |
$bodytext=&Apache::run::evaluate($bodytext,$safeeval, |
$bodytext=&Apache::run::evaluate($bodytext,$safeeval, |
$$parstack[$#$parstack]); |
$$parstack[$#$parstack]); |
Line 253 sub start_import {
|
Line 258 sub start_import {
|
|
|
$bodytext=Apache::run::evaluate($bodytext,$safeeval,$$parstack[$#$parstack]); |
$bodytext=Apache::run::evaluate($bodytext,$safeeval,$$parstack[$#$parstack]); |
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||$target eq 'tex') { |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
|
$target eq 'tex' || $target eq 'analyze' ) { |
# FIXME this probably needs to be smart about construction vs. |
# FIXME this probably needs to be smart about construction vs. |
# non construction space. |
# non construction space. |
my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
Line 367 sub start_comment {
|
Line 373 sub start_comment {
|
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result=&Apache::edit::tag_start($target,$token); |
$result=&Apache::edit::tag_start($target,$token); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,4) |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4) |
} elsif ( $target eq 'modified') { |
} elsif ( $target eq 'modified') { |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
} elsif ( $target eq 'web' || $target eq 'tex' || |
} elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || |
$target eq 'grade' || $target eq 'answer' || $target eq 'meta') { |
$target eq 'answer' || $target eq 'meta' || $target eq 'analyze') { |
#normally throw away comments |
#normally throw away comments |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
} |
} |