Diff for /loncom/homework/hint.pm between versions 1.55 and 1.58

version 1.55, 2004/08/24 15:56:13 version 1.58, 2004/12/06 19:48:22
Line 54  sub start_hintgroup { Line 54  sub start_hintgroup {
     $Apache::lonhomework::history{"resource.$id.solved"};      $Apache::lonhomework::history{"resource.$id.solved"};
  my $showoncorrect=lc(&Apache::lonxml::get_param('showoncorrect',$parstack,$safeeval));   my $showoncorrect=lc(&Apache::lonxml::get_param('showoncorrect',$parstack,$safeeval));
  &Apache::lonxml::debug("onc orrect $showoncorrect, $gradestatus");   &Apache::lonxml::debug("onc orrect $showoncorrect, $gradestatus");
  if ( ($showoncorrect ne 'yes' && $gradestatus =~ /^correct/) ||   if ( ($showoncorrect ne 'yes' && &Apache::response::show_answer()) ||
      ( $numtries < $hinttries) ) {       ( $numtries < $hinttries) ) {
     &Apache::lonxml::debug("Grabbin all");      &Apache::lonxml::debug("Grabbin all");
     &Apache::lonxml::get_all_text("/hintgroup",$parser);      &Apache::lonxml::get_all_text("/hintgroup",$parser);
Line 64  sub start_hintgroup { Line 64  sub start_hintgroup {
  $result .= '\keephidden{';   $result .= '\keephidden{';
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
  $result.=&Apache::edit::tag_start($target,$token);   $result.=&Apache::edit::tag_start($target,$token);
  $result.=&Apache::edit::select_arg('Show hint even if problem Correct:','showoncorrect',[['no',&mt('No')],['yes',&mt('Yes')]]);   $result.=&Apache::edit::select_arg('Show hint even if problem Correct:','showoncorrect',[['no',&mt('No')],['yes',&mt('Yes')]],$token);
  $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();   $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
     } elsif ($target eq 'modified') {      } elsif ($target eq 'modified') {
  my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'showoncorrect');   my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'showoncorrect');
Line 267  sub end_stringhint { Line 267  sub end_stringhint {
  my ($ad,$msg);   my ($ad,$msg);
  if ($type eq 're' ) {   if ($type eq 're' ) {
     ${$safeeval->varglob('LONCAPA::response')}=$response;      ${$safeeval->varglob('LONCAPA::response')}=$response;
     $result = &Apache::run::run('return $LONCAPA::response=~m'.$answer,$safeeval);      my $compare='=';
       if ($answer=~/^\s*NOT\s*/) {
    $answer=~s/^\s*NOT\s*//;
    $compare='!';
       }
       my $test='$LONCAPA::response'.$compare.'~m'.$answer;
       &Apache::lonxml::debug("test $test");
       $result = &Apache::run::run("return $test",$safeeval);
     &Apache::lonxml::debug("current $response");      &Apache::lonxml::debug("current $response");
     &Apache::lonxml::debug("current $answer");      &Apache::lonxml::debug("current $answer");
     $ad = ($result) ? 'APPROX_ANS' : 'INCORRECT';      $ad = ($result) ? 'APPROX_ANS' : 'INCORRECT';

Removed from v.1.55  
changed lines
  Added in v.1.58


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>