Web services and gradebook

Web services and gradebook

by Pedro Martins Da Torre -
Number of replies: 4

Am I able to use the Moodle web services to "push" gradebook information to an external system (via eg. xml)?

In other words, can the Moodle web services expose gradebook information?

Thanks.

Average of ratings: -
In reply to Pedro Martins Da Torre

Re: Web services and gradebook

by Patrick Pollet -
Hello,
As far as I know there is not yet anything implemented in the official Moodle 2.0 Web Services API about grades.
In the meantime you could have a look to OKTech Web Services that runs againt Moodle 1.9 and 2.0 and provides the following operations . see http://moodle.org/mod/forum/discuss.php?d=67947#p707949
/** * Find and return student grades for specified courses (moodle 1.9) * * @uses $CFG * @param int $client The client session ID. * @param string $sesskey The client session key. * @param string $userid The Student ID of the student. * @param string $useridfield the field used to identity student * @param string[] $courseids Array of course id number * @param string $courseidfield field used to identity the courses * @return gradeRecord[] student grades * */
public function get_grades($client, $sesskey, $userid, $useridfield = 'idnumber', $courseids, $courseidfield = "idnumber")
/** * Find and return course grades for currently enrolled students (moodle 1.9) * * @uses $CFG * @param int $client The client session ID. * @param string $sesskey The client session key. * @param string $courseid course id number * @param string $idfield field used to identity the course * @return gradeRecord[] student grades */
public function get_course_grades($client, $sesskey, $courseid, $idfield = "idnumber")
/** * Find and return student grades for currently enrolled courses (moodle 1.9) * * @uses $CFG * @param int $client The client session ID. * @param string $sesskey The client session key. * @param string $userid The Student ID of the student. * @param string $idfield the field used to identity student * @return gradeRecord[] student grades * */
public function get_user_grades($client, $sesskey, $userid, $idfield = "idnumber")
Cheers.
Edit : Sorry for the strange formatting but moodle.org under Moodle 2.0 seems to still have troubles with line feeds at least with my Chrome browser ,-)
Average of ratings: Useful (1)
In reply to Patrick Pollet

Re: Web services and gradebook

by Pedro Martins Da Torre -

Thanks Patrick, I've installed it and it looks promising.

Do you know if there's a full english translation anywhere? Many of the strings in the english language files are still in french, example: \wspp\local\wspp\lang\en\local_wspp.php.

In reply to Pedro Martins Da Torre

Re: Web services and gradebook

by Patrick Pollet -

Oups, I messed up  the last  commit...

Thinks are complicated by the fact that I wanted the same code to run against Moodle 1.9 and 2.0, but the location, naming, processing and even content of the language files have changed dramatically between these two versions.  So I have to maintain two versions of the lang file for every language ;-(

- For use against Moodle 1.9 the file wspp/lang/en_utf8/local_wspp.php (to be copied in moodledata/lang/en_utf8_local) is indeed in english, thanks to Stephen C. Scherer (Do not overwrite it with the attached file)

- But for use against Moodle 2.0 the file wspp/local/wspp/lang/en/local_wspp.php (to be copied in Moodle's local directory) was the french version ;-(

Please find enclosed the english version to copy into  your Moodle's   local/wspp/lang/en/local_wspp.php. (thus overwitting the french version copied when installing wspp).

Don't forget that in Moodle 2.0 language files are cached  so after copying this english version in Moodle's local directory you must clear the caches (in Administration/Development/)   or simply delete the file local_wspp.php in moodledata/cache/lang/en/  (not sure of the exact location since on my dev machine I turned off language cachings ...).

Cheers

 

I shall try to update the zip file on cipcnet and Moodle's CVS in few hours .

Average of ratings: Useful (1)