Skip to content

Commit

Permalink
add points field to Response model to allow overriding marks
Browse files Browse the repository at this point in the history
This is currently for use with negative scoring
  • Loading branch information
struan committed Sep 7, 2023
1 parent 7531a20 commit e5777dc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.3 on 2023-09-05 09:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("crowdsourcer", "0033_alter_question_question_type"),
]

operations = [
migrations.AddField(
model_name="historicalresponse",
name="points",
field=models.FloatField(
blank=True, help_text="overide marks for this response", null=True
),
),
migrations.AddField(
model_name="response",
name="points",
field=models.FloatField(
blank=True, help_text="overide marks for this response", null=True
),
),
]
4 changes: 4 additions & 0 deletions crowdsourcer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ class Response(models.Model):
last_update = models.DateTimeField(auto_now=True)
history = HistoricalRecords()

points = models.FloatField(
blank=True, null=True, help_text="overide marks for this response"
)

def get_absolute_url(self):
return reverse(
"authority_question_edit",
Expand Down

0 comments on commit e5777dc

Please sign in to comment.