I have Drupal 7.4 installed.

When I try to take the quiz via ajax I get the following error
http://quiz.dev/node/2/ajax-quiz

Fatal error: Only variables can be passed by reference in /home/quickstart/websites/quiz.dev/sites/all/modules/quiz/includes/ajax_quiz/ajax_quiz.admin.inc on line 55 Call Stack: 0.0001 329020 1. {main}() /home/quickstart/websites/quiz.dev/index.php:0 0.1067 3472252 2. menu_execute_active_handler() /home/quickstart/websites/quiz.dev/index.php:21

FYI: I also get this error when I run cron:
Notice: Undefined variable: node in QuizQuestion->viewCanRevealCorrect() (line 611 of /home/quickstart/websites/quiz.dev/sites/all/modules/quiz/question_types/quiz_question/quiz_question.core.inc).

---------
Question 1 of 1

HYPOactivity of the layer of cells within the bracket would most likely result in:WebScope
salt wasting due to insufficient production of mineralocorticoids (e.g. aldosterone).
Addison's disease due to insufficient production of glucocorticoids (e.g. cortisol).
HIGH blood calcium levels (hypercalcemia).
low basal metabolic rate due to insufficient production of thyroxin (T4) and triiodothyronine (T3).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sivaji_Ganesh_Jojodae’s picture

I haven't started working on ajax_quiz yet. I will take this issue as a reminder. If you are willing to develop this module, I would be happy to review and commit your patches.

Sivaji_Ganesh_Jojodae’s picture

Title: Fatal error: Only variables can be passed by reference » Port ajax quiz module to d7
Issue tags: +D7 stable release blocker

Tagging as release blocker.

Sivaji_Ganesh_Jojodae’s picture

Status: Active » Postponed
Issue tags: -D7 stable release blocker

It looks like the ajax quiz module never worked since 6.x and it is not supported see #1241256: quiz module. I'm not going to treat this as release blocker.

rajeshrjsh’s picture

Fatal error: Only variables can be passed by reference in C:\xampp\htdocs\WLF\sites\all\modules\quiz\includes\ajax_quiz\ajax_quiz.admin.inc on line 55

falcon’s picture

Version: 7.x-4.x-dev » 7.x-5.x-dev
Category: bug » feature
rohitjalmi’s picture

Version: 7.x-5.x-dev » 7.x-4.0-alpha7
Priority: Minor » Normal

whn ajax quiz module will be released for drupal 7 ???

scotwith1t’s picture

why is this even included in the D7 version if it's non-functional? probably should remove and repackage with version 5.x if it's not going to functional in the current version...we absolutely have to have this and could possibly come up with a bounty if you could make this happen sooner than later...thanks!

scotwith1t’s picture

Issue summary: View changes

fixed typo

lokapujya’s picture

Version: 7.x-4.0-alpha7 » 7.x-4.x-dev
Assigned: Unassigned » lokapujya
Issue summary: View changes
Status: Postponed » Needs review
FileSize
5.37 KB
lokapujya’s picture

Got ajax-quiz working. Here is a patch.

lokapujya’s picture

minor update: this patch doesn't touch the .info file

lokapujya’s picture

Assigned: lokapujya » Unassigned
stredz’s picture

This particular patch at #10 just gives the output of question in ajax form but it doesn't give the option to chose the answer (eg: Multiple choice) and there is no next button to pass on to next question.

attheshow’s picture

Version: 7.x-4.x-dev » 7.x-5.x-dev
lokapujya’s picture

do we still need this? or is it fixed already in 7.x-5.x?

djdevin’s picture

Yeah we still need this in 5.x

However it should be easier to do than 4.x.

lokapujya’s picture

Issue tags: +Needs reroll
lokapujya’s picture

Issue tags: -Needs reroll
FileSize
5.14 KB

Rerolled for 7.x-5.x. The code applies to the quiz branch; You get the "Take by Ajax" button, and the instructions take you to the first question via Ajax. I temporarily put the "Take by Ajax" into the quiz menu, because I couldn't remember how I got it to show up when the code is in ajax_quiz.

Still needs a lot of work, but at least this is a better starting point to work from. It's kind of a mess right now. I think _ajax_quiz_get_questions() needs some work.

lokapujya’s picture

Status: Needs review » Needs work

Should change drupal_add_js to used #attached.

kamranafzal’s picture

i use quiz 3.0 module in drupal 7 all is well but when i take quiz by ajax find the Fatal error: Only variables can be passed by reference
please give me solution

lokapujya’s picture

Kami786. Please change the parameters to variables. I don't get the error. But since your version of PHP shows the error, maybe you can fix it.

Status: Needs work » Needs review

The last submitted patch, 8: ajax-quiz-1224448-8.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 17: ajax-quiz-1224448-17.patch, failed testing.

The last submitted patch, 10: ajax-quiz-1224448-10.patch, failed testing.

lokapujya’s picture

Issue tags: +Needs reroll
djdevin’s picture

joneldesouza’s picture

I used the patch on comment #10 and changed in quiz.module file on line 4036, the code below and it worked for me. In version 7.x-4.0-beta4

quiz.module line 4036

function _quiz_is_taking_context() {
  - return arg(2) == 'take'
  + return arg(2) == 'take' || arg(2) == 'ajax-quiz';
}
joneldesouza’s picture

FileSize
4.56 KB

I created a patch. Tested in version 7.x-4.x

djdevin’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -7.x-5.0 release blocker

Closed in favor of #2464087: Updating AJAX quiz to utilize ajax framework and changing the use of args() which is now in 7.x-5.x and works pretty well.