From 623026dbd03c874a9651d9e1866072527c955dd3 Mon Sep 17 00:00:00 2001 From: Barb Cutler Date: Wed, 20 Jun 2018 07:39:43 -0400 Subject: [PATCH] Add support for 'worksheet' type (#2) --- MakefileHelper | 3 +++ gradeable.h | 3 ++- main.cpp | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MakefileHelper b/MakefileHelper index 3675029..d842339 100644 --- a/MakefileHelper +++ b/MakefileHelper @@ -137,6 +137,9 @@ exam: compile reading: compile ./process_grades.out by_reading +worksheet: compile + ./process_grades.out by_worksheet + project: compile ./process_grades.out by_project diff --git a/gradeable.h b/gradeable.h index e21ab50..2baccea 100644 --- a/gradeable.h +++ b/gradeable.h @@ -9,7 +9,7 @@ enum class GRADEABLE_ENUM { HOMEWORK, ASSIGNMENT, PROBLEM_SET, QUIZ, TEST, EXAM, - EXERCISE, LECTURE_EXERCISE, READING, LAB, RECITATION, + EXERCISE, LECTURE_EXERCISE, READING, WORKSHEET, LAB, RECITATION, PROJECT, PARTICIPATION, NOTE, NONE }; @@ -24,6 +24,7 @@ inline std::string gradeable_to_string(const GRADEABLE_ENUM &g) { if (g == GRADEABLE_ENUM::EXERCISE) { return "EXERCISE"; } if (g == GRADEABLE_ENUM::LECTURE_EXERCISE) { return "LECTURE_EXERCISE"; } if (g == GRADEABLE_ENUM::READING) { return "READING"; } + if (g == GRADEABLE_ENUM::WORKSHEET) { return "WORKSHEET"; } if (g == GRADEABLE_ENUM::LAB) { return "LAB"; } if (g == GRADEABLE_ENUM::RECITATION) { return "RECITATION"; } if (g == GRADEABLE_ENUM::PROJECT) { return "PROJECT"; } diff --git a/main.cpp b/main.cpp index f258109..a13ee83 100644 --- a/main.cpp +++ b/main.cpp @@ -292,6 +292,7 @@ bool string_to_gradeable_enum(const std::string &s, GRADEABLE_ENUM &return_value if (s2 == "exercise") { return_value = GRADEABLE_ENUM::EXERCISE; return true; } if (s2 == "lecture_exercise") { return_value = GRADEABLE_ENUM::LECTURE_EXERCISE; return true; } if (s2 == "reading") { return_value = GRADEABLE_ENUM::READING; return true; } + if (s2 == "worksheet") { return_value = GRADEABLE_ENUM::WORKSHEET; return true; } if (s2 == "lab") { return_value = GRADEABLE_ENUM::LAB; return true; } if (s2 == "recitation") { return_value = GRADEABLE_ENUM::RECITATION; return true; } if (s2 == "project") { return_value = GRADEABLE_ENUM::PROJECT; return true; } @@ -1688,7 +1689,7 @@ int main(int argc, char* argv[]) { } else { std::cerr << "UNKNOWN SORT OPTION " << GLOBAL_sort_order << std::endl; - std::cerr << " Usage: " << argv[0] << " [ by_overall | by_name | by_section | by_zone | by_iclicker | by_lab | by_exercise | by_reading | by_hw | by_test | by_exam | by_test_and_exam ]" << std::endl; + std::cerr << " Usage: " << argv[0] << " [ by_overall | by_name | by_section | by_zone | by_iclicker | by_lab | by_exercise | by_reading | by_worksheet | by_hw | by_test | by_exam | by_test_and_exam ]" << std::endl; exit(1); } }