Skip to content

Commit 8b5b2e8

Browse files
authored
[Feature:System] Autofeed — Course Section ID (#31)
* New ID column for course and section * Update ssaf_sql.php
1 parent 2a82b27 commit 8b5b2e8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

student_auto_feed/config.php

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
define('COLUMN_PREFERREDNAME', 3); //Student's Preferred Name
117117
define('COLUMN_EMAIL', 4); //Student's Campus Email
118118
define('COLUMN_TERM_CODE', 11); //Semester code used in data validation
119+
define('COLUMN_REG_ID', 12); //Course and Section registration ID
119120

120121
//Validate term code. Set to null to disable this check.
121122
define('EXPECTED_TERM_CODE', '201705');

student_auto_feed/ssaf_db.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public static function upsert($semester, $course, $rows) : bool {
199199
"FALSE"
200200
);
201201

202-
$reg_sections_params = array($semester, $course, $row[COLUMN_SECTION]);
202+
$reg_sections_params = array($semester, $course, $row[COLUMN_SECTION], $row[COLUMN_REG_ID]);
203203
$tmp_table_params = array($row[COLUMN_USER_ID]);
204204
$dropped_users_params = array($semester, $course);
205205

student_auto_feed/ssaf_sql.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ class sql {
100100
INSERT INTO courses_registration_sections (
101101
semester,
102102
course,
103-
registration_section_id
104-
) VALUES ($1, $2, $3)
103+
registration_section_id,
104+
course_section_id
105+
) VALUES ($1, $2, $3, $4)
105106
ON CONFLICT DO NOTHING
106107
SQL;
107108

0 commit comments

Comments
 (0)