Conversation
sahilkamboj3
commented
Dec 29, 2020
- Fixed bug to show 100% when student gets all answers correct
- Also, modified test_points_percent_full() and test_unreachable_points_percent_full() tests
…ct_flow_submissions Pulling for upstream master.
local_settings_example.py
Outdated
| # DATABASES = { | ||
| # "default": { | ||
| # "ENGINE": "django.db.backends.postgresql", | ||
| # "NAME": "relate", | ||
| # "USER": "sahilkamboj", | ||
| # "PASSWORD": 'lovebread3', | ||
| # "HOST": '127.0.0.1', | ||
| # "PORT": '5432', | ||
| # } | ||
| # } |
course/flow.py
Outdated
| # Rounding to larger than 100% will break the percent bars on the | ||
| # flow results page. |
There was a problem hiding this comment.
This comment can probably be removed.
course/flow.py
Outdated
| # Rounding to larger than 100% will break the percent bars on the | ||
| # flow results page. |
There was a problem hiding this comment.
Did you take any measures to prevent the percent bars being fed numbers larger than 100 (e.g. due to rounding)?
| import jsonfield.fields | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): |
There was a problem hiding this comment.
Where did this migration come from?
|
Thanks for working on this! I would argue that your changes don't really address the issue, as the rounded values could very well still add up to a value greater than 100. Observe:
Each round to 1. Suppose 2 (instead of 100) is the upper limit. Individually, the sum is 1.8. Rounded, they sum to 3. |
inducer
left a comment
There was a problem hiding this comment.
Thanks! (And sorry again about the epic delay... life got busy in a hurry.) This looks great. My only request is to add comments explaining why we're doing the dodgy-looking multiplication, so that folks who read this code in the future will have an easier time understanding. After that, it's ready to land.
| {% if grade_info.total_points_percent < 100.001 %} | ||
| {# otherwise we'll have trouble drawing the bar #} | ||
| <div class="progress"> | ||
| {% with points_percent=grade_info.points_percent|mul:0.9999 %} |
There was a problem hiding this comment.
Add a template {# ... #} comment on why that's here.
| {% endif %} | ||
| </p> | ||
| <div class="progress"> | ||
| {% with fully_correct_percent=grade_info.fully_correct_percent|mul:0.9999 %} |
There was a problem hiding this comment.
Add a template {# ... #} comment on why that's here.
| {% endif %} | ||
| </p> | ||
| <div class="progress"> | ||
| {% with optional_fully_correct_percent=grade_info.optional_fully_correct_percent|mul:0.9999 %} |
There was a problem hiding this comment.
Add a template {# ... #} comment on why that's here.