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

Fix repositioniong of the feedback popover when typing in MathQuill inputs. (hotfix of #1110) #1116

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Sep 3, 2024

When an answer has multiple responses and a MathQuill input for a response that is not the first one is typed in with a feedback popover open, the feedback popover does not correctly resposition. This is because currently only the first answer label is saved in the data attribute. So when the mqeditor sets up the later responses which have different answer labels, it doesn't see the feedback button. So now all answer labels for the response group are saved as a JSON encoded array. The mqeditor then searches the feedback buttons on the page to find the one with the correct answer label.

Here is a MWE for testing this:

DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl');
Context('Matrix');
$A = Matrix([ [ 0, -1 ], [ 1, 0 ] ]);
BEGIN_PGML
Enter [`[$A]`]: [_]*{$A}{10}
END_PGML
ENDDOCUMENT();

If you type in a matrix entry other than the first column of the first row when a feedback popover is open, then the popover position is not updated with the develop branch, but is with this pull request.

Note that this also occurs with MultiAnswer objects with singleResult => 1 set.

Now, I was actually trying to fix @somiaj's comment in openwebwork/webwork2#2524 (comment). I believe that this might also fix that issue. I can't test that because I can't reproduce this issue (my computer is to fast?). However, I have good reason to believe that this will fix it.

…nputs.

When an answer has multiple responses and a MathQuill input for a
response that is not the first one is typed in with a feedback popover
open, the feedback popover does not correctly resposition. This is
because currently only the first answer label is saved in the data
attribute.  So when the mqeditor sets up the later responses which have
different answer labels, it doesn't see the feedback button.  So now all
answer labels for the response group are saved as a JSON encoded array.
The mqeditor then searches the feedback buttons on the page to find the
one with the correct answer label.

Here is a MWE for testing this:
```perl
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl');
Context('Matrix');
$A = Matrix([ [ 0, -1 ], [ 1, 0 ] ]);
BEGIN_PGML
Enter [`[$A]`]: [_]*{$A}{10}
END_PGML
ENDDOCUMENT();
```

If you type in a matrix entry other than the first column of the first
row when a feedback popover is open, then the popover position is not
updated with the develop branch, but is with this pull request.

Note that this also occurs with `MultiAnswer` objects with
`singleResult => 1` set.

Now, I was actually trying to fix @somiaj's comment in
openwebwork/webwork2#2524 (comment).
I believe that this might also fix that issue.  I can't test that
because I can't reproduce this issue (my computer is to fast?). However,
I have good reason to believe that this will fix it.
@Alex-Jordan Alex-Jordan merged commit 3f6c018 into openwebwork:main Sep 8, 2024
3 checks passed
@drgrice1 drgrice1 deleted the another-feedback-positioning-fix-hotfix branch September 10, 2024 20:34
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

Successfully merging this pull request may close these issues.

3 participants