Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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():
Expand Down
4 changes: 0 additions & 4 deletions src/templates/exercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ <h4 class="card-title">What Next?</h4>
<a href="/exercise/generate" class="btn btn-lg btn-primary btn-block">Generate another Exercise.</a>
<br>
<hr>

<p class="card-text"> If you feel like this tutor cannot teach you any more about Linear Temporal Logic,
we ask that you complete this <a href="/entryexitticket/exit"> <button class="btn btn-primary"> final exercise</button></a>.
</p>
</div>
</div>
</div>
Expand Down
17 changes: 10 additions & 7 deletions src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,30 @@
<div class="container">
{% include 'navbar.html' %}

<div class="container justify-content-right mt-3 mb-3">
<p class="text-muted">
You have answered {{ num_correct }} / {{ num_logs }} questions correctly in the last 30 days.<br>
</p>
</div>

{% if misconception_count is not defined or misconception_count < threshold %}
<div class="card-body bg-light">
<h4 class="card-title">Getting Started with this tool?</h4>
<p class="card-text">
Once you are familiar with the <a href="/ltl">LTL syntax</a> used by this tool, we recommend starting with
<a href="/entryexitticket/entry"> <button class="btn btn-primary"> this exercise </button> </a>.
Make sure you're familiar with one of the <a href="/ltl">LTL syntaxes</a> supported by this tool.
Then, begin by generating a personalized exercise using the button below.
</p>
</div>
{% elif misconception_count > threshold %}
<div class="p-3 mb-2 mt-2">
{% include max_misconception %}
</div>

<div>
<p class="card-text"> 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 <a href="/entryexitticket/exit"> <button class="btn btn-primary"> final exercise</button></a>.
</p>
</div>
{% endif %}




<div class="container mt-4">
<div class="jumbotron text-center">
<div class="d-flex justify-content-center">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/version.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1