Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Insert results in DB table after quiz finish
(1 viewing) (1) Guest
component
Go to bottomPage: 1234
TOPIC: Insert results in DB table after quiz finish
#57860
Insert results in DB table after quiz finish 7 Years, 10 Months ago Karma: 0
I'm posting new thread because something happened with the old one (404 error) www.ari-soft.com/ARI-Quiz/56767-Change-the-generated-PDF-Certificate/Page-3.html

I need your help with this task:

In Ari Quiz 2 there was file called quiz_finished.php. The file was located inside /public_html/components/com_ariquiz/frontend_pages

We use to have little code inside this file something like this:

Code:

$query = "INSERT INTO `xxxx_ariquiz_students` (`students_name`, `students_certification`, `students_certification_number`, `students_country`, `students_date_passed`) VALUES('{$result['UserName']}', '{$items->Certification}', '{$items->CertificationNumber}', '{$items->CountryName}', '{$result['EndDate']}')";


So when user successfully pass the quiz his data is inserted in this table: xxxx_ariquiz_students
Last Edit: 2016/06/19 13:46 By niki.
The administrator has disabled public write access.
 
#57861
Re:Insert results in DB table after quiz finish 7 Years, 10 Months ago Karma: 747
Hello,

See "markQuizAsFinished" method in <joomla_directory>/administrator/components/com_ariquiz/models/userquiz.php or create a system plugin, subscribe to "onEndQuiz" event and execute the code in event handler.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#57862
Re:Insert results in DB table after quiz finish 7 Years, 10 Months ago Karma: 0
In the old file i can see this:

AriEventController::raiseEvent('onEndQuiz', $result);

But i can't find this line of code inside userquiz.php
The administrator has disabled public write access.
 
#57863
Re:Insert results in DB table after quiz finish 7 Years, 10 Months ago Karma: 747
See <joomla_directory>/components/com_ariquiz/controllers/quizcomplete.php file.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58671
Re:Insert results in DB table after quiz finish 7 Years, 7 Months ago Karma: 0
Can you tell me where is that:

Code:

markQuizAsFinished



Ok. I found it in

function markQuizAsFinished($ticketId, $userId = 0)
{
$db =& $this->getDBO();

But how I can insert the code?

$query = "INSERT INTO `xxxx_ariquiz_students` (`students_name`, `students_certification`, `students_certification_number`, `students_country`, `students_date_passed`) VALUES('{$result['UserName']}', '{$items->Certification}', '{$items->CertificationNumber}', '{$items->CountryName}', '{$result['EndDate']}')";
Last Edit: 2016/09/29 15:34 By niki.
The administrator has disabled public write access.
 
#58672
Re:Insert results in DB table after quiz finish 7 Years, 7 Months ago Karma: 0
I send you email
The administrator has disabled public write access.
 
Go to topPage: 1234