Skip to content

Conversation

@BiancaNecula
Copy link
Contributor

@BiancaNecula BiancaNecula commented Oct 10, 2020

Description

The preliminary score is calculated with penalty for being late.
Total score is now just preliminary score +/- review score.

Fixes #257

Testing

  • UI

Checklist

  • I have labeled this PR with the relevant Type labels
  • Tests (if they apply)

@BiancaNecula BiancaNecula added enhancement New feature or request student Bug/Feature for student worklfow labels Oct 10, 2020
Comment on lines +149 to +151
preliminary_score = models.DecimalField(
max_digits=5, decimal_places=2, null=True
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to save it as a field. Usually, in a database we do not write redundant data - total_score is written the same way and we should change it. We could just use calculate_preliminary_score with a @property annotation (so that it can be used in a template), provided we move it in the submission model. Maybe we could also add caching (we have cachetools) - with a TTL type cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request student Bug/Feature for student worklfow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants