diff --git a/src/app.py b/src/app.py index 6614998..087103c 100644 --- a/src/app.py +++ b/src/app.py @@ -70,6 +70,10 @@ def index(): return render_template('index.html', uid = "Could not identify user. Are you logged in?") logs = answer_logger.getUserLogs(userId=userId, lookback_days=30) + + num_logs = len(logs) + num_correct = len([log for log in logs if str(log.correct_answer).lower() == 'true']) + exercise_builder = exercisebuilder.ExerciseBuilder(logs) model = exercise_builder.get_model() misconception_weights = model['misconception_weights'] @@ -111,7 +115,15 @@ def index(): # Now choose one of the top two misconceptions randomly max_misconception = random.choice(top_two_misconceptions) - return render_template('index.html',uid = getUserName(), misconception_weights = misconception_weights, misconception_count = misconception_count, max_misconception = max_misconception) + return render_template( + 'index.html', + uid=getUserName(), + misconception_weights=misconception_weights, + misconception_count=misconception_count, + max_misconception=max_misconception, + num_logs=num_logs, + num_correct=num_correct + ) @app.route('/ltl') def ltl(): diff --git a/src/templates/exercise.html b/src/templates/exercise.html index efef879..32bb06b 100644 --- a/src/templates/exercise.html +++ b/src/templates/exercise.html @@ -193,10 +193,6 @@
If you feel like this tutor cannot teach you any more about Linear Temporal Logic, - we ask that you complete this . -
diff --git a/src/templates/index.html b/src/templates/index.html index 5f705e5..06390af 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -25,12 +25,18 @@
+ You have answered {{ num_correct }} / {{ num_logs }} questions correctly in the last 30 days.
+
- Once you are familiar with the LTL syntax used by this tool, we recommend starting with - . + Make sure you're familiar with one of the LTL syntaxes supported by this tool. + Then, begin by generating a personalized exercise using the button below.
If you feel like this tutor cannot teach you any more about Linear Temporal Logic, or you - are done using this tool, we ask that you complete this . -
-