Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 53... Línea 53...
53
            'couldnotsavegrade' => 'Could not save grade.',
53
            'couldnotsavegrade' => 'Could not save grade.',
54
            'couldnotstartsubmission' => 'Could not start submission with time limit.',
54
            'couldnotstartsubmission' => 'Could not start submission with time limit.',
55
            'submissionnotopen' => 'This assignment is not open for submissions',
55
            'submissionnotopen' => 'This assignment is not open for submissions',
56
            'timelimitnotenabled' => 'Time limit is not enabled for assignment.',
56
            'timelimitnotenabled' => 'Time limit is not enabled for assignment.',
57
            'opensubmissionexists' => 'Open assignment submission already exists.',
57
            'opensubmissionexists' => 'Open assignment submission already exists.',
-
 
58
            'couldnotremovesubmission' => 'Could not remove the submission for this user',
-
 
59
            'submissionnotfoundtoremove' => 'There is no submission to remove',
58
        ];
60
        ];
Línea 59... Línea 61...
59
 
61
 
60
        $message = $warningmessages[$warningcode];
62
        $message = $warningmessages[$warningcode];
61
        if (empty($message)) {
63
        if (empty($message)) {
Línea 100... Línea 102...
100
     * @param int $groupid Group id.
102
     * @param int $groupid Group id.
101
     * @param bool $create Whether a new submission should be created.
103
     * @param bool $create Whether a new submission should be created.
102
     * @param int $attemptnumber Attempt number. Use -1 for last attempt.
104
     * @param int $attemptnumber Attempt number. Use -1 for last attempt.
103
     * @return bool|\stdClass
105
     * @return bool|\stdClass
104
     */
106
     */
105
    protected static function get_user_or_group_submission(\assign $assignment, int $userid = null,
107
    protected static function get_user_or_group_submission(\assign $assignment, ?int $userid = null,
106
            int $groupid = 0, bool $create = false, int $attemptnumber = -1) {
108
            int $groupid = 0, bool $create = false, int $attemptnumber = -1) {
107
        if ($assignment->get_instance($userid)->teamsubmission) {
109
        if ($assignment->get_instance($userid)->teamsubmission) {
108
            $submission = $assignment->get_group_submission($userid, $groupid, $create, $attemptnumber);
110
            $submission = $assignment->get_group_submission($userid, $groupid, $create, $attemptnumber);
109
        } else {
111
        } else {
110
            $submission = $assignment->get_user_submission($userid, $create, $attemptnumber);
112
            $submission = $assignment->get_user_submission($userid, $create, $attemptnumber);