Skip to content

Commit e4c56ac

Browse files
committed
RCOS section mapping
Work in progress
1 parent 8459787 commit e4c56ac

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

student_auto_feed/config.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,23 @@
128128
//Set to true, if Submitty is using SAML for authentication.
129129
define('PROCESS_SAML', true);
130130

131-
/* RENSSELAER CENTER FOR OPEN SOURCE (RCOS) --------------------------------
131+
/* RENSSELAER CENTER FOR OPEN SOURCE (RCOS) -----------------------------------
132132
* RCOS is not just one course, but several. Some of these courses also
133133
* permit a student to declare their credit load. The data feed will need
134134
* a column showing a student's credit load. See above: COLUMN_CREDITS
135135
*
136-
* RCOS courses need to be mapped to a "primary" course in the database,
137-
* but the autofeed will override the registration section as
138-
* "{course_code}-{credit_load}". e.g. "csci4700-4".
136+
* Create only one RCOS course in Submitty, which will show up in the
137+
* grader's/instructor's course list. The other RCOS courses must be mapped to
138+
* this first course. Registration sections do need to be fully mapped, as the
139+
* database does not permit mapping NULL sections. However, the upsert process
140+
* will override how RCOS enrollments are translated, so that registration
141+
* sections are, per student, "{course}-{credits}" e.g. J. Doe is enrolled in
142+
* RCOS course CSCI4700 for 4 credits. They will be listed as enrolled in
143+
* registration section "CSCI4700-4"
139144
*/
140145

141-
// 1. List all RCOS courses, as an array. If you are not tracking RCOS, then set as null or an empty array.
142-
// 2. One (any which one) of these courses needs to be designated as "primary" and the others need to be mapped to the
143-
// primary within the database. Registration sections need to be defined in the database, but are otherwise irrelevant
144-
// as the auto feed will override registration sections.
146+
// List *ALL* RCOS courses, as an array.
147+
// If you are not tracking RCOS, then set this as null or an empty array.
145148
define('RCOS_COURSE_LIST', null);
146149

147150
/* DATA SOURCING --------------------------------------------------------------

student_auto_feed/ssaf_rcos.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
/**
55
* Static utilty class to support RCOS (Rensselaer Center for Open Source)
66
*
7-
* This will override enrollment registration sections for RCOS courses. Some RCOS students may declare how many
8-
* credits they are registered for, but are otherwise all placed in the same course and registration section.
9-
* (currently) Submitty does not keep records for regsitered credits per student, but this record is needed for
10-
* RCOS. Therefore, this helper class will override a RCOS student's enrollment record to `{course}-{credits}`
11-
* e.g. `csci4700-4`. This must done while processing the CSV because every override requires the student's
12-
* registered credits from the CSV.
7+
* This will override enrollment registration sections for RCOS courses to `{course}-{credits}` e.g. `CSCI4700-4`.
8+
* Some RCOS students may declare how many credits they are registering for, so normal course mapping in the database
9+
* is insufficient. This must done while processing the CSV because every override requires each student's registered
10+
* credits from the CSV.
1311
*
1412
* @author Peter Bailie
1513
*/
@@ -18,13 +16,14 @@ class rcos {
1816

1917
public function __construct() {
2018
$this->course_list = RCOS_COURSE_LIST ?? [];
21-
sort($this->course_list, SORT_STRING);
2219
array_walk($this->course_list, function(&$v, $i) { $v = strtolower($v); });
20+
sort($this->course_list, SORT_STRING);
2321
}
2422

2523
/** Adjusts `$row[COLUMN_SECTION]` when `$course` is an RCOS course. */
2624
public function map(string $course, array &$row): void {
2725
if (in_array($course, $this->course_list, true)) {
26+
$course = strtoupper($course);
2827
$row[COLUMN_SECTION] = "{$course}-{$row[COLUMN_CREDITS]}";
2928
}
3029
}

0 commit comments

Comments
 (0)