From: dpvc v. a. <we...@ma...> - 2008-06-20 15:19:34
|
Log Message: ----------- Make non-inheritance scheme more general, and include additional values in the default list. (Still need to look through all the basic objects to see what might not want to be inherited.) Modified Files: -------------- pg/lib: Value.pm Revision Data ------------- Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -Llib/Value.pm -Llib/Value.pm -u -r1.94 -r1.95 --- lib/Value.pm +++ lib/Value.pm @@ -597,10 +597,20 @@ sub inherit { my $self = shift; $self = bless {(map {%$_} @_),%$self}, ref($self); - delete $self->{correct_ans}; + foreach my $id ($self->noinherit) {delete $self->{$id}}; return $self; } +# +# The list of fields NOT to inherit. +# Use the default list plus any specified explicitly in the object itself. +# Subclasses can override and return additional fields, if necessary. +# +sub noinherit { + my $self = shift; + ("correct_ans","original_formula","equation",@{$self->{noinherit}||[]}); +} + ###################################################################### # |