From d46107d0d5d15a7ecea22403274fdf2fd8f06c38 Mon Sep 17 00:00:00 2001 From: Jaeseok Kang <123261952+ziesski@users.noreply.github.com> Date: Wed, 13 Dec 2023 03:35:02 -0800 Subject: [PATCH] [Feature:RainbowGrades] Version conflict borderline (#69) The new change will now include version conflict in request of @KCony This is related to /Submitty/Submitty/issues/9674 And has connected PR in /Submitty/Submitty/pull/10063 If there is a conflict between TA graded version and Automated version, we call it version conflict. The current border-outline does not indicate if it is One corner case I can mention is that version conflict will also count canceled submission. Screen Shot 2023-12-13 at 3 33 52 AM Screen Shot 2023-12-13 at 2 43 27 AM --- main.cpp | 16 +++++++++++++--- output.cpp | 32 ++++++++++++++++++++++++++++++++ student.h | 21 +++++++++++++++------ table.cpp | 47 ++++++++++++++++++++++++++++++++++------------- table.h | 7 +++++-- 5 files changed, 99 insertions(+), 24 deletions(-) diff --git a/main.cpp b/main.cpp index f4ebd26..eb33b3d 100644 --- a/main.cpp +++ b/main.cpp @@ -1377,9 +1377,14 @@ void load_student_grades(std::vector &students) { event = "Bad"; s->set_event_bad_status(true); } - if (status_check == "Overridden") { - event = "Overridden"; - s->set_event_overridden(true); + std::string version_conflict = itr2->value("version_conflict", ""); + if (version_conflict == "true") { + event = "Version_conflict"; + s->set_event_version_conflict(true); + } + if (status_check == "Cancelled") { + event = "Cancelled"; + s->set_event_cancelled(true); } std::string inquiry = itr2->value("inquiry", ""); if ((inquiry != "None") && (inquiry != "Resolved") && (inquiry != "")) { @@ -1393,6 +1398,11 @@ void load_student_grades(std::vector &students) { event = "Extension"; s->set_event_extension(true); } + // Above itr2 status check, but in order of priority + if (status_check == "Overridden") { + event = "Overridden"; + s->set_event_overridden(true); + } s->setGradeableItemGrade_border(g,which,score,event,late_days_charged,other_note,status,late_day_exceptions,reason_for_exception); } } diff --git a/output.cpp b/output.cpp index deb3ef5..26015bd 100644 --- a/output.cpp +++ b/output.cpp @@ -1202,6 +1202,15 @@ void end_table(std::ofstream &ostr, bool for_instructor, Student *s) { { ostr << "\n"; ostr << "\n"; + ostr << "\n"; + ostr << ""; + ostr << ""; + ostr << "\n"; if (for_instructor || (s != NULL && s->get_event_academic_integrity())) { ostr << "\n"; @@ -1246,6 +1255,29 @@ void end_table(std::ofstream &ostr, bool for_instructor, Student *s) { ostr << ""; ostr << "\n"; } + if (for_instructor || (s != NULL && s->get_event_cancelled())) + { + ostr << "\n"; + ostr << ""; + ostr << ""; + ostr << "\n"; + } + if (for_instructor || (s != NULL && s->get_event_version_conflict())) + { + ostr << "\n"; + ostr << ""; + ostr << ""; + ostr << "\n"; + } if (for_instructor || (s != NULL && s->get_event_bad_status())) { ostr << "\n"; diff --git a/student.h b/student.h index e34f42e..21e322f 100644 --- a/student.h +++ b/student.h @@ -186,16 +186,23 @@ class Student { void academic_sanction(const std::string &gradeable, float penalty); + //set in order of priority - top to bottom void set_event_academic_integrity(bool value) {academic_integrity = value;} - void set_event_grade_inquiry(bool value) {grade_inquiry = value;} void set_event_overridden(bool value) {overridden = value;} - void set_event_bad_status(bool value) {bad_status = value;} void set_event_extension(bool value) {extension = value;} + void set_event_grade_inquiry(bool value) {grade_inquiry = value;} + void set_event_cancelled(bool value) {cancelled = value;} + void set_event_version_conflict(bool value) {version_conflict = value;} + void set_event_bad_status(bool value) {bad_status = value;} + + //bool in order of priority - top to bottom bool get_event_academic_integrity() {return academic_integrity;} - bool get_event_grade_inquiry() {return grade_inquiry;} bool get_event_overridden() {return overridden;} - bool get_event_bad_status() {return bad_status;} bool get_event_extension() {return extension;} + bool get_event_grade_inquiry() {return grade_inquiry;} + bool get_event_cancelled() {return cancelled;} + bool get_event_version_conflict() {return version_conflict;} + bool get_event_bad_status() {return bad_status;} // other grade-like data void setNumericID(const std::string& r_id) { numeric_id = r_id; } @@ -254,10 +261,12 @@ class Student { int current_allowed_late_days; int default_allowed_late_days; bool academic_integrity = false; - bool grade_inquiry = false; bool overridden = false; - bool bad_status = false; bool extension = false; + bool grade_inquiry = false; + bool version_conflict = false; + bool cancelled = false; + bool bad_status = false; // registration status std::string section; diff --git a/table.cpp b/table.cpp index 23926f4..e0e2d03 100644 --- a/table.cpp +++ b/table.cpp @@ -94,24 +94,35 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st rotate = 0; academic_integrity = ai; event = e; + if (reason != "") { hoverText = "class=\"hoverable-cell\" data-hover-text=\""+userName+" received a "+std::to_string(daysExtended)+" day extension due to "+reason+" on "+gID+"\" "; + } else { + hoverText = "class=\"hoverable-cell\" data-hover-text=\""+userName+" received a "+std::to_string(daysExtended)+" day extension without specified reason on "+gID+"\" "; } - else hoverText = ""; - if (event == "Bad"){ - bad_status = true; - override = inquiry = extension = false; - } else if ( event == "Overridden"){ + +// Bool in order of priority - top to bottom +// Don't think we need this logic, but leaving it as sort of assert + if (event == "Overridden"){ override = true; - bad_status = inquiry = extension = false; - } else if (event == "Open"){ - inquiry = true; - bad_status = override = extension = false; + bad_status = inquiry = extension = version_conflict = cancelled = false; } else if (event == "Extension"){ extension = true; - inquiry = bad_status = override = false; + inquiry = bad_status = override = version_conflict = cancelled = false; + } else if (event == "Open"){ + inquiry = true; + bad_status = override = extension = version_conflict = cancelled = false; + } else if (event == "Cancelled"){ + cancelled = true; + inquiry = bad_status = override = extension = version_conflict = false; + } else if (event == "Version_conflict"){ + version_conflict = true; + inquiry = bad_status = override = extension = cancelled = false; + } else if (event == "Bad"){ + bad_status = true; + override = inquiry = extension = version_conflict = cancelled = false; } else { - inquiry = bad_status = override = extension = false; + inquiry = bad_status = override = extension = version_conflict = cancelled = false; } } @@ -132,11 +143,21 @@ std::ostream& operator<<(std::ostream &ostr, const TableCell &c) { outline = "outline:4px solid #0066e0; outline-offset: -4px;"; } else if (c.inquiry){ outline = "outline:4px dashed #1cfc03; outline-offset: -4px;"; + } else if (c.cancelled){ + outline = "outline:4px dashed #0a0a0a; outline-offset: -4px;"; + } else if (c.version_conflict){ + outline = "outline:4px dashed #fc0303; outline-offset: -4px;"; } else if (c.bad_status){ outline = "outline:4px solid #fc0303; outline-offset: -4px;"; } - - ostr << "
"; + ostr << ""; + ostr << ""; + ostr << " Border-Outline is ranked from top to bottom
"; + ostr << "Higher ranked outline will over-write
"; + ostr << "
"; + ostr << ""; + ostr << ""; + ostr << " Cancelled submission "; + ostr << "
"; + ostr << ""; + ostr << ""; + ostr << " Version conflict = version conflict between
"; + ostr << "           TA graded version and Active version
"; + ostr << "
"; + + if (c.extension){ + ostr << ""; + } else { + ostr << ""; + + } + if (0) { //rotate == 90) { ostr << "

"; } diff --git a/table.h b/table.h index ad07ac4..8159cd2 100644 --- a/table.h +++ b/table.h @@ -32,11 +32,14 @@ class TableCell { std::string data; std::string event; int late_days_used; + // Bool in order of priority - top to bottom bool academic_integrity = false; - bool inquiry = false; - bool bad_status = false; bool override = false; bool extension = false; + bool inquiry = false; + bool cancelled = false; + bool version_conflict = false; + bool bad_status = false; std::string hoverText = ""; std::string align; enum CELL_CONTENTS_STATUS visible;