We want to prevent conflicts with get_enrolled_sql trick for db caching
plus users should be able to access the course once enrolled.
$timestart = $course->startdate;
break;
case 4:
- $timestart = time();
+ // We mimic get_enrolled_sql round(time(), -2) but always floor as we want users to always access their
+ // courses once they are enrolled.
+ $timestart = intval(substr(time(), 0, 8) . '00') - 1;
break;
case 3:
default:
$timestart = $course->startdate;
break;
case 4:
- $timestart = $now;
+ // We mimic get_enrolled_sql round(time(), -2) but always floor as we want users to always access their
+ // courses once they are enrolled.
+ $timestart = intval(substr($now, 0, 8) . '00') - 1;
break;
case 3:
default: