mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-46078 Assign: Completion is not using assignment API.
Should not be directly querying the DB to get the submission, use the API!
This commit is contained in:
parent
9325cd963f
commit
5ce0f749a6
@ -1309,8 +1309,7 @@ function assign_get_completion_state($course, $cm, $userid, $type) {
|
||||
|
||||
// If completion option is enabled, evaluate it and return true/false.
|
||||
if ($assign->get_instance()->completionsubmit) {
|
||||
$dbparams = array('assignment'=>$assign->get_instance()->id, 'userid'=>$userid);
|
||||
$submission = $DB->get_record('assign_submission', $dbparams, '*', IGNORE_MISSING);
|
||||
$submission = $assign->get_user_submission($userid, false);
|
||||
return $submission && $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||
} else {
|
||||
// Completion option is not enabled so just return $type.
|
||||
|
Loading…
x
Reference in New Issue
Block a user