Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Base class for unit tests for mod_assign.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 136 lines (5 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 1 file
 mod/assign/tests/fixtures/testable_assign.php

Defines 4 functions


Functions that are not part of a class:

create_instance($course, $params = [], $options = [])   X-Ref
Convenience function to create a testable instance of an assignment.

param: array $params Array of parameters to pass to the generator
return: testable_assign Testable wrapper around the assign class.

add_submission($student, $assign, $onlinetext = null, $changeuser = true)   X-Ref
Add a user submission to the assignment.

param: \stdClass   $student The user to submit for
param: \assign     $assign The assignment to submit to
param: string      $onlinetext The text tobe submitted
param: bool        $changeuser Whether to switch user to the user being submitted as.

submit_for_grading($student, $assign, $data = [], $changeuser = true)   X-Ref
Submit the assignemnt for grading.

param: \stdClass   $student The user to submit for
param: \assign     $assign The assignment to submit to
param: array       $data Additional data to set
param: bool        $changeuser Whether to switch user to the user being submitted as.

mark_submission($teacher, $assign, $student, $grade = 50.0, $data = [], $attempt = 0)   X-Ref
Mark the submission.

param: \stdClass   $teacher The user to mark as
param: \assign     $assign The assignment to mark
param: \stdClass   $student The user to grade
param: array       $data Additional data to set
param: bool        $changeuser Whether to switch user to the user being submitted as.