mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Changed some logic ... I think it's the same anyway but this reads easier for me
This commit is contained in:
parent
04e443258c
commit
020266d04d
1 changed files with 5 additions and 5 deletions
|
@ -55,10 +55,10 @@ function get_student_courses(&$user) {
|
||||||
|
|
||||||
if (get_field("course", "visible", "id", $student->course)) {
|
if (get_field("course", "visible", "id", $student->course)) {
|
||||||
|
|
||||||
/// Is student enrolled for a specific time period?
|
/// Is the student enrolment active right now?
|
||||||
|
|
||||||
if ( ( $student->timestart == 0 or ( $currenttime > $student->timestart )) and
|
if ( (!$student->timestart and !$student->timeend) or
|
||||||
( $student->timeend == 0 or ( $currenttime < $student->timeend )) ) {
|
( $student->timestart < $currenttime and $currenttime < $student->timeend) ) {
|
||||||
$user->student[$student->course] = true;
|
$user->student[$student->course] = true;
|
||||||
$user->timeaccess[$student->course] = $student->timeaccess;
|
$user->timeaccess[$student->course] = $student->timeaccess;
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,8 @@ function get_teacher_courses(&$user) {
|
||||||
|
|
||||||
/// Is teacher only teaching this course for a specific time period?
|
/// Is teacher only teaching this course for a specific time period?
|
||||||
|
|
||||||
if ( ( $teacher->timestart == 0 or ( $currenttime > $teacher->timestart )) and
|
if ( (!$teacher->timestart and !$teacher->timeend) or
|
||||||
( $teacher->timeend == 0 or ( $currenttime < $teacher->timeend )) ) {
|
( $teacher->timestart < $currenttime and $currenttime < $teacher->timeend) ) {
|
||||||
|
|
||||||
$user->teacher[$teacher->course] = true;
|
$user->teacher[$teacher->course] = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue