From 7e984525c9fd745a6b3da054df48469ed0420d62 Mon Sep 17 00:00:00 2001 From: Miguel BarĂ£o Date: Mon, 15 Jul 2019 15:40:41 +0100 Subject: [PATCH] fix forgetting factor (was hardcoded) --- aprendizations/student.py | 11 ++++++----- demo/demo.yaml | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/aprendizations/student.py b/aprendizations/student.py index 3989467..8235070 100644 --- a/aprendizations/student.py +++ b/aprendizations/student.py @@ -12,11 +12,12 @@ logger = logging.getLogger(__name__) # ---------------------------------------------------------------------------- -# kowledge state of each student....?? +# kowledge state of a student # Contains: -# state - dict of topics with state of unlocked topics +# state - dict of unlocked topics and their levels # deps - access to dependency graph shared between students -# topic_sequence - list with the order of recommended topics +# topic_sequence - list with the recommended topic sequence +# current_topic - nameref of the current topic # ---------------------------------------------------------------------------- class StudentState(object): # ======================================================================= @@ -34,13 +35,13 @@ class StudentState(object): # ------------------------------------------------------------------------ # Updates the proficiency levels of the topics, with forgetting factor - # FIXME no dependencies are considered yet... # ------------------------------------------------------------------------ def update_topic_levels(self): now = datetime.now() for tref, s in self.state.items(): dt = now - s['date'] - s['level'] *= 0.98 ** dt.days # forgetting factor + forgetting_factor = self.deps.node[tref]['forgetting_factor'] + s['level'] *= forgetting_factor ** dt.days # forgetting factor # ------------------------------------------------------------------------ # Unlock topics whose dependencies are satisfied (> min_level) diff --git a/demo/demo.yaml b/demo/demo.yaml index ec92143..9a3ab67 100644 --- a/demo/demo.yaml +++ b/demo/demo.yaml @@ -4,7 +4,7 @@ title: Example database: students.db -# values applie to each topic, if undefined there +# values applied to each topic, if undefined there file: questions.yaml shuffle_questions: true choose: 6 @@ -27,3 +27,4 @@ topics: name: Sistema solar deps: - math + forgetting_factor: 0.1 -- libgit2 0.21.2