Skip to content

Commit

Permalink
[scorecards] change question score to float
Browse files Browse the repository at this point in the history
allows for negative points having decimal points, and prevents rounding
issues with some points being less than 0.5 and hence rounded to 0.
  • Loading branch information
struan committed Nov 8, 2023
1 parent 4a440f3 commit d0bc64c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions scoring/migrations/0017_alter_planquestionscore_score.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.21 on 2023-11-08 10:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('scoring', '0016_alter_planquestion_questiongroup'),
]

operations = [
migrations.AlterField(
model_name='planquestionscore',
name='score',
field=models.FloatField(default=0),
),
]
2 changes: 1 addition & 1 deletion scoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ class PlanQuestionScore(ScoreFilterMixin, models.Model):
PlanQuestion, on_delete=models.CASCADE, related_name="questions"
)
answer = models.TextField(null=True, default="")
score = models.SmallIntegerField(default=0)
score = models.FloatField(default=0)
max_score = models.PositiveSmallIntegerField(default=0)
notes = models.TextField(null=True, default="")
evidence_links = models.TextField(null=True, default="")
Expand Down

0 comments on commit d0bc64c

Please sign in to comment.