Skip to content

Commit

Permalink
Add support for 'worksheet' type (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcutler authored Jun 20, 2018
1 parent 409b0bc commit 623026d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions MakefileHelper
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion gradeable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand All @@ -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"; }
Expand Down
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 623026d

Please sign in to comment.