Warnings on completed exam with error reporting set high
- John Bongiovanni
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 0
3 years 10 months ago #1
by John Bongiovanni
Warnings on completed exam with error reporting set high was created 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
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 image is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
3 years 10 months ago #2
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
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:
(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.
Please make sure that your plugin function declaration is:
Code:
onQuizCompleted(&$quiz, &$user_id, &$quiz_type, &$score)
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
me@mavxr.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