Commit 2dd11a22 authored by BrunoMeyer's avatar BrunoMeyer
Browse files

#218: Fix bug in courses analysis

When more than one course name is related to an unique course code, it will break the csv conversion module (and possible the web interface).
To solve this, before we verify if the 'disciplina_nome' attribute in json will be a list. If it is, the names are concatenated into an only string name.
parent 1e5b8e57
Pipeline #23573 passed with stage
in 4 minutes and 10 seconds
......@@ -359,6 +359,12 @@ class Course(Analysis):
course_dict = {}
course_dict["disciplina_codigo"] = course
course_dict["disciplina_nome"] = self.analysis["courses"][course]
# If the course code is related to more than one name,
# concatenate these names into an unique string
if type(course_dict["disciplina_nome"]) != str:
new_course_name = " | ".join(list(course_dict["disciplina_nome"]))
course_dict["disciplina_nome"] = new_course_name
# quantidade de matriculas
count = self.analysis["general_count_submission"][course]
course_dict["qtd_alunos"] = count
Subproject commit ed867dec652a96b89565a4060cb10eee61188a85
Subproject commit 29636bb0e9db796669a6a9e6a2dec8e9876f9afb
......@@ -127,8 +127,9 @@ class CourseConversor:
return vector_data
raise Exception("A graph data cannot be converted: {}".format(
raise Exception(
"A graph data cannot be converted: {}".format(graph_name))
def get_header(self, keys_from_instances=True, keys_from_list=True):
# Get only the first level of course path (subdirectories)
keys_set = set()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment