From d86b134f32e6270cd5ba5d0fe23c78097c2a935b Mon Sep 17 00:00:00 2001 From: Patrick Bassner Date: Tue, 27 Aug 2024 13:51:18 +0200 Subject: [PATCH] fix mastery calculation --- app/pipeline/chat/course_chat_pipeline.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/pipeline/chat/course_chat_pipeline.py b/app/pipeline/chat/course_chat_pipeline.py index 17aca74a..5c00bf10 100644 --- a/app/pipeline/chat/course_chat_pipeline.py +++ b/app/pipeline/chat/course_chat_pipeline.py @@ -232,26 +232,22 @@ def get_competency_list() -> list: regarding their progress overall or in a specific area. A competency has the following attributes: name, description, taxonomy, soft due date, optional, and mastery threshold. - The response may include metrics for each competency, such as progress and mastery (0%-100%). + The response may include metrics for each competency, such as progress and mastery (0% - 100%). These are system-generated. - The judgment of learning (JOL) values indicate the self-reported confidence by the student (0-5, 5 star). - The object describing it also indicates the system-computed confidence at the time when the student + The judgment of learning (JOL) values indicate the self-reported mastery by the student (0 - 5, 5 star). + The object describing it also indicates the system-computed mastery at the time when the student added their JoL assessment. """ self.callback.in_progress("Reading competency list ...") if not dto.metrics or not dto.metrics.competency_metrics: return dto.course.competencies competency_metrics = dto.metrics.competency_metrics - weight = 2.0 / 3.0 return [ { "info": competency_metrics.competency_information.get(comp, None), "exercise_ids": competency_metrics.exercises.get(comp, []), "progress": competency_metrics.progress.get(comp, 0), - "mastery": ( - (1 - weight) * competency_metrics.progress.get(comp, 0) - + weight * competency_metrics.confidence.get(comp, 0) - ), + "mastery": get_mastery(competency_metrics.progress.get(comp, 0), competency_metrics.confidence.get(comp, 0)), "judgment_of_learning": ( competency_metrics.jol_values.get[comp].json() if competency_metrics.jol_values