MDL-39760: mod_assign: Make submit_for_grading accept submission as parameter
[moodle.git] / mod / assign / submissionplugin.php
CommitLineData
bbd0e548
DW
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 * This file contains the definition for the abstract class for submission_plugin
19 *
20 * This class provides all the functionality for submission plugins.
21 *
22 * @package mod_assign
23 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27defined('MOODLE_INTERNAL') || die();
28
29require_once($CFG->dirroot . '/mod/assign/assignmentplugin.php');
30
31/**
32 * Abstract base class for submission plugin types.
33 *
34 * @package mod_assign
35 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 */
38abstract class assign_submission_plugin extends assign_plugin {
39
40 /**
41 * return subtype name of the plugin
42 *
43 * @return string
44 */
45 public final function get_subtype() {
46 return 'assignsubmission';
47 }
48
49 /**
50 * This plugin accepts submissions from a student
51 * The comments plugin has no submission component so should not be counted
52 * when determining whether to show the edit submission link.
53 * @return boolean
54 */
55 public function allow_submissions() {
56 return true;
57 }
58
59
60 /**
61 * Check if the submission plugin has all the required data to allow the work
62 * to be submitted for grading
63 * @return bool|string 'true' if OK to proceed with submission, otherwise a
64 * a message to display to the user
65 */
66 public function precheck_submission() {
67 return true;
68 }
69
70 /**
71 * Carry out any extra processing required when the work is submitted for grading
7aec80dd
RK
72 *
73 * @param stdClass $submission - assign_submission data
bbd0e548
DW
74 * @return void
75 */
7aec80dd 76 public function submit_for_grading(stdClass $submission) {
bbd0e548
DW
77 }
78
79}