Skip to content
Snippets Groups Projects
Commit 44edd590 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

allow access to unstartet tests, fixes #61

parent a5c19733
Branches master
No related tags found
No related merge requests found
...@@ -541,7 +541,7 @@ class VipsAssignment extends SimpleORMap ...@@ -541,7 +541,7 @@ class VipsAssignment extends SimpleORMap
$now = date('Y-m-d H:i:s'); $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) { $this->isSelfAssessment() && $this->getUserEndTime($user_id) < $now) {
if ($this->type === 'exam' || $this->options['released'] >= 3) { if ($this->type === 'exam' || $this->options['released'] >= 3) {
return $this->options['released']; return $this->options['released'];
......
...@@ -155,4 +155,20 @@ class VipsFile extends SimpleORMap ...@@ -155,4 +155,20 @@ class VipsFile extends SimpleORMap
{ {
return strpos($this->mime_type, 'image/') === 0; 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;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment