--- loncom/homework/hint.pm 2006/12/19 14:53:17 1.67 +++ loncom/homework/hint.pm 2008/09/12 09:56:09 1.70 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # implements the tags that control the hints # -# $Id: hint.pm,v 1.67 2006/12/19 14:53:17 www Exp $ +# $Id: hint.pm,v 1.70 2008/09/12 09:56:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,7 +74,6 @@ sub start_hintgroup { my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'showoncorrect'); if ($constructtag) { $result =&Apache::edit::rebuild_tag($token); - $result.=&Apache::edit::handle_insert(); } } @Apache::hint::which=(); @@ -141,7 +140,6 @@ sub start_numericalhint { } if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } } elsif ($target eq 'web') { &Apache::response::reset_params(); @@ -162,7 +160,7 @@ sub end_numericalhint { my $partid=$Apache::inputtags::part; my $id=$Apache::inputtags::hint[-1]; - #id submissions occured under + #id submissions occurred under my $submitid=$Apache::inputtags::response[-1]; my $response = $Apache::lonhomework::history{ @@ -196,7 +194,7 @@ sub end_numericalhint { dclone($answer{$ans_name}); &Apache::caparesponse::setup_capa_response($args_ref,$response); my ($result,@msgs) = - &Apache::run::run("&caparesponse_check_list()",$safeeval); + &Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval); &Apache::lonxml::debug("checking $ans_name $result with $response"); &Apache::lonxml::debug('msgs are '.join(':',@msgs)); my ($awards)=split(/:/,$result); @@ -256,7 +254,6 @@ sub start_mathhint { $safeeval,'name','cas', 'args'); $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } elsif ($target eq 'web') { &Apache::response::reset_params(); } @@ -314,7 +311,6 @@ sub start_customhint { $constructtag=&Apache::edit::get_new_args($token,$parstack, $safeeval,'name'); $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } elsif ($target eq 'web') { &Apache::response::reset_params(); } @@ -381,7 +377,6 @@ sub start_stringhint { $safeeval,'name','answer', 'type'); $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } elsif ($target eq 'web') { &Apache::response::reset_params(); } @@ -400,7 +395,7 @@ sub end_stringhint { &Apache::response::setup_params('stringhint',$safeeval); my $partid=$Apache::inputtags::part; my $id=$Apache::inputtags::hint[-1]; - #id submissions occured under + #id submissions occurred under my $submitid=$Apache::inputtags::response[-1]; my $response = $Apache::lonhomework::history{ "resource.$partid.$submitid.submission"}; @@ -433,7 +428,7 @@ sub end_stringhint { foreach my $ans_name (keys(%answer)) { &Apache::lonxml::debug(" doing $ans_name with ".join(':',@{ $answer{$ans_name}{'answers'} })); ${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$ans_name}); - my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); + my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval); &Apache::lonxml::debug('msgs are'.join(':',@msgs)); my ($awards) = split(/:/,$result); my (@awards) = split(/,/,$awards); @@ -492,7 +487,6 @@ sub start_hintpart { $safeeval,'on'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); - $result.=&Apache::edit::handle_insert(); } } return $result; @@ -522,7 +516,6 @@ sub start_optionhint { 'answer','concept'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } } elsif ($target eq 'meta') { $result=&Apache::response::meta_package_write('numericalhint'); @@ -537,7 +530,7 @@ sub end_optionhint { my ($foilmatch,$conceptmatch)=(-1,-1); my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval); my $partid=$Apache::inputtags::part; - #id submissions occured under + #id submissions occurred under my $submitid=$Apache::inputtags::response[-1]; my $part_id="$partid.$submitid"; my %answer; @@ -601,7 +594,6 @@ sub start_radiobuttonhint { 'answer'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); - $result .= &Apache::edit::handle_insert(); } } elsif ($target eq 'meta') { $result=&Apache::response::meta_package_write('numericalhint'); @@ -618,7 +610,7 @@ sub end_radiobuttonhint { my $answer=&Apache::lonxml::get_param('answer',$parstack,$safeeval); eval('@answer ='.$answer); my $partid=$Apache::inputtags::part; - #id submissions occured under + #id submissions occurred under my $submitid=$Apache::inputtags::response[-1]; my $part_id="$partid.$submitid"; my $response = $Apache::lonhomework::history{