File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ public function process_course_interactive($processid) {
300300 * @throws \coding_exception
301301 * @throws \dml_exception
302302 */
303- public function get_course_recordset ($ triggers , $ nositecourse = true , $ forcounting = false ) {
303+ public function get_course_recordset ($ triggers , $ nositecourse = true , $ forcounting = false ) {
304304 global $ DB , $ SESSION ;
305305
306306 $ where = " TRUE " ;
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ public function check_course($course, $triggerid) {
5959 public function get_course_recordset_where ($ triggerid ) {
6060 $ exclude = settings_manager::get_settings ($ triggerid , settings_type::TRIGGER )['exclude ' ];
6161 if ($ exclude ) {
62- $ where = " NOT c.startdate > :semindepdate " ;
62+ $ where = " NOT c.startdate < :semindepdate " ;
6363 } else {
64- $ where = "c.startdate > :semindepdate " ;
64+ $ where = "c.startdate < :semindepdate " ;
6565 }
6666 // Date before which a course counts as semester independent. In this case the 1.1.2000.
6767 $ params = ["semindepdate " => 946688400 ];
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function setUp(): void {
5757 $ this ->resetAfterTest (true );
5858 $ this ->setAdminUser ();
5959 $ this ->processor = new processor ();
60- $ this ->semindependentcourse = $ this ->getDataGenerator ()->create_course (['startdate ' => 915152400 ]);
60+ $ this ->semindependentcourse = $ this ->getDataGenerator ()->create_course (['startdate ' => 946600000 ]);
6161 $ this ->semcourse = $ this ->getDataGenerator ()->create_course (['startdate ' => time ()]);
6262 }
6363
@@ -69,15 +69,15 @@ public function test_include_semester_independent(): void {
6969
7070 $ this ->triggerinstance = generator::create_workflow_with_semindependent (false );
7171
72- $ recordset = $ this ->processor ->get_course_recordset ([$ this ->triggerinstance ]);
72+ $ triggeredcourses = $ this ->processor ->get_course_recordset ([$ this ->triggerinstance ]);
7373 $ foundsem = false ;
7474 $ foundsemindep = false ;
75- foreach ($ recordset as $ element ) {
76- if ($ this -> semcourse -> id === $ element ->id ) {
75+ foreach ($ triggeredcourses as $ triggeredcourse ) {
76+ if ($ triggeredcourse -> id === $ this -> semcourse ->id ) {
7777 $ foundsem = true ;
7878 break ;
7979 }
80- if ($ this -> semindependentcourse -> id === $ element ->id ) {
80+ if ($ triggeredcourse -> id === $ this -> semindependentcourse ->id ) {
8181 $ foundsemindep = true ;
8282 break ;
8383 }
You can’t perform that action at this time.
0 commit comments