diff --git a/recopytex/database/filesystem/loader.py b/recopytex/database/filesystem/loader.py index 27d8130..c402cc8 100644 --- a/recopytex/database/filesystem/loader.py +++ b/recopytex/database/filesystem/loader.py @@ -214,6 +214,25 @@ class CSVLoader(Loader): return pd.concat(scores) + def get_exam_scores(self, exams=[]): + """ Get scores for all question of the exam + + :param exams: list or dataframe of exams metadatas (need origin field to find the csv) + + :example: + >>> loader = CSVLoader("./test_config.yml") + >>> exams = loader.get_exams(["Tribe1"]) + >>> scores = loader.get_exam_scores(exams) + >>> scores.columns + Index(['term', 'exam', 'date', 'exercise', 'question', 'competence', 'theme', + 'comment', 'score_rate', 'is_leveled', 'origin', 'exam_id', + 'question_id', 'student_name', 'score'], + dtype='object') + """ + questions = self.get_exam_questions(exams) + return self.get_questions_scores(questions) + + def get_students(self, tribes=[]): """Get student list