version 1.5, 2001/01/22 16:42:01
|
version 1.7, 2001/02/07 00:27:32
|
Line 2 package Apache::hinttags;
|
Line 2 package Apache::hinttags;
|
|
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use capa; |
|
|
sub BEGIN { |
sub BEGIN { |
&Apache::lonxml::register('Apache::hinttags',('hintgroup','hintpart','numericalhint')); |
&Apache::lonxml::register('Apache::hinttags',('hintgroup','hintpart','numericalhint')); |
Line 26 sub start_hintgroup {
|
Line 27 sub start_hintgroup {
|
if ($target eq 'web') {$result='<table bgcolor="#dddddd"><tr><td>';} |
if ($target eq 'web') {$result='<table bgcolor="#dddddd"><tr><td>';} |
} |
} |
} |
} |
if ($skiptoend) { |
if ($skiptoend && $target ne 'meta') { |
&Apache::lonxml::get_all_text("/hintgroup",$$parser[$#$parser]); |
&Apache::lonxml::get_all_text("/hintgroup",$$parser[$#$parser]); |
} |
} |
@Apache::hint::which=(); |
@Apache::hint::which=(); |
Line 61 sub end_numericalhint {
|
Line 62 sub end_numericalhint {
|
my $result; |
my $result; |
if ($target ne 'meta' && $target ne 'grade') { |
if ($target ne 'meta' && $target ne 'grade') { |
my $args =''; |
my $args =''; |
|
$safeeval->share_from('capa',['&caparesponse_capa_check_answer']); |
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } |
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } |
my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); |
my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); |
my $response = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.$Apache::inputtags::response['-1'].submission"}; |
my $response = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.$Apache::inputtags::response['-1'].submission"}; |
Line 71 sub end_numericalhint {
|
Line 73 sub end_numericalhint {
|
';my $sig="'.$Apache::inputtags::params{'sig'}.'"'. |
';my $sig="'.$Apache::inputtags::params{'sig'}.'"'. |
"');"; |
"');"; |
$result = &Apache::run::run($expression,$safeeval); |
$result = &Apache::run::run($expression,$safeeval); |
|
&Apache::lonxml::debug("$expression:result:$result:$Apache::lonxml::curdepth"); |
my ($awards) = split /:/ , $result; |
my ($awards) = split /:/ , $result; |
my ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards); |
my ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards); |
if ($ad eq 'EXACT_ANS' || $ad eq 'APPROX_ANS') { push (@Apache::hint::which,$name); } |
if ($ad eq 'EXACT_ANS' || $ad eq 'APPROX_ANS') { push (@Apache::hint::which,$name); } |
&Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n"); |
|
$result=''; |
$result=''; |
} |
} |
return $result; |
return $result; |