+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class store extends external_api {
+
+ /**
+ * Describes the parameters for fetching the grading panel for a simple grade.
+ *
+ * @return external_function_parameters
+ * @since Moodle 3.8
+ */
+ public static function execute_parameters(): external_function_parameters {
+ return new external_function_parameters ([
+ 'component' => new external_value(
+ PARAM_ALPHANUMEXT,
+ 'The name of the component',
+ VALUE_REQUIRED
+ ),
+ 'contextid' => new external_value(
+ PARAM_INT,
+ 'The ID of the context being graded',
+ VALUE_REQUIRED
+ ),
+ 'itemname' => new external_value(
+ PARAM_ALPHANUM,
+ 'The grade item itemname being graded',
+ VALUE_REQUIRED
+ ),
+ 'gradeduserid' => new external_value(
+ PARAM_INT,
+ 'The ID of the user show',
+ VALUE_REQUIRED
+ ),
+ 'formdata' => new external_value(
+ PARAM_RAW,
+ 'The serialised form data representing the grade',
+ VALUE_REQUIRED
+ ),
+ ]);
+ }
+
+ /**
+ * Fetch the data required to build a grading panel for a simple grade.
+ *
+ * @param string $component
+ * @param int $contextid
+ * @param string $itemname
+ * @param int $gradeduserid
+ * @return array
+ * @since Moodle 3.8
+ */
+ public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid, string $formdata): array {
+ global $USER;
+
+ [
+ 'component' => $component,
+ 'contextid' => $contextid,
+ 'itemname' => $itemname,
+ 'gradeduserid' => $gradeduserid,
+ 'formdata' => $formdata,
+ ] = self::validate_parameters(self::execute_parameters(), [
+ 'component' => $component,
+ 'contextid' => $contextid,
+ 'itemname' => $itemname,
+ 'gradeduserid' => $gradeduserid,
+ 'formdata' => $formdata,
+ ]);
+
+ // Validate the context.
+ $context = context::instance_by_id($contextid);
+ self::validate_context($context);
+
+ // Validate that the supplied itemname is a gradable item.
+ if (!component_gradeitems::is_valid_itemname($component, $itemname)) {
+ throw new coding_exception("The '{$itemname}' item is not valid for the '{$component}' component");
+ }
+
+ // Fetch the gradeitem instance.
+ $gradeitem = gradeitem::instance($component, $context, $itemname);
+
+ // Validate that this gradeitem is actually enabled.
+ if (!$gradeitem->is_grading_enabled()) {
+ throw new moodle_exception("Grading is not enabled for {$itemname} in this context");
+ }
+
+ // Fetch the record for the graded user.
+ $gradeduser = \core_user::get_user($gradeduserid);
+
+ // Require that this user can save grades.
+ $gradeitem->require_user_can_grade($gradeduser, $USER);
+
+ if (!$gradeitem->is_using_direct_grading()) {
+ throw new moodle_exception("The {$itemname} item in {$component}/{$contextid} is not configured for direct grading");
+ }
+
+ // Parse the serialised string into an object.
+ $data = [];
+ parse_str($formdata, $data);
+
+ // Grade.
+ $gradeitem->store_grade_from_formdata($gradeduser, $USER, (object) $data);
+
+ // Fetch the updated grade back out.
+ $grade = $gradeitem->get_grade_for_user($gradeduser, $USER);
+
+ return fetch::get_fetch_data($grade);
+ }
+
+ /**
+ * Describes the data returned from the external function.
+ *
+ * @return external_single_structure
+ * @since Moodle 3.8
+ */
+ public static function execute_returns(): external_single_structure {
+ return fetch::execute_returns();
+ }
+}
diff --git a/grade/templates/grades/grader/gradingpanel/point.mustache b/grade/templates/grades/grader/gradingpanel/point.mustache
new file mode 100644
index 00000000000..ebf77c30a97
--- /dev/null
+++ b/grade/templates/grades/grader/gradingpanel/point.mustache
@@ -0,0 +1,35 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ @template core_grades/grades/grader/gradingpanel/point
+
+ Point-based grading template for use in the grading panel.
+
+ Context variables required for this template:
+
+ Example context (json):
+ {
+ "grade": 47
+ }
+}}
+
diff --git a/grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php b/grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php
new file mode 100644
index 00000000000..66db17e7d0a
--- /dev/null
+++ b/grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php
@@ -0,0 +1,200 @@
+.
+
+/**
+ * Unit tests for core_grades\component_gradeitems;
+ *
+ * @package core_grades
+ * @category test
+ * @copyright 2019 Andrew Nicols
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ */
+
+declare(strict_types = 1);
+
+namespace core_grades\grades\grader\gradingpanel\point\external;
+
+use advanced_testcase;
+use coding_exception;
+use core_grades\component_gradeitem;
+use external_api;
+use mod_forum\local\entities\forum as forum_entity;
+use moodle_exception;
+
+/**
+ * Unit tests for core_grades\component_gradeitems;
+ *
+ * @package core_grades
+ * @category test
+ * @copyright 2019 Andrew Nicols
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class fetch_test extends advanced_testcase {
+
+ public static function setupBeforeClass(): void {
+ global $CFG;
+ require_once("{$CFG->libdir}/externallib.php");
+ }
+
+ /**
+ * Ensure that an execute with an invalid component is rejected.
+ */
+ public function test_execute_invalid_component(): void {
+ $this->resetAfterTest();
+ $user = $this->getDataGenerator()->create_user();
+ $this->setUser($user);
+
+ $this->expectException(coding_exception::class);
+ $this->expectExceptionMessage("The 'foo' item is not valid for the 'mod_invalid' component");
+ fetch::execute('mod_invalid', 1, 'foo', 2);
+ }
+
+ /**
+ * Ensure that an execute with an invalid itemname on a valid component is rejected.
+ */
+ public function test_execute_invalid_itemname(): void {
+ $this->resetAfterTest();
+ $user = $this->getDataGenerator()->create_user();
+ $this->setUser($user);
+
+ $this->expectException(coding_exception::class);
+ $this->expectExceptionMessage("The 'foo' item is not valid for the 'mod_forum' component");
+ fetch::execute('mod_forum', 1, 'foo', 2);
+ }
+
+ /**
+ * Ensure that an execute against a different grading method is rejected.
+ */
+ public function test_execute_incorrect_type(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => -1,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $this->expectException(moodle_exception::class);
+ $this->expectExceptionMessage("not configured for direct grading");
+ fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
+ }
+
+ /**
+ * Ensure that an execute against the correct grading method returns the current state of the user.
+ */
+ public function test_execute_fetch_empty(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => 5,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
+ $result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
+
+ $this->assertIsArray($result);
+ $this->assertArrayHasKey('templatename', $result);
+
+ $this->assertEquals('core_grades/grades/grader/gradingpanel/point', $result['templatename']);
+
+ $this->assertArrayHasKey('grade', $result);
+ $this->assertIsArray($result['grade']);
+ $this->assertArrayHasKey('grade', $result['grade']);
+ $this->assertEmpty($result['grade']['grade']);
+ $this->assertArrayHasKey('timecreated', $result['grade']);
+ $this->assertIsInt($result['grade']['timecreated']);
+ $this->assertArrayHasKey('timemodified', $result['grade']);
+ $this->assertIsInt($result['grade']['timemodified']);
+
+ $this->assertArrayHasKey('warnings', $result);
+ $this->assertIsArray($result['warnings']);
+ $this->assertEmpty($result['warnings']);
+ }
+
+ /**
+ * Ensure that an execute against the correct grading method returns the current state of the user.
+ */
+ public function test_execute_fetch_graded(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => 5,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+ $gradeitem->store_grade_from_formdata($student, $teacher, (object) [
+ 'grade' => 4,
+ ]);
+
+ $result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
+ $result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
+
+ $this->assertIsArray($result);
+ $this->assertArrayHasKey('templatename', $result);
+
+ $this->assertEquals('core_grades/grades/grader/gradingpanel/point', $result['templatename']);
+
+ $this->assertArrayHasKey('grade', $result);
+ $this->assertIsArray($result['grade']);
+ $this->assertArrayHasKey('grade', $result['grade']);
+ $this->assertIsFloat($result['grade']['grade']);
+ $this->assertEquals(grade_floatval(unformat_float(4)), $result['grade']['grade']);
+ $this->assertArrayHasKey('timecreated', $result['grade']);
+ $this->assertIsInt($result['grade']['timecreated']);
+ $this->assertArrayHasKey('timemodified', $result['grade']);
+ $this->assertIsInt($result['grade']['timemodified']);
+
+ $this->assertArrayHasKey('warnings', $result);
+ $this->assertIsArray($result['warnings']);
+ $this->assertEmpty($result['warnings']);
+ }
+
+ /**
+ * Get a forum instance.
+ *
+ * @param array $config
+ * @return forum_entity
+ */
+ protected function get_forum_instance(array $config = []): forum_entity {
+ $this->resetAfterTest();
+
+ $datagenerator = $this->getDataGenerator();
+ $course = $datagenerator->create_course();
+ $forum = $datagenerator->create_module('forum', array_merge($config, ['course' => $course->id]));
+
+ $vaultfactory = \mod_forum\local\container::get_vault_factory();
+ $vault = $vaultfactory->get_forum_vault();
+
+ return $vault->get_from_id((int) $forum->id);
+ }
+}
diff --git a/grade/tests/grades_grader_gradingpanel_point_external_store_test.php b/grade/tests/grades_grader_gradingpanel_point_external_store_test.php
new file mode 100644
index 00000000000..b9c47603479
--- /dev/null
+++ b/grade/tests/grades_grader_gradingpanel_point_external_store_test.php
@@ -0,0 +1,315 @@
+.
+
+/**
+ * Unit tests for core_grades\component_gradeitems;
+ *
+ * @package core_grades
+ * @category test
+ * @copyright 2019 Andrew Nicols
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ */
+
+declare(strict_types = 1);
+
+namespace core_grades\grades\grader\gradingpanel\point\external;
+
+use advanced_testcase;
+use coding_exception;
+use core_grades\component_gradeitem;
+use external_api;
+use mod_forum\local\entities\forum as forum_entity;
+use moodle_exception;
+use grade_grade;
+use grade_item;
+
+/**
+ * Unit tests for core_grades\component_gradeitems;
+ *
+ * @package core_grades
+ * @category test
+ * @copyright 2019 Andrew Nicols
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class store_test extends advanced_testcase {
+
+ public static function setupBeforeClass(): void {
+ global $CFG;
+ require_once("{$CFG->libdir}/externallib.php");
+ }
+
+ /**
+ * Ensure that an execute with an invalid component is rejected.
+ */
+ public function test_execute_invalid_component(): void {
+ $this->resetAfterTest();
+ $user = $this->getDataGenerator()->create_user();
+ $this->setUser($user);
+
+ $this->expectException(coding_exception::class);
+ $this->expectExceptionMessage("The 'foo' item is not valid for the 'mod_invalid' component");
+ store::execute('mod_invalid', 1, 'foo', 2, 'formdata');
+ }
+
+ /**
+ * Ensure that an execute with an invalid itemname on a valid component is rejected.
+ */
+ public function test_execute_invalid_itemname(): void {
+ $this->resetAfterTest();
+ $user = $this->getDataGenerator()->create_user();
+ $this->setUser($user);
+
+ $this->expectException(coding_exception::class);
+ $this->expectExceptionMessage("The 'foo' item is not valid for the 'mod_forum' component");
+ store::execute('mod_forum', 1, 'foo', 2, 'formdata');
+ }
+
+ /**
+ * Ensure that an execute against a different grading method is rejected.
+ */
+ public function test_execute_incorrect_type(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => -1,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $this->expectException(moodle_exception::class);
+ $this->expectExceptionMessage("not configured for direct grading");
+ store::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id, 'formdata');
+ }
+
+ /**
+ * Ensure that an execute against a different grading method is rejected.
+ */
+ public function test_execute_disabled(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance();
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $this->expectException(moodle_exception::class);
+ $this->expectExceptionMessage("Grading is not enabled");
+ store::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id, 'formdata');
+ }
+
+ /**
+ * Ensure that an execute against the correct grading method returns the current state of the user.
+ */
+ public function test_execute_store_empty(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => 5,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $formdata = [
+ 'grade' => null,
+ ];
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $result = store::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id, http_build_query($formdata));
+ $result = external_api::clean_returnvalue(store::execute_returns(), $result);
+
+ // The result should still be empty.
+ $this->assertIsArray($result);
+ $this->assertArrayHasKey('templatename', $result);
+
+ $this->assertEquals('core_grades/grades/grader/gradingpanel/point', $result['templatename']);
+
+ $this->assertArrayHasKey('grade', $result);
+ $this->assertIsArray($result['grade']);
+ $this->assertArrayHasKey('grade', $result['grade']);
+ $this->assertEmpty($result['grade']['grade']);
+ $this->assertArrayHasKey('timecreated', $result['grade']);
+ $this->assertIsInt($result['grade']['timecreated']);
+ $this->assertArrayHasKey('timemodified', $result['grade']);
+ $this->assertIsInt($result['grade']['timemodified']);
+
+ $this->assertArrayHasKey('warnings', $result);
+ $this->assertIsArray($result['warnings']);
+ $this->assertEmpty($result['warnings']);
+
+ // Compare against the grade stored in the database.
+ $storedgradeitem = grade_item::fetch([
+ 'courseid' => $forum->get_course_id(),
+ 'itemtype' => 'mod',
+ 'itemmodule' => 'forum',
+ 'iteminstance' => $forum->get_id(),
+ 'itemnumber' => $gradeitem->get_grade_itemid(),
+ ]);
+ $storedgrade = grade_grade::fetch([
+ 'userid' => $student->id,
+ 'itemid' => $storedgradeitem->id,
+ ]);
+
+ $this->assertEmpty($storedgrade->rawgrade);
+ }
+
+ /**
+ * Ensure that an execute against the correct grading method returns the current state of the user.
+ */
+ public function test_execute_store_graded(): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => 5,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $formdata = [
+ 'grade' => 4,
+ ];
+ $formattedvalue = grade_floatval(unformat_float(4));
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $result = store::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id, http_build_query($formdata));
+ $result = external_api::clean_returnvalue(store::execute_returns(), $result);
+
+ // The result should still be empty.
+ $this->assertIsArray($result);
+ $this->assertArrayHasKey('templatename', $result);
+
+ $this->assertEquals('core_grades/grades/grader/gradingpanel/point', $result['templatename']);
+
+ $this->assertArrayHasKey('grade', $result);
+ $this->assertIsArray($result['grade']);
+ $this->assertArrayHasKey('grade', $result['grade']);
+ $this->assertEquals($formattedvalue, $result['grade']['grade']);
+ $this->assertArrayHasKey('timecreated', $result['grade']);
+ $this->assertIsInt($result['grade']['timecreated']);
+ $this->assertArrayHasKey('timemodified', $result['grade']);
+ $this->assertIsInt($result['grade']['timemodified']);
+
+ $this->assertArrayHasKey('warnings', $result);
+ $this->assertIsArray($result['warnings']);
+ $this->assertEmpty($result['warnings']);
+
+ // Compare against the grade stored in the database.
+ $storedgradeitem = grade_item::fetch([
+ 'courseid' => $forum->get_course_id(),
+ 'itemtype' => 'mod',
+ 'itemmodule' => 'forum',
+ 'iteminstance' => $forum->get_id(),
+ 'itemnumber' => $gradeitem->get_grade_itemid(),
+ ]);
+ $storedgrade = grade_grade::fetch([
+ 'userid' => $student->id,
+ 'itemid' => $storedgradeitem->id,
+ ]);
+
+ $this->assertEquals($formattedvalue, $storedgrade->rawgrade);
+ }
+
+ /**
+ * Ensure that an out-of-range value is rejected.
+ *
+ * @dataProvider execute_out_of_range_provider
+ * @param int $maxvalue The max value of the forum
+ * @param int $suppliedvalue The value that was submitted
+ */
+ public function test_execute_store_out_of__range(int $maxvalue, int $suppliedvalue): void {
+ $this->resetAfterTest();
+
+ $forum = $this->get_forum_instance([
+ // Negative numbers mean a scale.
+ 'grade_forum' => $maxvalue,
+ ]);
+ $course = $forum->get_course_record();
+ $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
+ $student = $this->getDataGenerator()->create_and_enrol($course, 'student');
+ $this->setUser($teacher);
+
+ $formdata = [
+ 'grade' => $suppliedvalue,
+ ];
+
+ $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
+
+ $this->expectException(moodle_exception::class);
+ $this->expectExceptionMessage("Invalid grade '{$suppliedvalue}' provided. Grades must be between 0 and {$maxvalue}.");
+ store::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id, http_build_query($formdata));
+ }
+
+ /**
+ * Data provider for out of range tests.
+ *
+ * @return array
+ */
+ public function execute_out_of_range_provider(): array {
+ return [
+ 'above' => [
+ 'max' => 100,
+ 'supplied' => 101,
+ ],
+ 'above just' => [
+ 'max' => 100,
+ 'supplied' => 101.001,
+ ],
+ 'below' => [
+ 'max' => 100,
+ 'supplied' => -100,
+ ],
+ '-1' => [
+ 'max' => 100,
+ 'supplied' => -1,
+ ],
+ ];
+ }
+
+
+ /**
+ * Get a forum instance.
+ *
+ * @param array $config
+ * @return forum_entity
+ */
+ protected function get_forum_instance(array $config = []): forum_entity {
+ $this->resetAfterTest();
+
+ $datagenerator = $this->getDataGenerator();
+ $course = $datagenerator->create_course();
+ $forum = $datagenerator->create_module('forum', array_merge($config, ['course' => $course->id]));
+
+ $vaultfactory = \mod_forum\local\container::get_vault_factory();
+ $vault = $vaultfactory->get_forum_vault();
+
+ return $vault->get_from_id((int) $forum->id);
+ }
+}
diff --git a/lang/en/grades.php b/lang/en/grades.php
index ff8fc09613e..8afc3ed4bc7 100644
--- a/lang/en/grades.php
+++ b/lang/en/grades.php
@@ -245,6 +245,7 @@ $string['full'] = 'Full';
$string['fullmode'] = 'Change to full view';
$string['generalsettings'] = 'General settings';
$string['grade'] = 'Grade';
+$string['grade_help'] = 'The grade to award this person for their work.';
$string['gradeadministration'] = 'Grade administration';
$string['gradealreadyupdated'] = '{$a} grades have not been imported because the grades in the import file are older than in the grader report. To proceed with the grade import anyway, use the force import option.';
$string['gradeanalysis'] = 'Grade analysis';
diff --git a/lib/db/services.php b/lib/db/services.php
index 147079d167c..a0a34c6354c 100644
--- a/lib/db/services.php
+++ b/lib/db/services.php
@@ -810,6 +810,23 @@ $functions = array(
'description' => 'Update a grade item and associated student grades.',
'type' => 'write',
),
+ 'core_grades_grader_gradingpanel_point_fetch' => [
+ 'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\fetch',
+ 'methodname' => 'execute',
+ 'description' => 'Fetch the data required to display the grader grading panel for simple grading, ' .
+ 'creating the grade item if required',
+ 'type' => 'write',
+ 'ajax' => true,
+ 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
+ ],
+ 'core_grades_grader_gradingpanel_point_store' => [
+ 'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\store',
+ 'methodname' => 'execute',
+ 'description' => 'Store the data required to display the grader grading panel for simple grading',
+ 'type' => 'write',
+ 'ajax' => true,
+ 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
+ ],
'core_grading_get_definitions' => array(
'classname' => 'core_grading_external',
'methodname' => 'get_definitions',