Diff for /loncom/homework/default_homework.lcpm between versions 1.70 and 1.71

version 1.70, 2004/03/12 16:55:35 version 1.71, 2004/03/12 21:06:19
Line 109  sub caparesponse_check { Line 109  sub caparesponse_check {
     }      }
     if (!defined($sig_ubound)) { $sig_ubound=$sig_lbound; }      if (!defined($sig_ubound)) { $sig_ubound=$sig_lbound; }
   }    }
     my $reterror="";
   my $result = &caparesponse_capa_check_answer($response,$answer,$type,    my $result = &caparesponse_capa_check_answer($response,$answer,$type,
        $tol_type,$tol,         $tol_type,$tol,
        $sig_lbound,$sig_ubound,         $sig_lbound,$sig_ubound,
        $ans_fmt,$unit,$calc,$id_list,         $ans_fmt,$unit,$calc,$id_list,
        $points,$external::randomseed);         $points,$external::randomseed,
          \$reterror);
   
   if    ($result == '1') { $result='EXACT_ANS'; }     if    ($result == '1') { $result='EXACT_ANS'; } 
   elsif ($result == '2') { $result='APPROX_ANS'; }    elsif ($result == '2') { $result='APPROX_ANS'; }
Line 129  sub caparesponse_check { Line 131  sub caparesponse_check {
   elsif ($result =='12') { $result='WANTED_NUMERIC'; }    elsif ($result =='12') { $result='WANTED_NUMERIC'; }
   else  {$result = "ERROR: Unknown Result:$result:$@:";}    else  {$result = "ERROR: Unknown Result:$result:$@:";}
   
   return "$result:\nError $error:\nAnswer $answer:\nResponse $response:\n type-$type|$tol|$tol_type|$sig:$sig_lbound:$sig_ubound|$unit|\n$message$expr";    return ("$result:\nRetError $reterror:\nError $error:\nAnswer $answer:\nResponse $response:\n type-$type|$tol|$tol_type|$sig:$sig_lbound:$sig_ubound|$unit|\n$message$expr",$reterror);
 }  }
   
 sub get_array_args {  sub get_array_args {
Line 186  sub caparesponse_check_list { Line 188  sub caparesponse_check_list {
   $unit=~s/\s//;    $unit=~s/\s//;
   my $i=0;    my $i=0;
   my $awards='';    my $awards='';
     my @msgs;
   for ($i=0; $i<@list;$i++) {    for ($i=0; $i<@list;$i++) {
         my $msg;
     $result.="trying answer :$list[$i]:\n";      $result.="trying answer :$list[$i]:\n";
     my $thisanswer=$list[$i];      my $thisanswer=$list[$i];
 #    $thisanswer=~ s/\\/\\\\/g;  #    $thisanswer=~ s/\\/\\\\/g;
 #    $thisanswer =~ s/\'/\\\'/g;  #    $thisanswer =~ s/\'/\\\'/g;
     $result.="trying answer :$thisanswer:\n";      $result.="trying answer :$thisanswer:\n";
     if ($unit eq '') {      if ($unit eq '') {
       $aresult=&caparesponse_check($thisanswer,$responselist[$i],   ($aresult,$msg)=&caparesponse_check($thisanswer,$responselist[$i],
      $expr);      $expr);
     } else {      } else {
       $aresult=&caparesponse_check($thisanswer,$responselist[$i]." $unit",   ($aresult,$msg)=&caparesponse_check($thisanswer,
    $expr);      $responselist[$i]." $unit",
       $expr);
     }      }
     my ($temp)=split /:/, $aresult;      my ($temp)=split /:/, $aresult;
     $awards.="$temp,";      $awards.="$temp,";
     $result.=$aresult;      $result.=$aresult;
       push(@msgs,$msg);
   }    }
   chop $awards;    chop $awards;
   return "$awards:\n$result";    return ("$awards:\n$result",@msgs);
 }  }
   
 sub tex {  sub tex {

Removed from v.1.70  
changed lines
  Added in v.1.71


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