Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-autograde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CS-107
moodle-autograde
Commits
742eeb0c
Commit
742eeb0c
authored
1 year ago
by
Hamza Remmal
Browse files
Options
Downloads
Patches
Plain Diff
design the skeleton of the autograde_get_infos function
parent
23adafba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
moodle-assignsubmission-autograde/classes/external/autograde_get_infos.php
+67
-0
67 additions, 0 deletions
...ission-autograde/classes/external/autograde_get_infos.php
moodle-assignsubmission-autograde/db/services.php
+8
-1
8 additions, 1 deletion
moodle-assignsubmission-autograde/db/services.php
with
75 additions
and
1 deletion
moodle-assignsubmission-autograde/classes/external/autograde_get_infos.php
0 → 100644
+
67
−
0
View file @
742eeb0c
<?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
This diff is collapsed.
Click to expand it.
moodle-assignsubmission-autograde/db/services.php
+
8
−
1
View file @
742eeb0c
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment