Mass Exam Marker Plugin
A Moodle plugin to help mark massive exams.
|
Static Public Member Functions | |
static | cron () |
static | send_assignment_notification ($userfrom, $userto, $messagetype, $eventtype, $updatetime, $coursemodule, $context, $course, $modulename, $assignmentname, $blindmarking, $uniqueidforuser) |
static | can_upgrade_assignment ($type, $version) |
static | allocate_unique_ids ($assignid) |
static | get_uniqueid_for_user_static ($assignid, $userid) |
static | get_user_id_for_uniqueid_static ($assignid, $uniqueid) |
Data Fields | |
$susers = null | |
Static Protected Member Functions | |
static | format_notification_message_text ($messagetype, $info, $course, $context, $modulename, $assignmentname) |
static | format_notification_message_html ($messagetype, $info, $course, $context, $modulename, $coursemodule, $assignmentname) |
__construct | ( | $coursemodulecontext, | |
$coursemodule, | |||
$course | |||
) |
Constructor for the base assign class.
mixed | $coursemodulecontext | context|null the course module context (or the course context if the coursemodule has not been created yet). |
mixed | $coursemodule | the current course module if it was already loaded, otherwise this class will load one from the context as required. |
mixed | $course | the current course if it was already loaded, otherwise this class will load one from the context as required. |
add_all_plugin_settings | ( | MoodleQuickForm | $mform | ) |
Add settings to edit plugin form.
MoodleQuickForm | $mform | The form to add the configuration settings to. This form is modified directly (not returned). |
|
protected |
Add a new attempt for a user.
int | $userid | int The user to add the attempt for |
add_grade_form_elements | ( | MoodleQuickForm | $mform, |
stdClass | $data, | ||
$params | |||
) |
Add elements to grade form.
MoodleQuickForm | $mform | |
stdClass | $data | |
array | $params |
add_instance | ( | stdClass | $formdata, |
$callplugins | |||
) |
Add this instance to the database.
stdClass | $formdata | The data submitted from the form |
bool | $callplugins | This is used to skip the plugin code when upgrading an old assignment to a new one (the plugins get called manually) |
|
protected |
Add elements in grading plugin form.
mixed | $grade | stdClass|null |
MoodleQuickForm | $mform | |
stdClass | $data | |
int | $userid | - The userid we are grading |
|
protected |
Add one plugins settings to edit plugin form.
assign_plugin | $plugin | The plugin to add the settings from |
MoodleQuickForm | $mform | The form to add the configuration settings to. This form is modified directly (not returned). |
array | $pluginsenabled | A list of form elements to be added to a group. The new element is added to this array by this function. |
|
protected |
Add elements in submission plugin form.
mixed | $submission | stdClass|null |
MoodleQuickForm | $mform | |
stdClass | $data | |
int | $userid | The current userid (same as $USER->id) |
add_submission_form_elements | ( | MoodleQuickForm | $mform, |
stdClass | $data | ||
) |
Add elements to submission form.
MoodleQuickForm | $mform | |
stdClass | $data |
add_to_log | ( | $action = '' , |
|
$info = '' , |
|||
$url = '' , |
|||
$return = false |
|||
) |
Util function to add a message to the log.
string | $action | The current action |
string | $info | A detailed description of the change. But no more than 255 characters. |
string | $url | The url to the assign module instance. |
bool | $return | If true, returns the arguments, else adds to log. The purpose of this is to retrieve the arguments to use them with the new event system (Event 2). |
|
static |
Foreach participant in the course - assign them a random id.
int | $assignid | The assignid to lookup |
|
protected |
Apply a grade from a grading form to a user (may be called multiple times for a group submission).
stdClass | $formdata | - the data from the form |
int | $userid | - the user to apply the grade to |
int | $attemptnumber | - The attempt number to apply the grade to. |
can_grade | ( | ) |
Does this user have grade permission for this assignment?
can_upgrade | ( | $type, | |
$version | |||
) |
This function returns true if it can upgrade an assignment from the 2.2 module.
string | $type | The plugin type |
int | $version | The plugin version |
|
static |
This function is a static wrapper around can_upgrade.
string | $type | The plugin type |
int | $version | The plugin version |
can_view_group_submission | ( | $groupid | ) |
Perform an access check to see if the current $USER can view this group submission.
int | $groupid |
can_view_submission | ( | $userid | ) |
Perform an access check to see if the current $USER can view this users submission.
int | $userid |
|
protected |
Ask the user to confirm they want to submit their work for grading.
moodleform | $mform | - null unless form validation has failed |
|
protected |
Convert the final raw grade(s) in the grading table for the gradebook.
stdClass | $grade |
|
protected |
Convert submission details for the gradebook.
stdClass | $submission |
copy_area_files_for_upgrade | ( | $oldcontextid, | |
$oldcomponent, | |||
$oldfilearea, | |||
$olditemid, | |||
$newcontextid, | |||
$newcomponent, | |||
$newfilearea, | |||
$newitemid | |||
) |
Copy all the files from the old assignment files area to the new one. This is used by the plugin upgrade code.
int | $oldcontextid | The old assignment context id |
int | $oldcomponent | The old assignment component ('assignment') |
int | $oldfilearea | The old assignment filearea ('submissions') |
int | $olditemid | The old submissionid (can be null e.g. intro) |
int | $newcontextid | The new assignment context id |
int | $newcomponent | The new assignment component ('assignment') |
int | $newfilearea | The new assignment filearea ('submissions') |
int | $newitemid | The new submissionid (can be null e.g. intro) |
copy_previous_attempt | ( | & | $notices | ) |
Copy the current assignment submission from the last submitted attempt.
array | $notices | Any error messages that should be shown to the user at the top of the edit submission form. |
count_grades | ( | ) |
Load a count of grades.
count_participants | ( | $currentgroup | ) |
Load a count of active users enrolled in the current course with the specified permission and group. 0 for no group.
int | $currentgroup |
count_submissions | ( | ) |
Load a count of submissions.
count_submissions_need_grading | ( | ) |
Load a count of active users submissions in the current module that require grading This means the submission modification time is more recent than the grading modification time and the status is SUBMITTED.
count_submissions_with_status | ( | $status | ) |
Load a count of submissions with a specified status.
string | $status | The submission status - should match one of the constants |
count_teams | ( | ) |
Load a count of valid teams for this assignment.
|
static |
Finds all assignment notifications that have yet to be mailed out, and mails them.
Cron function to be run periodically according to the moodle cron.
|
protected |
Delete all grades from the gradebook for this assignment.
delete_instance | ( | ) |
Delete this instance from the database.
display_grade | ( | $grade, | |
$editing, | |||
$userid = 0 , |
|||
$modified = 0 |
|||
) |
Return a grade in user-friendly form, whether it's a scale or not.
mixed | $grade | int|null |
boolean | $editing | Are we allowing changes to this grade? |
int | $userid | The user id the grade belongs to |
int | $modified | Timestamp from when the grade was last modified |
download_rewrite_pluginfile_urls | ( | $text, | |
$user, | |||
$plugin | |||
) |
Rewrite plugin file urls so they resolve correctly in an exported zip.
string | $text | - The replacement text |
stdClass | $user | - The user record |
assign_plugin | $plugin | - The assignment plugin |
|
protected |
Download a zip file of all assignment submissions.
format_grade_for_log | ( | stdClass | $grade | ) |
Take a grade object and print a short summary for the log file. The size limit for the log file is 255 characters, so be careful not to include too much information.
stdClass | $grade |
|
staticprotected |
Format a notification for HTML.
string | $messagetype | |
stdClass | $info | |
stdClass | $course | |
stdClass | $context | |
string | $modulename | |
stdClass | $coursemodule | |
string | $assignmentname |
|
staticprotected |
Format a notification for plain text.
string | $messagetype | |
stdClass | $info | |
stdClass | $course | |
stdClass | $context | |
string | $modulename | |
string | $assignmentname |
|
protected |
Take a submission object and print a short summary for the log file. The size limit for the log file is 255 characters, so be careful not to include too much information.
stdClass | $submission |
get_admin_config | ( | ) |
Load and cache the admin config for this module.
|
protected |
Get the grades for all previous attempts. For each grade - the grader is a full user record, and gradefordisplay is added (rendered from grading manager).
int | $userid | If not set, $USER->id will be used. |
|
protected |
Get the submissions for all previous attempts.
int | $userid | If not set, $USER->id will be used. |
get_context | ( | ) |
Get context module.
get_course | ( | ) |
Get the current course.
get_course_context | ( | ) |
Get the context of the current course.
get_course_module | ( | ) |
Get the current course module.
get_feedback_plugin_by_type | ( | $type | ) |
Get a feedback plugin by type.
string | $type | - The type of plugin e.g comments |
get_feedback_plugins | ( | ) |
Get list of feedback plugins installed.
|
protected |
This will retrieve a grade object from the db.
int | $gradeid | The id of the grade |
get_grade_item | ( | ) |
Get the primary grade item for this assign instance.
|
protected |
Returns a list of teachers that should be grading given submission.
int | $userid | The submission to grade |
|
protected |
Get an instance of a grading form if advanced grading is enabled. This is specific to the assignment, marker and student.
int | $userid | - The student userid |
stdClass | false | $grade | - The grade record |
bool | $gradingdisabled |
|
protected |
Utility function to get the userid for every row in the grading table so the order can be frozen while we iterate it.
get_group_submission | ( | $userid, | |
$groupid, | |||
$create, | |||
$attemptnumber = -1 |
|||
) |
Load the group submission object for a particular user, optionally creating it if required.
int | $userid | The id of the user whose submission we want |
int | $groupid | The id of the group for this user - may be 0 in which case it is determined from the userid. |
bool | $create | If set to true a new submission object will be created in the database |
int | $attemptnumber | - -1 means the latest attempt |
get_instance | ( | ) |
Get the settings for the current instance of this assignment
get_marking_workflow_states_for_current_user | ( | ) |
Get the list of marking_workflow states the current user has permission to transition a grade to.
|
protected |
Get the name of the current module.
|
protected |
Get the plural name of the current module.
get_plugin_by_type | ( | $subtype, | |
$type | |||
) |
Get a specific submission plugin by its type.
string | $subtype | assignsubmission | assignfeedback |
string | $type |
get_renderer | ( | ) |
Lazy load the page renderer and expose the renderer to plugins.
get_return_action | ( | ) |
Return an action that can be used to get back to the current page.
get_return_params | ( | ) |
Return a list of parameters that can be used to get back to the current page.
|
protected |
Load the submission object from it's id.
int | $submissionid | The id of the submission we want |
get_submission_group | ( | $userid | ) |
This is used for team assignments to get the group for the specified user. If the user is a member of multiple or no groups this will return false
int | $userid | The id of the user whose submission we want |
get_submission_group_members | ( | $groupid, | |
$onlyids | |||
) |
Get a list of the users in the same group as this user.
int | $groupid | The id of the group whose members we want or 0 for the default group |
bool | $onlyids | Whether to retrieve only the user id's |
get_submission_group_members_who_have_not_submitted | ( | $groupid, | |
$onlyids | |||
) |
Get a list of the users in the same group as this user that have not submitted the assignment.
int | $groupid | The id of the group whose members we want or 0 for the default group |
bool | $onlyids | Whether to retrieve only the user id's |
get_submission_plugin_by_type | ( | $type | ) |
Get a submission plugin by type.
string | $type | - The type of plugin e.g comments |
get_submission_plugins | ( | ) |
Get list of submission plugins installed.
get_uniqueid_for_user | ( | $userid | ) |
Call the static version of this function
int | $userid | The userid to lookup |
|
static |
Lookup this user id and return the unique id for this assignment.
int | $assignid | The assignment id |
int | $userid | The userid to lookup |
get_user_flags | ( | $userid, | |
$create | |||
) |
This will retrieve a user flags object from the db optionally creating it if required. The user flags was split from the user_grades table in 2.5.
int | $userid | The user we are getting the flags for. |
bool | $create | If true the flags record will be created if it does not exist |
get_user_grade | ( | $userid, | |
$create, | |||
$attemptnumber = -1 |
|||
) |
This will retrieve a grade object from the db, optionally creating it if required.
int | $userid | The user we are grading |
bool | $create | If true the grade will be created if it does not exist |
int | $attemptnumber | The attempt number to retrieve the grade for. -1 means the latest submission. |
get_user_grades_for_gradebook | ( | $userid | ) |
Get an upto date list of user grades and feedback for the gradebook.
int | $userid | int or 0 for all users |
get_user_id_for_uniqueid | ( | $uniqueid | ) |
Call the static version of this function.
int | $uniqueid | The uniqueid to lookup |
|
static |
Lookup this unique id and return the user id for this assignment.
int | $assignid | The id of the assignment this user mapping is in |
int | $uniqueid | The uniqueid to lookup |
get_user_submission | ( | $userid, | |
$create, | |||
$attemptnumber = -1 |
|||
) |
Load the submission object for a particular user, optionally creating it if required.
For team assignments there are 2 submissions - the student submission and the team submission All files are associated with the team submission but the status of the students contribution is recorded separately.
int | $userid | The id of the user whose submission we want or 0 in which case USER->id is used |
bool | $create | optional - defaults to false. If set to true a new submission object will be created in the database. |
int | $attemptnumber | - -1 means the latest attempt |
|
protected |
Update grades in the gradebook.
mixed | $submission | stdClass|null |
mixed | $grade | stdClass|null |
grading_disabled | ( | $userid, | |
$checkworkflow = true |
|||
) |
Determine if this users grade can be edited.
int | $userid | - The student userid |
bool | $checkworkflow | - whether to include a check for the workflow state. |
has_instance | ( | ) |
Has this assignment been constructed from an instance?
has_submissions_or_grades | ( | ) |
Does an assignment have submission(s) or grade(s) already?
is_active_user | ( | $userid | ) |
Return true is user is active user in course else false
int | $userid |
is_any_feedback_plugin_enabled | ( | ) |
Check if feedback plugins installed are enabled.
is_any_submission_plugin_enabled | ( | ) |
Check if submission plugins installed are enabled.
is_blind_marking | ( | ) |
Is blind marking enabled and reveal identities not set yet?
|
protected |
See if this assignment has a grade yet.
int | $userid |
list_participants | ( | $currentgroup, | |
$idsonly | |||
) |
Load a list of users enrolled in the current course with the specified permission and group. 0 for no group.
int | $currentgroup | |
bool | $idsonly |
|
protected |
Load the plugins from the sub folders under subtype.
string | $subtype | - either submission or feedback |
lock_submission | ( | $userid | ) |
Prevent student updates to this submission
int | $userid |
notify_grade_modified | ( | $grade | ) |
Mark in the database that this grade record should have an update notification sent by cron.
stdClass | $grade | a grade record keyed on id |
|
protected |
Send notifications to graders upon student submissions.
stdClass | $submission |
|
protected |
Notify student upon successful submission copy.
stdClass | $submission |
|
protected |
Notify student upon successful submission.
stdClass | $submission |
|
protected |
Generate zip file from array of given files.
array | $filesforzipping | - array of files to pass into archive_to_pathname. This array is indexed by the final file name and each element in the array is an instance of a stored_file object. |
|
protected |
Capture the output of the plagiarism plugins disclosures and return it as a string.
plugin_data_preprocessing | ( | & | $defaultvalues | ) |
Allow each plugin an opportunity to update the defaultvalues passed in to the settings form (needed to set up draft areas for editor and filemanager elements)
array | $defaultvalues |
|
protected |
Check for a sess key and then call add_attempt.
int | $userid | int The user to add the attempt for |
|
protected |
Add a new attempt for each user in the list - but reopen each group assignment at most 1 time.
array | $useridlist | Array of userids to reopen. |
|
protected |
Require a valid sess key and then call copy_previous_attempt.
array | $notices | Any error messages that should be shown to the user at the top of the edit submission form. |
|
protected |
Ask the user to confirm they want to perform this batch operation
moodleform | $mform | Set to a grading batch operations form |
|
protected |
Prevent student updates to this submission. Uses url parameter userid.
int | $userid |
|
protected |
Save outcomes submitted from grading form
int | $userid | |
stdClass | $formdata |
|
protected |
Reveal student identities to markers (and the gradebook).
|
protected |
Revert to draft. Uses url parameter userid if userid not supplied as a parameter.
int | $userid |
|
protected |
Save extension date.
moodleform | $mform | The submitted form |
|
protected |
Save grade.
moodleform | $mform |
|
protected |
Save grading options.
|
protected |
Save quick grades.
|
protected |
Save assignment submission.
moodleform | $mform | |
array | $notices | Any error messages that should be shown to the user at the top of the edit submission form. |
|
protected |
Set the marking allocation for multiple users
|
protected |
Set the workflow state for multiple users
|
protected |
Assignment submission is processed before grading.
moodleform | null | $mform | If validation failed when submitting this form - this is the moodleform. It can be null. |
|
protected |
Unlock the student submission. Uses url parameter userid.
int | $userid |
register_return_link | ( | $action, | |
$params | |||
) |
Set the action and parameters that can be used to return to the current page.
string | $action | The action for the current page |
array | $params | An array of name value pairs which form the parameters to return to the current page. |
render_area_files | ( | $component, | |
$area, | |||
$submissionid | |||
) |
Render the files in file area.
string | $component | |
string | $area | |
int | $submissionid |
render_editor_content | ( | $filearea, | |
$submissionid, | |||
$plugintype, | |||
$editor, | |||
$component | |||
) |
Render the content in editor that is often used by plugin.
string | $filearea | |
int | $submissionid | |
string | $plugintype | |
string | $editor | |
string | $component |
reset_userdata | ( | $data | ) |
Actual implementation of the reset course functionality, delete all the assignment submissions for course $data->courseid.
stdClass | $data | the data submitted from the reset course. |
reveal_identities | ( | ) |
Reveal student identities to markers (and the gradebook).
revert_to_draft | ( | $userid | ) |
Revert to draft.
int | $userid |
save_grade | ( | $userid, | |
$data | |||
) |
Save grade update.
int | $userid | |
stdClass | $data |
save_submission | ( | stdClass | $data, |
& | $notices | ||
) |
Save assignment submission for the current user.
stdClass | $data | |
array | $notices | Any error messages that should be shown to the user. |
save_user_extension | ( | $userid, | |
$extensionduedate | |||
) |
Save the extension date for a single user.
int | $userid | The user id |
mixed | $extensionduedate | Either an integer date or null |
|
static |
Message someone about something (static so it can be called from cron).
stdClass | $userfrom | |
stdClass | $userto | |
string | $messagetype | |
string | $eventtype | |
int | $updatetime | |
stdClass | $coursemodule | |
stdClass | $context | |
stdClass | $course | |
string | $modulename | |
string | $assignmentname | |
bool | $blindmarking | |
int | $uniqueidforuser |
send_notification | ( | $userfrom, | |
$userto, | |||
$messagetype, | |||
$eventtype, | |||
$updatetime | |||
) |
Message someone about something.
stdClass | $userfrom | |
stdClass | $userto | |
string | $messagetype | |
string | $eventtype | |
int | $updatetime |
set_context | ( | context | $context | ) |
Set the context.
context | $context | The new context |
set_course | ( | stdClass | $course | ) |
Set the course data.
stdClass | $course | The course data |
set_instance | ( | stdClass | $data | ) |
Set the submitted form data.
stdClass | $data | The form data (instance) |
|
protected |
Based on the current assignment settings should we display the intro.
show_only_active_users | ( | ) |
Check is only active users in course should be shown.
|
protected |
Returns true if the submit subsission button should be shown to the user.
stdClass | $submission | The users own submission record. |
stdClass | $teamsubmission | The users team submission record if there is one |
submission_empty | ( | $submission | ) |
Determine if the current submission is empty or not.
submission | $submission | the students submission record to check. |
submissions_open | ( | $userid = 0 | ) |
Is this assignment open for submissions?
Check the due date, prevent late submissions, has this person already submitted, is the assignment locked?
int | $userid | - Optional userid so we can see if a different user can submit |
submit_for_grading | ( | $data | ) |
Submit a submission for grading.
unlock_submission | ( | $userid | ) |
Unlock the student submission.
int | $userid |
update_calendar | ( | $coursemoduleid | ) |
Update the calendar entries for this assignment.
int | $coursemoduleid | - Required to pass this in because it might not exist in the database yet. |
update_grade | ( | $grade | ) |
Update a grade in the grade table for the assignment and in the gradebook.
stdClass | $grade | a grade record keyed on id |
update_gradebook | ( | $reset, | |
$coursemoduleid | |||
) |
Update the gradebook information for this assignment.
bool | $reset | If true, will reset all grades in the gradbook for this assignment |
int | $coursemoduleid | This is required because it might not exist in the database yet |
update_instance | ( | $formdata | ) |
Update this instance in the database.
stdClass | $formdata | - the data submitted from the form |
|
protected |
Update the settings for a single plugin.
assign_plugin | $plugin | The plugin to update |
stdClass | $formdata | The form data |
|
protected |
Update grades in the gradebook based on submission time.
stdClass | $submission | |
int | $userid | |
bool | $updatetime | |
bool | $teamsubmission |
|
protected |
Update team submission.
stdClass | $submission | |
int | $userid | |
bool | $updatetime |
update_user_flags | ( | $flags | ) |
Update user flags for this user in this assignment.
stdClass | $flags | a flags record keyed on id |
view | ( | $action = '' | ) |
Display the assignment, used by view.php
The assignment is displayed differently depending on your role, the settings for the assignment and the status of the assignment.
string | $action | The current action if any. |
|
protected |
View edit submissions page.
moodleform | $mform | |
array | $notices | A list of notices to display at the top of the edit submission form (e.g. from plugins). |
|
protected |
Display the page footer.
|
protected |
View entire grading page.
|
protected |
View the grading table of all submissions for this assignment.
|
protected |
View the grant extension date page.
Uses url parameters 'userid' or from parameter 'selectedusers'
moodleform | $mform | - Used for validation of the submitted data |
|
protected |
Display the submission that is used by a plugin.
Uses url parameters 'sid', 'gid' and 'plugin'.
string | $pluginsubtype |
|
protected |
Allows the plugin to show a batch grading operation page.
moodleform | $mform |
|
protected |
View a page rendered by a plugin.
Uses url parameters 'pluginaction', 'pluginsubtype', 'plugin', and 'id'.
|
protected |
Display a grading error.
string | $message | - The description of the result |
|
protected |
View a link to go back to the previous page. Uses url parameters returnaction and returnparams.
|
protected |
Show a confirmation page to make sure they want to release student identities.
|
protected |
Display a continue page.
string | $message | - The message to display |
|
protected |
Print the grading page for a single user submission.
moodleform | $mform |
|
protected |
Message for students when assignment submissions have been closed.
view_student_summary | ( | $user, | |
$showlinks | |||
) |
Print 2 tables of information with no action links - the submission summary and the grading summary.
stdClass | $user | the user to print the report for |
bool | $showlinks | - Return plain text or links to the profile |
|
protected |
View submissions page (contains details of current submission).
$susers = null |