Skip to content

Commit

Permalink
MDL-30085 core_grade: added a grade web service
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis authored and jleyva committed Mar 31, 2014
1 parent ad32dda commit d354993
Show file tree
Hide file tree
Showing 6 changed files with 974 additions and 3 deletions.
1 change: 1 addition & 0 deletions course/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public static function get_course_contents($courseid, $options = array()) {
//common info (for people being able to see the module or availability dates)
$module['id'] = $cm->id;
$module['name'] = format_string($cm->name, true);
$module['instance'] = $cm->instance;
$module['modname'] = $cm->modname;
$module['modplural'] = $cm->modplural;
$module['modicon'] = $cm->get_icon_url()->out(false);
Expand Down
8 changes: 8 additions & 0 deletions grade/upgrade.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This files describes API changes in /grade/*,
information provided here is intended especially for developers.


=== 2.7.0 ===
* The class core_grade_external in grade/externallib.php has been renamed to core_grading_external.
grade/externallib.php is concerned with the grading API not the grades API.
The change was necessary to avoid a duplicate class name with core_grade_external in lib/grade/externallib.php.
19 changes: 19 additions & 0 deletions lib/db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,25 @@
'type' => 'read',
'capabilities'=> 'moodle/cohort:view',
),
// === grade related functions ===

'core_grade_get_grades' => array(
'classname' => 'core_grade_external',
'methodname' => 'get_grades',
'classpath' => 'lib/grade/externallib.php',
'description' => 'Returns grade item details and optionally student grades.',
'type' => 'read',
'capabilities'=> 'moodle/grade:view, moodle/grade:viewall',
),

'core_grade_update_grades' => array(
'classname' => 'core_grade_external',
'methodname' => 'update_grades',
'classpath' => 'lib/grade/externallib.php',
'description' => 'Update a grade item and associated student grades.',
'type' => 'write',
'capabilities'=> '',
),

// === group related functions ===

Expand Down
Loading

0 comments on commit d354993

Please sign in to comment.