From 098c89a31c80463b1780042a8f50fcf2d710c770 Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:17:30 -0400 Subject: [PATCH] ITEC -> ITWS --- src/GenerateHtml.cpp | 70 +++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/src/GenerateHtml.cpp b/src/GenerateHtml.cpp index be4d819..b45a9df 100644 --- a/src/GenerateHtml.cpp +++ b/src/GenerateHtml.cpp @@ -163,6 +163,8 @@ std::string fix_course_ids(std::string course) { course[4] = '-'; if(course.substr(0,3) == "STS") { course[3] = 'O'; + } else if(course.substr(0,4) == "ITEC") { + course.replace(0,4,"ITWS"); } return course; } @@ -185,34 +187,48 @@ bool create_dir_if_not_exist(const fs::path& path) { Json::Value get_data(const Json::Value& data, std::string course_id) { course_id[4] = '-'; - if(course_id.substr(0,3) != "STS") { - return data[course_id]; - } - const auto& stso = data[course_id]; - course_id[3] = 'S'; - const auto& stss = data[course_id]; - course_id[3] = 'H'; - const auto& stsh = data[course_id]; - - Json::Value out; - - for(const auto& key : stsh.getMemberNames()) { - out[key] = stsh[key]; - if(out[key].isObject()) - out[key]["prefix"] = "STSH"; - } - for(const auto& key : stss.getMemberNames()) { - out[key] = stss[key]; - if(out[key].isObject()) - out[key]["prefix"] = "STSS"; - } - for(const auto& key : stso.getMemberNames()) { - out[key] = stso[key]; - if(out[key].isObject()) - out[key]["prefix"] = "STSO"; - } + if(course_id.substr(0,4) == "STSO") { + std::cerr<<"course id: "<