From c21f51f0b988a498b0fc48686145ebd9a18b22e3 Mon Sep 17 00:00:00 2001 From: Barb Cutler Date: Thu, 12 Dec 2024 12:56:10 -0500 Subject: [PATCH] add withdrawn status --- MakefileHelper | 4 ++++ main.cpp | 15 +++++++++++---- output.cpp | 36 ++++++++++++++++++++++-------------- student.cpp | 3 ++- student.h | 16 +++++++++++++--- zone.cpp | 4 ++++ 6 files changed, 56 insertions(+), 22 deletions(-) diff --git a/MakefileHelper b/MakefileHelper index 7cdb6c7..d90e791 100644 --- a/MakefileHelper +++ b/MakefileHelper @@ -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: @@ -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: diff --git a/main.cpp b/main.cpp index 70ed2f3..c81c12d 100644 --- a/main.cpp +++ b/main.cpp @@ -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 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") { @@ -1245,7 +1245,14 @@ void load_student_grades(std::vector &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()) { diff --git a/output.cpp b/output.cpp index 0585c3b..73cce94 100644 --- a/output.cpp +++ b/output.cpp @@ -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.")); @@ -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)); } } @@ -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())) { @@ -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(); @@ -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)); } diff --git a/student.cpp b/student.cpp index 05e6ed0..300acc6 100644 --- a/student.cpp +++ b/student.cpp @@ -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; diff --git a/student.h b/student.h index 21e322f..6f19600 100644 --- a/student.h +++ b/student.h @@ -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; @@ -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 @@ -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 diff --git a/zone.cpp b/zone.cpp index 89a3303..3abfd3a 100644 --- a/zone.cpp +++ b/zone.cpp @@ -119,6 +119,8 @@ int CountLefties(std::vector &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 { @@ -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())) {