Closed (fixed)
Project:
Quiz
Version:
6.x-dev
Component:
Code - Multichoice
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Nov 2019 at 06:29 UTC
Updated:
28 Apr 2020 at 20:14 UTC
Jump to comment: Most recent
Comments
Comment #2
djdevinIt's very unlikely that questions are being deleted by Quiz.
Can you provide any more information? Any errors or steps to reproduce the behavior?
Comment #3
oily commentedHi @paiabhay8. Can you please provide more detailed information. Which question types are you using? By 'in bulk' how many are you talking about? Since it is in production how long has it been working properly for? Did you do a bulk add of questions recently? Did the bug happen immediately after that?
Also, can you please use git clone to install the very latest codebase of quiz 8.x-5.x-dev branch into your local test site. You may have to create a new local site before doing that.
Comment #4
abhaypai commentedHi guys,
thanks for your quick feedback related to my issues raised.
So the scenario is
No matter what the questions are deleted anyhow, so for the mean time i stop my service of cron job in server as well as drupal.
So after turning off cron job it is not deleting any data.
I hope these descriptions are helpful.
and @andrew.farquharson may i know why do i need to clone from git 8.x-5.x-dev ?
Comment #5
djdevinI tried to reproduce but could not, after running cron multiple times.
Quiz has a cron job to delete old results, but it's not even working now.
Comment #6
oily commented@paiabhay8
You have reported an issue with the quiz module. So are you following this:
https://www.drupal.org/node/707484
See the paragraph 'Using git clone'
Comment #7
tahiticlic commentedHi,
same problem here. Choices are disappearing on multiple choices questions. I've cron enabled.
Comment #8
djdevinI still can't reproduce, so any sort of setup with steps here from a clean install would be very helpful.
Comment #9
oily commentedHi @djdevin. There is something in common here: both @Fabien and @paiabhay8 are using the dev version of the quiz module in production environments. If they are to benefit from the latest codebase I think they need to regularly git clone or git pull from the repo.
They will also need i think to re-install the module. This may mean deleting their existing quizzes, questions and results. And starting from scratch each time. Unless they can export the entities? Since it is likely that this would be really inconvenient, these users are holding onto an old version of the code base? Dev branches are for testing out and submitting code changes. You have indicated that until the beta version updates will not be supported.
If this is the case then i can only suggest we spell out to people that the dev branch is not yet suitable for production environments? If @Fabien and @paiahay8 can see that the only way to progress quicker to the beta version they need is if they can help out then they will hopefully get onside?
Comment #10
djdevinIt's clearly written here: https://www.drupal.org/project/quiz/releases/8.x-5.x-dev
On the project page it's also marked "development version" and has no releases.
There's also documentation on what a development version means here: https://www.drupal.org/docs/8/understanding-drupal-8/understanding-drupa... and https://www.drupal.org/docs/8/choosing-a-drupal-version/development-snap...
It could still be happening in the latest 8.x-5.x-dev so it should still be investigated. Maybe it's an issue with something being deleted because it thinks it is orphaned (like paragraphs).
Comment #11
oily commented@djdevin, thank you, good points.
Comment #12
tahiticlic commentedHi,
in my case it was not orphaned, just one answer has disappeared for a question, but the other answers have not.
I'll update the code to check for that, project still in dev for a few days, I can test that :-)
Comment #13
djdevinPossibly related
https://www.drupal.org/project/paragraphs_clean
https://www.drupal.org/project/paragraphs/issues/3056819
Comment #14
djdevinI saw some answers get deleted after running orphan deletion on /admin/config/system/delete-orphans, this is definitely an issue.
I set up questions with answers A B and C
After doing some things and then running delete-orphans, "A" was deleted but "B" persisted.
Comment #15
djdevinComment #16
djdevinComment #17
djdevinReproduced
1. Create a Quiz with an MCQ with 3 options (A B C)
2. Take the Quiz and select option A
3. Delete the attempt
3. Run admin/config/system/delete-orphans
4. Answer A is deleted
This is because in paragraphs_item_field_data the parent_type is being changed to quiz_result_answer, because we're adding a reference to the revision in the results.
When the result is deleted it believes that the answer is an orphan and entity_reference_revisions deletes it.
Looking into a way around this.
Unfortunately it looks like paragraphs cannot be used in this way as it will not support it being shared across entities.
Comment #19
djdevinRelated #2852522: Deletion of referenced entities on host delete, without checking usage/another reference
Answer storage on MCQ answer changed to store an integer (Paragraph revision ID, aka MCQ answer)
Unfortunately requires reinstalling quiz, no schema upgrade at this point.