WeBWorK Main Forum

Are $prob_val and $prob_try automatically defined in homework code? Where?

Re: Are $prob_val and $prob_try automatically defined in homework code? Where?

by Michael Gage -
Number of replies: 0
No.  Let's see if I can figure out what it does mean.   I wrote the interpreter 
that converted CAPA language problems to PG language somewhere 
around 1997 or 1998 so it's been a while.  Some of these problems have been 
rewritten and cleaned up by Frank Wolfs and his crew.  I wouldn't 
recommend using them as models for new problems (or learning a foreign 
language from Google translator :-) ).

......   some time later  ...........    ok -- here it is.



If you look in PG_CAPAmacros.pl where CAPA_ans() is defined you see that 
these options which had meaning for CAPA problems are ignored when they 
get translated into PG.

  http://webwork.maa.org/viewvc/system/trunk/pg/macros/PG_CAPAmacros.pl?view=markup

e.g. 


15
# explicitlty delete options which are meaningless to WeBWorK
   16     if (defined($options{'sig'})) { delete($options{'sig'}); }
   17     if (defined($options{'wgt'})) { delete($options{'wgt'}); }
   18     if (defined($options{'tries'})) { delete($options{'tries'});
 }   19 
   20 # $options{'allow_unknown_options'} = 1;  
## if uncommented, this is a fast and possibly dangerous 
21   ## way to prevent warning message about unknown options 
22 

Hope this helps.

Take care,