Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Workshop external functions and service definitions.
  19   *
  20   * @package    mod_workshop
  21   * @category   external
  22   * @copyright  2017 Juan Leyva <juan@moodle.com>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   * @since      Moodle 3.4
  25   */
  26  
  27  defined('MOODLE_INTERNAL') || die;
  28  
  29  $functions = array(
  30  
  31      'mod_workshop_get_workshops_by_courses' => array(
  32          'classname'     => 'mod_workshop_external',
  33          'methodname'    => 'get_workshops_by_courses',
  34          'description'   => 'Returns a list of workshops in a provided list of courses, if no list is provided all workshops that
  35                              the user can view will be returned.',
  36          'type'          => 'read',
  37          'capabilities'  => 'mod/workshop:view',
  38          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  39      ),
  40      'mod_workshop_get_workshop_access_information' => array(
  41          'classname'     => 'mod_workshop_external',
  42          'methodname'    => 'get_workshop_access_information',
  43          'description'   => 'Return access information for a given workshop.',
  44          'type'          => 'read',
  45          'capabilities'  => 'mod/workshop:view',
  46          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  47      ),
  48      'mod_workshop_get_user_plan' => array(
  49          'classname'     => 'mod_workshop_external',
  50          'methodname'    => 'get_user_plan',
  51          'description'   => 'Return the planner information for the given user.',
  52          'type'          => 'read',
  53          'capabilities'  => 'mod/workshop:view',
  54          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  55      ),
  56      'mod_workshop_view_workshop' => array(
  57          'classname'     => 'mod_workshop_external',
  58          'methodname'    => 'view_workshop',
  59          'description'   => 'Trigger the course module viewed event and update the module completion status.',
  60          'type'          => 'write',
  61          'capabilities'  => 'mod/workshop:view',
  62          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  63      ),
  64      'mod_workshop_add_submission' => array(
  65          'classname'     => 'mod_workshop_external',
  66          'methodname'    => 'add_submission',
  67          'description'   => 'Add a new submission to a given workshop.',
  68          'type'          => 'write',
  69          'capabilities'  => 'mod/workshop:submit',
  70          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  71      ),
  72      'mod_workshop_update_submission' => array(
  73          'classname'     => 'mod_workshop_external',
  74          'methodname'    => 'update_submission',
  75          'description'   => 'Update the given submission.',
  76          'type'          => 'write',
  77          'capabilities'  => 'mod/workshop:submit',
  78          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  79      ),
  80      'mod_workshop_delete_submission' => array(
  81          'classname'     => 'mod_workshop_external',
  82          'methodname'    => 'delete_submission',
  83          'description'   => 'Deletes the given submission.',
  84          'type'          => 'write',
  85          'capabilities'  => 'mod/workshop:submit',
  86          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  87      ),
  88      'mod_workshop_get_submissions' => array(
  89          'classname'     => 'mod_workshop_external',
  90          'methodname'    => 'get_submissions',
  91          'description'   => 'Retrieves all the workshop submissions or the one done by the given user (except example submissions).',
  92          'type'          => 'read',
  93          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  94      ),
  95      'mod_workshop_get_submission' => array(
  96          'classname'     => 'mod_workshop_external',
  97          'methodname'    => 'get_submission',
  98          'description'   => 'Retrieves the given submission.',
  99          'type'          => 'read',
 100          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 101      ),
 102      'mod_workshop_get_submission_assessments' => array(
 103          'classname'     => 'mod_workshop_external',
 104          'methodname'    => 'get_submission_assessments',
 105          'description'   => 'Retrieves all the assessments of the given submission.',
 106          'type'          => 'read',
 107          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 108      ),
 109      'mod_workshop_get_assessment' => array(
 110          'classname'     => 'mod_workshop_external',
 111          'methodname'    => 'get_assessment',
 112          'description'   => 'Retrieves the given assessment.',
 113          'type'          => 'read',
 114          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 115      ),
 116      'mod_workshop_get_assessment_form_definition' => array(
 117          'classname'     => 'mod_workshop_external',
 118          'methodname'    => 'get_assessment_form_definition',
 119          'description'   => 'Retrieves the assessment form definition.',
 120          'type'          => 'read',
 121          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 122      ),
 123      'mod_workshop_get_reviewer_assessments' => array(
 124          'classname'     => 'mod_workshop_external',
 125          'methodname'    => 'get_reviewer_assessments',
 126          'description'   => 'Retrieves all the assessments reviewed by the given user.',
 127          'type'          => 'read',
 128          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 129      ),
 130      'mod_workshop_update_assessment' => array(
 131          'classname'     => 'mod_workshop_external',
 132          'methodname'    => 'update_assessment',
 133          'description'   => 'Add information to an allocated assessment.',
 134          'type'          => 'write',
 135          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 136      ),
 137      'mod_workshop_get_grades' => array(
 138          'classname'     => 'mod_workshop_external',
 139          'methodname'    => 'get_grades',
 140          'description'   => 'Returns the assessment and submission grade for the given user.',
 141          'type'          => 'read',
 142          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 143      ),
 144      'mod_workshop_evaluate_assessment' => array(
 145          'classname'     => 'mod_workshop_external',
 146          'methodname'    => 'evaluate_assessment',
 147          'description'   => 'Evaluates an assessment (used by teachers for provide feedback to the reviewer).',
 148          'type'          => 'write',
 149          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 150      ),
 151      'mod_workshop_get_grades_report' => array(
 152          'classname'     => 'mod_workshop_external',
 153          'methodname'    => 'get_grades_report',
 154          'description'   => 'Retrieves the assessment grades report.',
 155          'type'          => 'read',
 156          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 157      ),
 158      'mod_workshop_view_submission' => array(
 159          'classname'     => 'mod_workshop_external',
 160          'methodname'    => 'view_submission',
 161          'description'   => 'Trigger the submission viewed event.',
 162          'type'          => 'write',
 163          'capabilities'  => 'mod/workshop:view',
 164          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 165      ),
 166      'mod_workshop_evaluate_submission' => array(
 167          'classname'     => 'mod_workshop_external',
 168          'methodname'    => 'evaluate_submission',
 169          'description'   => 'Evaluates a submission (used by teachers for provide feedback or override the submission grade).',
 170          'type'          => 'write',
 171          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 172      ),
 173  );