Skip to content

Commit

Permalink
Merge branch 'main' into rainbow_version
Browse files Browse the repository at this point in the history
  • Loading branch information
powe97 authored Jun 12, 2024
2 parents dbdd6d6 + 9c67247 commit de7c2ba
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 105 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr_title_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Submitty PR Title Check'
on:
pull_request:
# check when PR
# * is created,
# * title is edited, and
# * new commits are added (to ensure failing title blocks merging)
types: [opened, reopened, edited, synchronize]

jobs:
title-check:
runs-on: ubuntu-latest
steps:
#
# pull request titles format rules here:
# https://submitty.org/developer/how_to_contribute#how-to-make-a-pull-request-pr-to-submitty
#
# [<TYPE>:<MODULE>] <SUBJECT>
#
- uses: submitty/action-pr-title@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
*.log
*.out
*.synctex.gz
/.idea/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/RainbowGrades.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constants_and_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Student;
// What sections to display in the output table
extern bool DISPLAY_INSTRUCTOR_NOTES;
extern bool DISPLAY_EXAM_SEATING;
extern bool DISPLAY_MOSS_DETAILS;
extern bool DISPLAY_ACADEMIC_SANCTION_DETAILS;
extern bool DISPLAY_FINAL_GRADE;
extern bool DISPLAY_GRADE_SUMMARY;
extern bool DISPLAY_GRADE_DETAILS;
Expand Down
89 changes: 75 additions & 14 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ std::string BONUS_FILE;

bool DISPLAY_INSTRUCTOR_NOTES = false;
bool DISPLAY_EXAM_SEATING = false;
bool DISPLAY_MOSS_DETAILS = false;
bool DISPLAY_ACADEMIC_SANCTION_DETAILS = false;
bool DISPLAY_FINAL_GRADE = false;
bool DISPLAY_GRADE_SUMMARY = false;
bool DISPLAY_GRADE_DETAILS = false;
Expand All @@ -152,8 +152,8 @@ void PrintExamRoomAndZoneTable(const std::string &id, nlohmann::json &mj, Studen


bool by_overall(const Student* s1, const Student* s2) {
float s1_overall = s1->overall_b4_moss();
float s2_overall = s2->overall_b4_moss();
float s1_overall = s1->overall_b4_academic_sanction();
float s2_overall = s2->overall_b4_academic_sanction();

if (s1 == AVERAGE_STUDENT_POINTER) return true;
if (s2 == AVERAGE_STUDENT_POINTER) return false;
Expand Down Expand Up @@ -374,8 +374,8 @@ void preprocesscustomizationfile(const std::string &now_string,
DISPLAY_INSTRUCTOR_NOTES = true;
} else if (token == "exam_seating") {
DISPLAY_EXAM_SEATING = true;
} else if (token == "moss_details") {
DISPLAY_MOSS_DETAILS = true;
} else if (token == "academic_sanction_details") {
DISPLAY_ACADEMIC_SANCTION_DETAILS = true;
} else if (token == "final_grade") {
DISPLAY_FINAL_GRADE = true;
} else if (token == "grade_summary") {
Expand Down Expand Up @@ -766,8 +766,8 @@ void preprocesscustomizationfile(const std::string &now_string,
DISPLAY_INSTRUCTOR_NOTES = true;
} else if (token == "exam_seating") {
DISPLAY_EXAM_SEATING = true;
} else if (token == "moss_details") {
DISPLAY_MOSS_DETAILS = true;
} else if (token == "academic_sanction_details" || token == "moss_details") {
DISPLAY_ACADEMIC_SANCTION_DETAILS = true;
} else if (token == "final_grade") {
DISPLAY_FINAL_GRADE = true;
} else if (token == "grade_summary") {
Expand All @@ -776,12 +776,26 @@ void preprocesscustomizationfile(const std::string &now_string,
DISPLAY_GRADE_DETAILS = true;
} else if (token == "display_rank_to_individual"){
DISPLAY_RANK_TO_INDIVIDUAL = true;
} else if (token == "display_benchmark") {
continue;
} else if (token == "benchmark_percent") {
continue;
} else if (token == "section") {
continue;
} else if (token == "messages") {
continue;
} else if (token == "warning") {
continue;
} else if (token == "manual_grade"){
continue;
} else if (token == "final_cutoff"){
continue;
} else {
std::cout << "OOPS " << token << std::endl;
exit(0);
}
}

//std::cout << "4" << std::endl;

// Set Display Benchmark
Expand Down Expand Up @@ -1074,7 +1088,7 @@ void processcustomizationfile(const std::string &now_string,
Student *s = GetStudent(students,username);
//std::cout << "USERNAME " << username << std::endl;
assert (s != NULL);
s->mossify(hw,penalty);
s->academic_sanction(hw,penalty);
s->set_event_academic_integrity(true);
}
} else if (token == "final_cutoff") {
Expand Down Expand Up @@ -1364,17 +1378,33 @@ void load_student_grades(std::vector<Student*> &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 != "")) {
assert(inquiry == "Open");
event = "Open";
s->set_event_grade_inquiry(true);
}
s->setGradeableItemGrade_border(g,which,score,event,late_days_charged,other_note,status);
int late_day_exceptions = itr2->value("late_day_exceptions",0);
std::string reason_for_exception = itr2->value("reason_for_exception","");
if (late_day_exceptions > 0) {
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);
}
}

Expand Down Expand Up @@ -1723,6 +1753,35 @@ void loadAllowedLateDays(std::vector<Student*> &students) {
}
}

void SaveExtensionReports(const std::vector<Student*> &students) {
system ("mkdir -p student_extension_reports");
for (size_t i=0;i<students.size();i++) {
std::vector<std::tuple<ItemGrade,std::tuple<GRADEABLE_ENUM,int> > > gradeablesWithExtensions = students[i]->getItemsWithExceptions();
std::string username = students[i]->getUserName();
std::ofstream student_ostr("student_extension_reports/"+username+".html");
assert (student_ostr.good());
if (gradeablesWithExtensions.size() == 0) {
continue;
}
student_ostr << "<h3> Excused Absence Extensions for: " << username << "</h3>" << std::endl;
student_ostr << "<table cellpadding=5 style=\"border:1px solid #aaaaaa; background-color:#ffffff;\">" << std::endl;
student_ostr << "<tr><td>Gradeable</td><td align=center>Days Extended</td><td align=center>Reason</td><td></td></tr>" << std::endl;
for (size_t i2=0;i2<gradeablesWithExtensions.size();i2++) {
ItemGrade item = std::get<0>(gradeablesWithExtensions[i2]);
GRADEABLE_ENUM g = std::get<0>(std::get<1>(gradeablesWithExtensions[i2]));
int index = std::get<1>(std::get<1>(gradeablesWithExtensions[i2]));
std::string gradeable_id = GRADEABLES[g].getID(index);
std::string gradeable_name = "";
if (GRADEABLES[g].hasCorrespondence(gradeable_id)) {
gradeable_name = GRADEABLES[g].getCorrespondence(gradeable_id).second;
}
student_ostr << "<tr><td>" << gradeable_name << "</td><td align=center>"
<< item.getLateDayExceptions() << "</td><td align=center>"
<< item.getReasonForException() << "</td></tr>" << std::endl;
}
student_ostr << "</table>" << std::endl;
}
}

int main(int argc, char* argv[]) {

Expand All @@ -1744,6 +1803,8 @@ int main(int argc, char* argv[]) {
LoadPolls(students);
SavePollReports(students);

SaveExtensionReports(students);

loadAllowedLateDays(students);

// ======================================================================
Expand All @@ -1766,7 +1827,7 @@ int main(int argc, char* argv[]) {

DISPLAY_INSTRUCTOR_NOTES = false;
DISPLAY_EXAM_SEATING = true;
DISPLAY_MOSS_DETAILS = false;
DISPLAY_ACADEMIC_SANCTION_DETAILS = false;
DISPLAY_FINAL_GRADE = false;
DISPLAY_GRADE_SUMMARY = false;
DISPLAY_GRADE_DETAILS = false;
Expand Down
Loading

0 comments on commit de7c2ba

Please sign in to comment.