version 1.150, 2006/12/04 20:35:06
|
version 1.152, 2006/12/04 21:23:01
|
Line 373 sub start_customresponse {
|
Line 373 sub start_customresponse {
|
if ( &Apache::response::show_answer() ) { |
if ( &Apache::response::show_answer() ) { |
my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack, |
my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack, |
$safeeval); |
$safeeval); |
$Apache::inputtags::answertxt{$id}=$answer; |
$Apache::inputtags::answertxt{$id}=[$answer]; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
Line 464 sub start_mathresponse {
|
Line 464 sub start_mathresponse {
|
if ( &Apache::response::show_answer() ) { |
if ( &Apache::response::show_answer() ) { |
my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack, |
my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack, |
$safeeval); |
$safeeval); |
$Apache::inputtags::answertxt{$id}=$answer; |
$Apache::inputtags::answertxt{$id}=[$answer]; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
Line 516 sub end_mathresponse {
|
Line 516 sub end_mathresponse {
|
|
|
my $award = &Apache::run::run('{ my $submission=$LONCAPA::mathresponse_submission;'.$Apache::response::custom_answer.'}',$safeeval); |
my $award = &Apache::run::run('{ my $submission=$LONCAPA::mathresponse_submission;'.$Apache::response::custom_answer.'}',$safeeval); |
if (!&Apache::inputtags::valid_award($award)) { |
if (!&Apache::inputtags::valid_award($award)) { |
if ($award==1) { |
$error = $award; |
$award='EXACT_ANS'; |
$award = 'ERROR'; |
} elsif ($award==0) { |
|
$award='INCORRECT'; |
|
} else { |
|
$error = $award; |
|
$award = 'ERROR'; |
|
} |
|
} |
} |
&Apache::response::handle_previous(\%previous,$award); |
&Apache::response::handle_previous(\%previous,$award); |
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}= |
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}= |