Skip to content

Commit 6f33140

Browse files
authored
[Feature:RainbowGrades] add withdrawn registration status (#84)
Outputs the registrations status (graded, withdrawn, audit) as an additional column in the instructor output table. also removes deprecated columns tracking the late days used & available for the term. (This is now available in the 'my late days & extensions' table.) Co-authored-by: Barb Cutler <Barb Cutler>
1 parent 912cfdf commit 6f33140

File tree

6 files changed

+56
-22
lines changed

6 files changed

+56
-22
lines changed

MakefileHelper

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ pull:
4343

4444
push:
4545
rsync -azP individual_summary_html/*.html ${USERNAME}@${HWSERVER}:${REPORTS_DIRECTORY}/summary_html/
46+
#FIXME: this should be generalized
47+
# rsync -azP individual_summary_html/*.json ${USERNAME}@${HWSERVER}:${REPORTS_DIRECTORY}/seating/test3/
4648
rsync -azP individual_summary_html/*.json ${USERNAME}@${HWSERVER}:${REPORTS_DIRECTORY}/seating/final_exam/
4749

4850
local_pull:
@@ -51,6 +53,8 @@ local_pull:
5153

5254
local_push:
5355
rsync -azPq individual_summary_html/*.html ${REPORTS_DIRECTORY}/summary_html/
56+
#FIXME: this should be generalized
57+
# rsync -azPq individual_summary_html/*.json ${REPORTS_DIRECTORY}/seating/test3/
5458
rsync -azPq individual_summary_html/*.json ${REPORTS_DIRECTORY}/seating/final_exam/
5559

5660
pull_test:

main.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,14 @@ void processcustomizationfile(const std::string &now_string,
10451045
s->setAudit();
10461046
s->addNote("AUDIT");
10471047
}
1048-
} else if (token == "withdraw") {
1048+
} else if (token == "withdrawn") {
10491049
std::vector<nlohmann::json> withdraw_list = itr.value();
10501050
for (std::size_t i = 0; i < withdraw_list.size(); i++) {
10511051
std::string username = withdraw_list[i];
10521052
Student *s = GetStudent(students,username);
10531053
assert (s != NULL);
1054-
assert (s->getWithdraw() == false);
1055-
s->setWithdraw();
1054+
assert (s->getWithdrawn() == false);
1055+
s->setWithdrawn();
10561056
s->addNote("LATE WITHDRAW");
10571057
}
10581058
} else if (token == "independentstudy") {
@@ -1245,7 +1245,14 @@ void load_student_grades(std::vector<Student*> &students) {
12451245
}
12461246
s->setRotatingSection(a);
12471247
} else if (token == "registration_type") {
1248-
// Skip this token for now
1248+
std::string type = j[token];
1249+
if (type == "withdrawn") s->setWithdrawn();
1250+
else if (type == "audit") s->setAudit();
1251+
else if (type == "staff") { }
1252+
else {
1253+
assert (type == "graded");
1254+
s->setGraded();
1255+
}
12491256
} else if (token == "default_allowed_late_days") {
12501257
int value = 0;
12511258
if (!j[token].is_null()) {

output.cpp

+22-14
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ void start_table_output( bool /*for_instructor*/,
569569
int counter = 0;
570570
table.set(0,counter++,TableCell("ffffff","#"));
571571
table.set(0,counter++,TableCell("ffffff","SECTION"));
572+
table.set(0,counter++,TableCell("ffffff","reg type"));
572573
if (DISPLAY_INSTRUCTOR_NOTES) {
573574
table.set(0,counter++,TableCell("ffffff","part."));
574575
table.set(0,counter++,TableCell("ffffff","under."));
@@ -677,9 +678,9 @@ void start_table_output( bool /*for_instructor*/,
677678
table.set(0,counter++,TableCell("ffffff","INCORRECT POLLS"));
678679

679680
//Late days headers
680-
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","ALLOWED LATE DAYS"));
681-
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","USED LATE DAYS"));
682-
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","EXCUSED EXTENSIONS"));
681+
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","ALLOWED LATE DAYS"));
682+
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","USED LATE DAYS"));
683+
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","EXCUSED EXTENSIONS"));
683684
student_data.push_back(counter); table.set(0,counter++,TableCell(grey_divider));
684685
}
685686
}
@@ -754,8 +755,13 @@ void start_table_output( bool /*for_instructor*/,
754755

755756
std::string section_color = default_color;
756757
std::string section_label = "";
758+
std::string status = "";
757759
if(!csv_mode) {
758760
colorit_section2(this_student->getSection(), section_color, section_label);
761+
if (validSection(this_student->getSection())) {
762+
status = this_student->getRegistrationStatus();
763+
if (status == "withdrawn") section_color = default_color;
764+
}
759765
}
760766
else{
761767
if (validSection(this_student->getSection())) {
@@ -765,8 +771,10 @@ void start_table_output( bool /*for_instructor*/,
765771
section_label = this_student->getSection() + " (" + section_label + ")";
766772
}
767773
}
774+
if (status != "graded") section_color = default_color;
768775
assert (section_color.size()==6);
769776
table.set(myrow,counter++,TableCell(section_color,section_label));
777+
table.set(myrow,counter++,TableCell(default_color,status));
770778

771779
if (DISPLAY_INSTRUCTOR_NOTES) {
772780
float participation = this_student->getParticipation();
@@ -1084,23 +1092,23 @@ void start_table_output( bool /*for_instructor*/,
10841092
table.set(myrow,counter++,TableCell(color,polls_correct,"",0,CELL_CONTENTS_VISIBLE,"right"));
10851093
table.set(myrow,counter++,TableCell(color,polls_incorrect,"",0,CELL_CONTENTS_VISIBLE,"right"));
10861094

1087-
std::string color = coloritcolor(allowed,5,4,3,2,2);
1088-
table.set(myrow,counter++,TableCell(color,allowed,"",0,CELL_CONTENTS_VISIBLE,"right"));
1089-
int used = this_student->getUsedLateDays();
1090-
color = coloritcolor(allowed-used+2, 5+2, 3+2, 2+2, 1+2, 0+2);
1091-
table.set(myrow,counter++,TableCell(color,used,"",0,CELL_CONTENTS_VISIBLE,"right"));
1092-
int exceptions = this_student->getLateDayExceptions();
1093-
color = coloritcolor(exceptions,5,4,3,2,2);
1094-
table.set(myrow,counter++,TableCell(color,exceptions,"",0,CELL_CONTENTS_VISIBLE,"right"));
1095+
//std::string color = coloritcolor(allowed,5,4,3,2,2);
1096+
//table.set(myrow,counter++,TableCell(color,allowed,"",0,CELL_CONTENTS_VISIBLE,"right"));
1097+
//int used = this_student->getUsedLateDays();
1098+
//color = coloritcolor(allowed-used+2, 5+2, 3+2, 2+2, 1+2, 0+2);
1099+
//table.set(myrow,counter++,TableCell(color,used,"",0,CELL_CONTENTS_VISIBLE,"right"));
1100+
//int exceptions = this_student->getLateDayExceptions();
1101+
//color = coloritcolor(exceptions,5,4,3,2,2);
1102+
//table.set(myrow,counter++,TableCell(color,exceptions,"",0,CELL_CONTENTS_VISIBLE,"right"));
10951103
} else {
10961104
color="ffffff"; // default_color;
10971105
table.set(myrow,counter++,TableCell(color,""));
10981106
table.set(myrow,counter++,TableCell(color,""));
10991107
table.set(myrow,counter++,TableCell(color,""));
11001108
table.set(myrow,counter++,TableCell(color,""));
1101-
table.set(myrow,counter++,TableCell(color,""));
1102-
table.set(myrow,counter++,TableCell(color,""));
1103-
table.set(myrow,counter++,TableCell(color,""));
1109+
//table.set(myrow,counter++,TableCell(color,""));
1110+
//table.set(myrow,counter++,TableCell(color,""));
1111+
//table.set(myrow,counter++,TableCell(color,""));
11041112
}
11051113
table.set(myrow,counter++,TableCell(grey_divider));
11061114
}

student.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Student::Student() {
1717
// registration status
1818
section = "null";
1919
audit = false;
20-
withdraw = false;
20+
withdrawn = false;
21+
graded = false;
2122
independentstudy = false;
2223

2324
default_allowed_late_days = 0;

student.h

+13-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,17 @@ class Student {
103103
const std::string& getCourseSectionId() const { return course_section_id; }
104104
int getRotatingSection() const { return rotating_section; }
105105
bool getAudit() const { return audit; }
106-
bool getWithdraw() const { return withdraw; }
106+
bool getWithdrawn() const { return withdrawn; }
107+
bool getGraded() const { return graded; }
107108
bool getIndependentStudy() const { return independentstudy; }
108109

110+
std::string getRegistrationStatus() const {
111+
if (audit) return "audit";
112+
if (withdrawn) return "withdrawn";
113+
if (graded) return "graded";
114+
return "other";
115+
}
116+
109117
// grade data
110118
const ItemGrade& getGradeableItemGrade(GRADEABLE_ENUM g, int i) const;
111119
std::string getZone(int i) const;
@@ -175,7 +183,8 @@ class Student {
175183
void setCourseSectionId(const std::string &x) { course_section_id = x; }
176184
void setRotatingSection(int x) { rotating_section = x; }
177185
void setAudit() { audit = true; }
178-
void setWithdraw() { withdraw = true; }
186+
void setWithdrawn() { withdrawn = true; }
187+
void setGraded() { graded = true; }
179188
void setIndependentStudy() { independentstudy = true; }
180189

181190
// grade data
@@ -273,7 +282,8 @@ class Student {
273282
std::string course_section_id;
274283
int rotating_section;
275284
bool audit;
276-
bool withdraw;
285+
bool withdrawn;
286+
bool graded;
277287
bool independentstudy;
278288

279289
// grade data

zone.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ int CountLefties(std::vector<Student*> &students,const std::string& lefty_file,
119119
s->setLefty();
120120
if (s->getExamRoom() != "") {
121121
//std::cout << "ALREADY ASSIGNED ROOM " << user << std::endl;
122+
} else if (s->getRegistrationStatus() != "graded") {
123+
// skipping
122124
} else if (s->overall() < GLOBAL_MIN_OVERALL_FOR_ZONE_ASSIGNMENT) {
123125
//std::cout << "NOT ASSIGNING LEFTY " << user << std::endl;
124126
} else {
@@ -389,6 +391,8 @@ void LoadExamSeatingFile(const std::string &zone_counts_filename,
389391
already_zoned++;
390392
} else if (!validSection(s->getSection())) {
391393
not_reg++;
394+
} else if (s->getRegistrationStatus() != "graded") {
395+
not_reg++;
392396
} else if (s->overall() < GLOBAL_MIN_OVERALL_FOR_ZONE_ASSIGNMENT) {
393397
low_overall_grade++;
394398
} else if (OmitSectionFromStats(s->getSection())) {

0 commit comments

Comments
 (0)