Skip to content
Snippets Groups Projects
Commit 742eeb0c authored by Hamza Remmal's avatar Hamza Remmal
Browse files

design the skeleton of the autograde_get_infos function

parent 23adafba
No related branches found
No related tags found
No related merge requests found
<?php
// This file is part of Moodle - https://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 <https://www.gnu.org/licenses/>.
/**
* This file defines a function to fetch information about an assignment to store
* in the autograde logs
*
* @see https://moodledev.io/docs/apis/subsystems/external/functions
* @author Hamza REMMAL (hamza.remmal@epfl.ch)
* @package assignsubmission_autograde
* @copyright 2023 AUTOGRADE-EPFL <autograde-support@groupes.epfl.ch>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignsubmission_autograde\external;
use external_api;
use external_function_parameters;
use external_single_structure;
use external_value;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once(__DIR__.'/../../lib.php');
require_once($CFG->libdir . '/externallib.php');
require_once($CFG->dirroot . '/mod/assign/locallib.php');
final class autograde_get_infos extends external_api {
/**
* ???
* @return external_function_parameters ???
*/
public static function get_infos_parameters(): external_function_parameters {
return new external_function_parameters([
'submissionid' => new external_value(PARAM_INT, 'ID of an autograde compatible submission'),
]);
}
public static function get_infos($submissionid): object {
return new \stdClass();
}
/**
* ???
* @return external_value ???
*/
public static function get_infos_returns(): external_value {
return new external_value(PARAM_TEXT, 'information');
}
}
\ No newline at end of file
......@@ -46,6 +46,12 @@ $functions = [
'description' => 'Download an autograde credential',
'capabilities' => 'mod/assign/submission/autograde:read_credentials',
],
'mod_assignsubmission_autograde_get_infos' => [
'classname' => 'assignsubmission_autograde\external\autograde_get_infos',
'methodname' => 'get_infos',
'description' => 'Fetch information on an autograde compatible submission',
'capabilities' => '',
],
];
$services = [
......@@ -53,7 +59,8 @@ $services = [
'functions' => [
'mod_assignsubmission_autograde_upload_feedback',
'mod_assignsubmission_autograde_download_submission',
'mod_assignsubmission_autograde_download_credentials'
'mod_assignsubmission_autograde_download_credentials',
'mod_assignsubmission_autograde_get_infos'
],
'restrictedusers' => 1,
'enabled' => 1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment