Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature:RainbowGrades] add withdrawn registration status #84

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MakefileHelper
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pull:

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

local_pull:
Expand All @@ -51,6 +53,8 @@ local_pull:

local_push:
rsync -azPq individual_summary_html/*.html ${REPORTS_DIRECTORY}/summary_html/
#FIXME: this should be generalized
# rsync -azPq individual_summary_html/*.json ${REPORTS_DIRECTORY}/seating/test3/
rsync -azPq individual_summary_html/*.json ${REPORTS_DIRECTORY}/seating/final_exam/

pull_test:
Expand Down
15 changes: 11 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,14 +1045,14 @@ void processcustomizationfile(const std::string &now_string,
s->setAudit();
s->addNote("AUDIT");
}
} else if (token == "withdraw") {
} else if (token == "withdrawn") {
std::vector<nlohmann::json> withdraw_list = itr.value();
for (std::size_t i = 0; i < withdraw_list.size(); i++) {
std::string username = withdraw_list[i];
Student *s = GetStudent(students,username);
assert (s != NULL);
assert (s->getWithdraw() == false);
s->setWithdraw();
assert (s->getWithdrawn() == false);
s->setWithdrawn();
s->addNote("LATE WITHDRAW");
}
} else if (token == "independentstudy") {
Expand Down Expand Up @@ -1245,7 +1245,14 @@ void load_student_grades(std::vector<Student*> &students) {
}
s->setRotatingSection(a);
} else if (token == "registration_type") {
// Skip this token for now
std::string type = j[token];
if (type == "withdrawn") s->setWithdrawn();
else if (type == "audit") s->setAudit();
else if (type == "staff") { }
else {
assert (type == "graded");
s->setGraded();
}
} else if (token == "default_allowed_late_days") {
int value = 0;
if (!j[token].is_null()) {
Expand Down
36 changes: 22 additions & 14 deletions output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ void start_table_output( bool /*for_instructor*/,
int counter = 0;
table.set(0,counter++,TableCell("ffffff","#"));
table.set(0,counter++,TableCell("ffffff","SECTION"));
table.set(0,counter++,TableCell("ffffff","reg type"));
if (DISPLAY_INSTRUCTOR_NOTES) {
table.set(0,counter++,TableCell("ffffff","part."));
table.set(0,counter++,TableCell("ffffff","under."));
Expand Down Expand Up @@ -677,9 +678,9 @@ void start_table_output( bool /*for_instructor*/,
table.set(0,counter++,TableCell("ffffff","INCORRECT POLLS"));

//Late days headers
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","ALLOWED LATE DAYS"));
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","USED LATE DAYS"));
student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","EXCUSED EXTENSIONS"));
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","ALLOWED LATE DAYS"));
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","USED LATE DAYS"));
//student_data.push_back(counter); table.set(0,counter++,TableCell("ffffff","EXCUSED EXTENSIONS"));
student_data.push_back(counter); table.set(0,counter++,TableCell(grey_divider));
}
}
Expand Down Expand Up @@ -754,8 +755,13 @@ void start_table_output( bool /*for_instructor*/,

std::string section_color = default_color;
std::string section_label = "";
std::string status = "";
if(!csv_mode) {
colorit_section2(this_student->getSection(), section_color, section_label);
if (validSection(this_student->getSection())) {
status = this_student->getRegistrationStatus();
if (status == "withdrawn") section_color = default_color;
}
}
else{
if (validSection(this_student->getSection())) {
Expand All @@ -765,8 +771,10 @@ void start_table_output( bool /*for_instructor*/,
section_label = this_student->getSection() + " (" + section_label + ")";
}
}
if (status != "graded") section_color = default_color;
assert (section_color.size()==6);
table.set(myrow,counter++,TableCell(section_color,section_label));
table.set(myrow,counter++,TableCell(default_color,status));

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

std::string color = coloritcolor(allowed,5,4,3,2,2);
table.set(myrow,counter++,TableCell(color,allowed,"",0,CELL_CONTENTS_VISIBLE,"right"));
int used = this_student->getUsedLateDays();
color = coloritcolor(allowed-used+2, 5+2, 3+2, 2+2, 1+2, 0+2);
table.set(myrow,counter++,TableCell(color,used,"",0,CELL_CONTENTS_VISIBLE,"right"));
int exceptions = this_student->getLateDayExceptions();
color = coloritcolor(exceptions,5,4,3,2,2);
table.set(myrow,counter++,TableCell(color,exceptions,"",0,CELL_CONTENTS_VISIBLE,"right"));
//std::string color = coloritcolor(allowed,5,4,3,2,2);
//table.set(myrow,counter++,TableCell(color,allowed,"",0,CELL_CONTENTS_VISIBLE,"right"));
//int used = this_student->getUsedLateDays();
//color = coloritcolor(allowed-used+2, 5+2, 3+2, 2+2, 1+2, 0+2);
//table.set(myrow,counter++,TableCell(color,used,"",0,CELL_CONTENTS_VISIBLE,"right"));
//int exceptions = this_student->getLateDayExceptions();
//color = coloritcolor(exceptions,5,4,3,2,2);
//table.set(myrow,counter++,TableCell(color,exceptions,"",0,CELL_CONTENTS_VISIBLE,"right"));
} else {
color="ffffff"; // default_color;
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
table.set(myrow,counter++,TableCell(color,""));
//table.set(myrow,counter++,TableCell(color,""));
//table.set(myrow,counter++,TableCell(color,""));
//table.set(myrow,counter++,TableCell(color,""));
}
table.set(myrow,counter++,TableCell(grey_divider));
}
Expand Down
3 changes: 2 additions & 1 deletion student.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Student::Student() {
// registration status
section = "null";
audit = false;
withdraw = false;
withdrawn = false;
graded = false;
independentstudy = false;

default_allowed_late_days = 0;
Expand Down
16 changes: 13 additions & 3 deletions student.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ class Student {
const std::string& getCourseSectionId() const { return course_section_id; }
int getRotatingSection() const { return rotating_section; }
bool getAudit() const { return audit; }
bool getWithdraw() const { return withdraw; }
bool getWithdrawn() const { return withdrawn; }
bool getGraded() const { return graded; }
bool getIndependentStudy() const { return independentstudy; }

std::string getRegistrationStatus() const {
if (audit) return "audit";
if (withdrawn) return "withdrawn";
if (graded) return "graded";
return "other";
}

// grade data
const ItemGrade& getGradeableItemGrade(GRADEABLE_ENUM g, int i) const;
std::string getZone(int i) const;
Expand Down Expand Up @@ -175,7 +183,8 @@ class Student {
void setCourseSectionId(const std::string &x) { course_section_id = x; }
void setRotatingSection(int x) { rotating_section = x; }
void setAudit() { audit = true; }
void setWithdraw() { withdraw = true; }
void setWithdrawn() { withdrawn = true; }
void setGraded() { graded = true; }
void setIndependentStudy() { independentstudy = true; }

// grade data
Expand Down Expand Up @@ -273,7 +282,8 @@ class Student {
std::string course_section_id;
int rotating_section;
bool audit;
bool withdraw;
bool withdrawn;
bool graded;
bool independentstudy;

// grade data
Expand Down
4 changes: 4 additions & 0 deletions zone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ int CountLefties(std::vector<Student*> &students,const std::string& lefty_file,
s->setLefty();
if (s->getExamRoom() != "") {
//std::cout << "ALREADY ASSIGNED ROOM " << user << std::endl;
} else if (s->getRegistrationStatus() != "graded") {
// skipping
} else if (s->overall() < GLOBAL_MIN_OVERALL_FOR_ZONE_ASSIGNMENT) {
//std::cout << "NOT ASSIGNING LEFTY " << user << std::endl;
} else {
Expand Down Expand Up @@ -389,6 +391,8 @@ void LoadExamSeatingFile(const std::string &zone_counts_filename,
already_zoned++;
} else if (!validSection(s->getSection())) {
not_reg++;
} else if (s->getRegistrationStatus() != "graded") {
not_reg++;
} else if (s->overall() < GLOBAL_MIN_OVERALL_FOR_ZONE_ASSIGNMENT) {
low_overall_grade++;
} else if (OmitSectionFromStats(s->getSection())) {
Expand Down
Loading