I have about 25 questions in production site now, and when the questions are in bulk the answers of those questions are not able to display the data due to some bug. I tried to investigate it but no success yet.

Comments

paiabhay8 created an issue. See original summary.

djdevin’s picture

It's very unlikely that questions are being deleted by Quiz.

Can you provide any more information? Any errors or steps to reproduce the behavior?

oily’s picture

Hi @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.

abhaypai’s picture

Hi guys,
thanks for your quick feedback related to my issues raised.

So the scenario is

  1. I added 25 Multiple Choice Questions with correct answers and possibility of that questions.
  2. I added those 25 Multiple Choice Questions using bulk add options to the quiz.
  3. My cron job is set to 3 hrs
  4. After every 3 hrs some of the questions data like questions, its score, other choices in that questions are getting deleted.
  1. I added 25 Multiple Choice Questions with correct answers and possibility of that questions.
  2. I added those 25 Multiple Choice Questions one by one to the quiz.
  3. My cron job is set to 3 hrs
  4. After every 3 hrs some of the questions data like questions, its score, other choices in that questions are getting deleted.

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 ?

djdevin’s picture

I 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.

oily’s picture

@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'

tahiticlic’s picture

Hi,

same problem here. Choices are disappearing on multiple choices questions. I've cron enabled.

djdevin’s picture

I still can't reproduce, so any sort of setup with steps here from a clean install would be very helpful.

oily’s picture

Hi @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?

djdevin’s picture

It'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).

oily’s picture

@djdevin, thank you, good points.

tahiticlic’s picture

Hi,
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 :-)

djdevin’s picture

djdevin’s picture

I 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.

djdevin’s picture

djdevin’s picture

Version: 8.x-5.x-dev » 6.x-dev
djdevin’s picture

Reproduced

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.

  • djdevin committed 93ba908 on 6.x
    Issue #3093138: Multiple Choice Questions are getting deleted...
djdevin’s picture

Status: Active » Fixed

Related #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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.