Warnings on completed exam with error reporting set high

2 months 4 weeks ago #1 by John Bongiovanni
Hi Christopher,

Everything is working fine, but I am seeing some warnings on my test site, which has error reporting set to high. Just passing it on.

John

 

This message has an attachment image.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

2 months 4 weeks ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic Warnings on completed exam with error reporting set high
Hello John and thank you for posting.

Please make sure that your plugin function declaration is:
onQuizCompleted(&$quiz, &$user_id, &$quiz_type, &$score)
(note the ampersands)

These arguments must be passed by reference, which means that you should give the function access to the original variable in order to be able to make changes in it, rather than just passing its value, which means you can't affect the original variable of the quiz.

In older PHP versions, this was required in both sides of the function (both in the declaration and the function call) but now it's only required in the function declaration.

Thanks again.

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros