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
Comment | File | Size | Author |
---|---|---|---|
#5 | quiz_support-revisions-in-action.patch | 1.09 KB | jacobbell84 |
5.jpg | 109.33 KB | ashish3396 | |
4.jpg | 72.62 KB | ashish3396 | |
3.jpg | 42.1 KB | ashish3396 | |
2.jpg | 54.5 KB | ashish3396 |
Comments
Comment #2
djdevinI 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)
Comment #3
djdevinI'm not able to reproduce Issue #1, can you make sure your VBO module is up to date?
Comment #4
djdevinI can't reproduce this and neither can the tests, if you can provide steps to reproduce please do.
Comment #5
jacobbell84 CreditAttribution: jacobbell84 at ZenSource commentedHi @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.
Comment #6
djdevinThanks - 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.