Question on Plugin Usage

  • John Bongiovanni
  • John Bongiovanni's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 months 2 weeks ago #1 by John Bongiovanni
Question on Plugin Usage was created by John Bongiovanni
I want to implement a somewhat complicated access control for one of our quizzes, and I wonder if I can do this through a plugin.
Specifically, is there a way to intercept the onBeforeRenderQuiz event and tell Simple Quiz to go no farther?
If not, I have another way to do it through Joomla groups and permissions, but it's more convoluted.
TIA.

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

  • Christopher Mavros
  • Christopher Mavros's Avatar
  • Offline
  • Administrator
  • Administrator
More
11 months 2 weeks ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic Question on Plugin Usage
Hi John,

I can add a separate event if you prefer.

What would you like to have access to? What do you need to pass into the event arguments?

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.

  • John Bongiovanni
  • John Bongiovanni's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 months 2 weeks ago #3 by John Bongiovanni
Replied by John Bongiovanni on topic Question on Plugin Usage
All I need is the user ID and a way to tell Simple Quiz not to proceed with the test.

Can I do that with this event?

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

  • Christopher Mavros
  • Christopher Mavros's Avatar
  • Offline
  • Administrator
  • Administrator
More
11 months 2 weeks ago #4 by Christopher Mavros
Replied by Christopher Mavros on topic Question on Plugin Usage
If you somehow manipulate the application (e.g. call Factory::getApplication()->close() or redirect), then you can use the onBeforeRenderQuiz event.
If you want to stay on the same page and have a fully loaded template, but without the quiz, then I can add a separate event.

Let me know.

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.

  • John Bongiovanni
  • John Bongiovanni's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 months 2 weeks ago #5 by John Bongiovanni
Replied by John Bongiovanni on topic Question on Plugin Usage
A separate event would be great, thanks.

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

  • Christopher Mavros
  • Christopher Mavros's Avatar
  • Offline
  • Administrator
  • Administrator
More
11 months 2 weeks ago #6 by Christopher Mavros
Replied by Christopher Mavros on topic Question on Plugin Usage
Ok, so I just added the following event:
Code:
onCustomAccessCheck Arguments: $quiz, $user_id, $custom_access

Set the $custom_access variable to false if you want the quiz rendering to stop. You may write your own text before doing so.
I have sent the update to your email.

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