Skip to content

Questionnaire: All branching shown in View your response #616

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

Open
wants to merge 2 commits into
base: MOODLE_404_STABLE
Choose a base branch
from

Conversation

toanlamt
Copy link
Contributor

@toanlamt toanlamt commented Nov 6, 2024

Context: Enable the "Allow branching questions" setting. Create a radio question with multiple options, and add corresponding dependency questions for each option. The issue occurs when users answer the question and view their responses.

Actual Results: Users can see all of the dependency questions, which can be overwhelming.

Expected Results: Users should only see the dependency question that corresponds to the option they selected.

Impacted Areas: This fix only impacts the "View your response(s) > Individual responses" page.

Copy link
Contributor

@mchurchward mchurchward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

@tailetan
Copy link
Contributor

@mchurchward I have just pushed a new commit to fix your comment. Please review again. Thanks.

@mchurchward
Copy link
Contributor

This change does not seem to be working correctly.
I created dependencies, similar to the what is in the provided Behat test.

  1. Do you own a car yes/no
    2.1) Yes - What colour is you car?
    2.2) No - Will you buy a car this year?

If I answer "No" to question 1, my individual response shows the first dependency (colour) faded out with no answer, but not the second dependency answer which is the one I answered. See image:

Screenshot 2025-03-14 at 10 52 45 AM

@tailetan
Copy link
Contributor

@mchurchward, I have just tested that case, but it works as expected.

See the video:
https://github.com/user-attachments/assets/e4acf931-0b49-41b6-a1ce-6d38db0de617
Did you set the dependencies correctly?

@mchurchward
Copy link
Contributor

mchurchward commented Mar 17, 2025

@mchurchward, I have just tested that case, but it works as expected.

See the video: https://github.com/user-attachments/assets/e4acf931-0b49-41b6-a1ce-6d38db0de617 Did you set the dependencies correctly?

Your video shows the "Yes" reply. The problem I posted is when "No" is answered.

Please review my image above again. I answered "no". I should see the "Will you buy a car this year", not "What colour is your car".

@tailetan
Copy link
Contributor

tailetan commented Mar 26, 2025

@mchurchward yes, i also tested with no option. Please refer to the below attachment:
https://github.com/user-attachments/assets/a7bad7a0-bfd6-4578-8658-979b2bc8d46d
image

Setting
image (1)

@mchurchward
Copy link
Contributor

mchurchward commented Mar 27, 2025

I still see the issue when I do the same.

Here is the question setup:

Screenshot 2025-03-27 at 11 44 23 AM

Here are my answers:

Screenshot 2025-03-27 at 11 44 44 AM

Screenshot 2025-03-27 at 11 44 54 AM

And here is what I see on the response screen:

Screenshot 2025-03-27 at 11 45 10 AM

Note that this a new questionnaire with only one respondent.

If I add a second response where I answer "yes", the response display looks fine for the new response, but the first one still is wrong.

Something to check is that you are testing with exactly the same code as this PR, and that you don't have other changes that are not in MOODLE_404_STABLE or your PR?

@mchurchward
Copy link
Contributor

I added a Behat test to test the specific case above.
It fails the Behat as well.

@toanlamt
Copy link
Contributor Author

Hi @mchurchward

Thanks for the feedback. I've reviewed my commit and investigated the issue. It turns out the problem was related to the logic that checks eligibility for the question. I've fixed it and pushed a new commit. Could you please review it again?

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