diff --git a/lib/VipsAssignment.php b/lib/VipsAssignment.php index 6c62f92519fd4304045169a76e2d8f18ddf01625..1eacae4aea4db8d7eafa33f7d53bf2fdc367afd9 100644 --- a/lib/VipsAssignment.php +++ b/lib/VipsAssignment.php @@ -541,7 +541,7 @@ class VipsAssignment extends SimpleORMap $now = date('Y-m-d H:i:s'); - if ($this->isFinished() && $this->getAssignmentAttempt($user_id) || + if ($this->isFinished() && ($this->type === 'practice' || $this->getAssignmentAttempt($user_id)) || $this->isSelfAssessment() && $this->getUserEndTime($user_id) < $now) { if ($this->type === 'exam' || $this->options['released'] >= 3) { return $this->options['released']; diff --git a/lib/VipsFile.php b/lib/VipsFile.php index 5c43ff0d0e7a4955e072560fa62b0ebffb49b3b1..89e01ccb03bee5af4957f24ae71e6b27daf002d3 100644 --- a/lib/VipsFile.php +++ b/lib/VipsFile.php @@ -155,4 +155,20 @@ class VipsFile extends SimpleORMap { return strpos($this->mime_type, 'image/') === 0; } + + /** + * Determine if this file references an audio file. + */ + public function isAudio() + { + return strpos($this->mime_type, 'audio/') === 0; + } + + /** + * Determine if this file references a video file. + */ + public function isVideo() + { + return strpos($this->mime_type, 'video/') === 0; + } }