hiii,

i am a Big zero about drupal knowledge But i tried to work over drupal quiz with my own. i am not a coder nor designer infact not releted to any manner with IT and software industry. But i designed my website with drupal and very happy with that.

i tried to install drupal quiz and facing some issue, if anybody can help you, it will be a great help to learn about drupal and resolve my issue,

issue:
1) while adding multiple choice questions from question pool in the quiz i am getting this error

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=43&op=do_nojs&op=do
StatusText: parsererror
ResponseText: Error: Call to a member function addQuestion() on null in Drupal\quiz\Plugin\Action\QuizAddQuestionAction->execute() (line 33 of /home4/nataapti/public_html/modules/quiz/src/Plugin/Action/QuizAddQuestionAction.php).

Please Guide!!

2) when trying to take quiz system says "You are not authorized to access this page, looking to the fact that i have assigned all permission to admin. screenshot attached herewith

Looking for response / assistance from experts here.

thanks

amit

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ashish3396 created an issue. See original summary.

djdevin’s picture

I am not yet sure about issue #1

For issue #2 please make sure you have these permissions and the quiz is published:

access quiz (this allows a user to take an accessible quiz)
view any quiz (this allows a user to view a quiz but not take)
view own quiz_result (this allows a user to see their own results)

djdevin’s picture

I'm not able to reproduce Issue #1, can you make sure your VBO module is up to date?

djdevin’s picture

Status: Active » Closed (cannot reproduce)

I can't reproduce this and neither can the tests, if you can provide steps to reproduce please do.

jacobbell84’s picture

Version: 6.0.0-alpha1 » 6.x-dev
Category: Support request » Bug report
Status: Closed (cannot reproduce) » Needs review
FileSize
1.09 KB

Hi @djdevin,
I've encountered the same issue in #1 and I can give you the steps to reproduce it. Not surprised the tests aren't catching it, since there's a few moving pieces here. The crux of the issue is the view that the "Add Questions from Bank" menu action is based on is using the Quiz ID, but the QuizAddQuestionAction action is expecting the Quiz Revision ID instead.

Steps to reproduce:

1) Create Quiz A (ID 1)
2) Add revision to Quiz A (ID 1, Revision ID 2)
3) Create Quiz B (ID 2, Revision ID 3)
4) Create Quiz C (ID 3, Revision ID 4)
5) Delete Quiz B
6) Attempt to add a question from the bank to Quiz C. Now that Quiz B has been deleted, it will throw the above exception since Revision ID 3 is missing.

I attached a patch for one possible way to go about fixing this, which is loading the quiz object inside the QuizAddQuestionAction class and getting it's revision id from there.

djdevin’s picture

Status: Needs review » Fixed

Thanks - actually in this case we don't even have to load by revision because we won't be adding questions to old revisions of quizzes.

This was probably a mistake since everywhere else in the module, we want to work off of the revision ID.

  • djdevin committed 657fa14 on 6.x authored by jacobbell84
    Issue #3128077 by jacobbell84, ashish3396, djdevin: Error: Call to a...

Status: Fixed » Closed (fixed)

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