Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-part answers are not properly stored in Gateway Quizzes #924

Closed
dlglin opened this issue Feb 5, 2019 · 2 comments
Closed

Multi-part answers are not properly stored in Gateway Quizzes #924

dlglin opened this issue Feb 5, 2019 · 2 comments
Assignees

Comments

@dlglin
Copy link
Member

dlglin commented Feb 5, 2019

Steps to reproduce:
Create a gateway quiz which includes a question that uses ans_array on a MathObject. Enter an answer, then either preview, submit, or change pages (for multipage quizzes) in the quiz. Both the last_answer field and the past_answers table will only contain the first element of the matrix.
See http://webwork.maa.org/moodle/mod/forum/discuss.php?d=4549 for a MWE

It looks like this was fixed in homework mode (Problem.pm) with the creation of the process_and_log_answer function in ProblemUtil.pm, but the Gateway code was never updated to use this function. Gateway code should probably be refactored to use the same function, but Gateways also store the type of submission (e.g. [submit], [preview] or [newpage]), so this would have to be considered, as well as testing the loading of past answers into answer blanks.

drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Apr 25, 2019
If a problem uses an extended response group for its answers (like
multianswers with the single result option, answer arrays, or mathquill
answers) and a quiz has multiple pages, then the extended answers are
lost every time the page is changed.

The intended result is that the quiz would create a hidden input for
every given answer that is not on the current page.  It detects these
answers by looking for the quiz prefix in the input names.  However, it
was previously assumed that the quiz prefix would be at the beginning of
the input name, which is incorrect.  Extended response group answers add
a prefix in front of the the quiz prefix.

This fixes the problem by finding all inputs that contain the quiz
prefix, but excludes the previous answer inputs.

This fixes issue openwebwork#924.
@mgage
Copy link
Sponsor Member

mgage commented May 10, 2019

I believe that http://webwork.maa.org/moodle/mod/forum/discuss.php?d=4598 (matrix answers disappearing) is probably related as well.

@mgage mgage self-assigned this May 10, 2019
mgage pushed a commit to mgage/webwork2 that referenced this issue May 10, 2019
If a problem uses an extended response group for its answers (like
multianswers with the single result option, answer arrays, or mathquill
answers) and a quiz has multiple pages, then the extended answers are
lost every time the page is changed.

The intended result is that the quiz would create a hidden input for
every given answer that is not on the current page.  It detects these
answers by looking for the quiz prefix in the input names.  However, it
was previously assumed that the quiz prefix would be at the beginning of
the input name, which is incorrect.  Extended response group answers add
a prefix in front of the the quiz prefix.

This fixes the problem by finding all inputs that contain the quiz
prefix, but excludes the previous answer inputs.

This fixes issue openwebwork#924.
@mgage
Copy link
Sponsor Member

mgage commented May 10, 2019

Pull requests #935 and #936 resolve this issue.

@mgage mgage closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants