- Posts: 253
Other Plugins
get grade of quiz in joomdleevent example plugin
- saman سامان
-
Topic Author
- Offline
- Elite Member
-
- samansamani2[at]yahoo.com
Less
More
8 years 2 weeks ago - 8 years 2 weeks ago #1
by saman سامان
get grade of quiz in joomdleevent example plugin was created by saman سامان
hi
thank you for your development plugin: joomdleevent.
in the example.php file i can see onJoomdleQuizAttemptSubmitted on line 117. it has $data[] array with some indexes e.g $data.
1-what is in $data[]?how can i var_dump that? is there grade of that quiz?if no how can i get that?
2-we have $data. how can i get other custom moodle field such as idnumber field or for example father name field? (father name created by me in moodle and id number exist as a default in moodle profile...)
3-how can i get some data via :https://docs.moodle.org/dev/Web_service_API_functions
is there any plugin to customize that and don't need touch joomdle core?
thank you
thank you for your development plugin: joomdleevent.
in the example.php file i can see onJoomdleQuizAttemptSubmitted on line 117. it has $data[] array with some indexes e.g $data.
1-what is in $data[]?how can i var_dump that? is there grade of that quiz?if no how can i get that?
2-we have $data. how can i get other custom moodle field such as idnumber field or for example father name field? (father name created by me in moodle and id number exist as a default in moodle profile...)
3-how can i get some data via :https://docs.moodle.org/dev/Web_service_API_functions
is there any plugin to customize that and don't need touch joomdle core?
thank you
Last edit: 8 years 2 weeks ago by saman سامان.
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7848
8 years 1 week ago - 8 years 1 week ago #2
by Antonio Durán
Replied by Antonio Durán on topic get grade of quiz in joomdleevent example plugin
Hi.
1. No, there is no grade. Data array includes: course_id, course_name, quiz_name, username
2. No, for this you would need to modify Joomdle web services.
3. That's not related to Joomdle. You can write code to use Moodle web services API by following the documentation.
1. No, there is no grade. Data array includes: course_id, course_name, quiz_name, username
2. No, for this you would need to modify Joomdle web services.
3. That's not related to Joomdle. You can write code to use Moodle web services API by following the documentation.
Last edit: 8 years 1 week ago by Antonio Durán.
Please Log in or Create an account to join the conversation.
- saman سامان
-
Topic Author
- Offline
- Elite Member
-
- samansamani2[at]yahoo.com
Less
More
- Posts: 253
8 years 1 week ago #3
by saman سامان
Replied by saman سامان on topic get grade of quiz in joomdleevent example plugin
i add in moodle
$usergrade = $DB->get_record('quiz_grades', array('quiz' => $event->other , 'userid'=> $event->other)); in line 648
in
moodle/auth/joomdle/locallib.php
and then add
$data = $usergrade->grade; in line 664
and can get the $data in the joomdle event plugin -> example.php
$usergrade = $DB->get_record('quiz_grades', array('quiz' => $event->other , 'userid'=> $event->other)); in line 648
in
moodle/auth/joomdle/locallib.php
and then add
$data = $usergrade->grade; in line 664
and can get the $data in the joomdle event plugin -> example.php
Please Log in or Create an account to join the conversation.