diff --git a/output.cpp b/output.cpp index 0585c3b..53fa8bf 100644 --- a/output.cpp +++ b/output.cpp @@ -138,6 +138,16 @@ int convertMajor(const std::string &major) { else return 10; } +std::tuple getCourseDetails() { + std::ifstream i("/var/local/submitty/courses/f24/sample/reports/base_url.json"); + nlohmann::json j; + i >> j; + std::string baseUrl = j["base_url"].get(); + std::string term = j["term"].get(); + std::string course = j["course"].get(); + return {baseUrl, term, course}; +} + // ========================================================== class Color { @@ -638,11 +648,15 @@ void start_table_output( bool /*for_instructor*/, if (g != GRADEABLE_ENUM::NOTE) { student_data.push_back(counter); } + auto [base_url, semester, course] = getCourseDetails(); std::string gradeable_id = GRADEABLES[g].getID(j); std::string gradeable_name = ""; + std::string fullUrl = base_url + "courses/" + semester + "/" + course + "/gradeable/" + gradeable_id; + if (GRADEABLES[g].hasCorrespondence(gradeable_id)) { gradeable_name = GRADEABLES[g].getCorrespondence(gradeable_id).second; //gradeable_name = spacify(gradeable_name); + gradeable_name = "" + gradeable_name + "   "; } if (gradeable_name == "") gradeable_name = "future "