WeBWorK Problems

ans_array not recording in proctored quiz

ans_array not recording in proctored quiz

by Thomas Wong -
Number of replies: 5
Hi,

I am testing a proctored quiz for linear algebra subject. The quiz has questions on multiple pages. From my understanding, WebWork saves any entered answers as I navigated through the pages. However, in my questions, WebWork only appears to save the first entry in an an ans_array. For example, I enter a matrix, move to the next page of problems, come back to the matrix and see only the first entry stored.

Separate but possibly related problem: The same appears to be happen when I utilise custom answer checkers. Only the first answer is recorded when I navigate away from and then back to the same page.

I am wondering if there is something I am missing or if there is something I can do to fix this issue. I have been unsuccessful in locating any relevant documentation for this issue. Any assistance or direction is greatly appreciated.

I've attached a small working example of a question using ans_array that works perfectly fine in homework mode, but fails when included as part of a bigger proctored quiz. I've also included the custom answer checker that I used that producing the issue.

Happy to provide more details if required.

Thank you very much
Thomas

-----------------
##Matrix example
DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"MatrixReduce.pl",
);

TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

Context('Matrix');

$Z = Matrix( [1,2,3],[4,5,6],);

Context()->texStrings;

BEGIN_TEXT
Enter the Matrix
\[ z = $Z \]
\( Z = \) \{ $Z->ans_array(2) \}
END_TEXT

### check answers
ANS($Z->cmp);
ENDDOCUMENT();

-----------------------------
#Custom answer checker.
#Check to see if two numbers in are entered correctly in two ans_rule

$lobf = MultiAnswer($c, $m)->with(
allowBlankAnswers => 0,
singleResult => 1,
checker => sub {
my ( $correct, $student, $answerHash ) = @_;
my @c = @{$correct};
my @s = @{$student};
my @score = ();
if ( ($c==$s[0])&&($m==$s[1]))
{ return 1; } else{ return 0; }
}
);


In reply to Thomas Wong

Re: ans_array not recording in proctored quiz

by Danny Glin -
What version of WeBWorK are you running?

There was a possibly related issue raised in the past about only the first entry of an ans_array being stored as a past answer. I believe that this issue was fixed in a recent version, which might fix your issue as well.
In reply to Danny Glin

Re: ans_array not recording in proctored quiz

by Thomas Wong -
Hi Danny,

Thank you for the information

I think we are running WeBWorK-2.13. Could this be the issue?

Regards,
Thomas
In reply to Thomas Wong

Re: ans_array not recording in proctored quiz

by Danny Glin -
I just tried your MWE in 2.14 and I get the same behaviour.

Looking at the code it looks like in homework mode it was refactored to properly store multi-part answers such as answer arrays, but that was never ported to gateway quizzes.

Based on a quick look it's hard to tell whether it will be easy to get gateway quizzes to work with the same code. I'll open a bug report in case someone else has time to work on this in the immediate future.