WeBWorK Problems

issue with scaffold.pl or contextForm.pl

Re: issue with scaffold.pl or contextForm.pl

by Glenn Rice -
Number of replies: 1

I am not sure that contextForm.pl is badly coded.  It would be good to figure out what exactly was changed with the contextForm.pl example that is not being properly reverted by scaffold.pl when it executes the answer evaluator.  The approach that I gave really just skirts the issue by saving the current context.

For contextOrdering.pl and the problem you attached, when scaffold.pl executes the answer evaluator the cmp_equal method of contextOrdering.pl is called.  However, the second time it is executed when the answer is actually being graded, that method is not called.  The state of the answer has changed so that its type no longer matches a context::Ordering::Value::Ordering, and it goes to some other value objects cmp_equal method.  I am not sure where yet.

In reply to Glenn Rice

Re: issue with scaffold.pl or contextForm.pl

by Alex Jordan -

Returning to this, I think that it's at the cmp_equal sub defined at line 285 of contextOrdering.pl, that the answer becomes a Value::List object instead of a context::Ordering::Value::Ordering. I'm not sure what to do with that though. I tried using this line:

$self_as_list           = $ans->{correct_value} = Value::List->make($self);

to replace:

$self           = $ans->{correct_value} = Value::List->make($self);

and then a few lines down, using $self_as_list instead of using $self. And that does leave $self as a , context::Ordering::Value::Ordering, but does not fix the issue with the exercise and scaffolding.