-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,6 +255,7 @@ def edit_grade(course_id): | |
|
||
# ToDo: assign course ects when applicant registers for course | ||
# temporary quickfix | ||
import math | ||
This comment has been minimized.
Sorry, something went wrong. |
||
for applicant in course.course_list: | ||
attendance = course.get_course_attendance(course.id, applicant.id) | ||
if attendance.ects_points == 0: | ||
|
@@ -268,7 +269,7 @@ def edit_grade(course_id): | |
attendance = course.get_course_attendance(course.id, applicant.id) | ||
grade_field = getattr(form, f'grade_{applicant.id}', None) | ||
if grade_field and grade_field.data != attendance.grade: | ||
attendance.grade = grade_field.data | ||
attendance.grade = math.ceil(grade_field.data) | ||
This comment has been minimized.
Sorry, something went wrong.
urvdp
Member
|
||
changes = True | ||
|
||
ects_field_name = f'ects_{applicant.id}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
Manages the mapping between abstract entities and concrete database models. | ||
""" | ||
import enum | ||
import math | ||
This comment has been minimized.
Sorry, something went wrong. |
||
from enum import Enum | ||
from binascii import hexlify | ||
from datetime import datetime, timedelta | ||
|
@@ -104,7 +105,8 @@ class Attendance(db.Model): | |
|
||
ects_points = db.Column(db.Integer, nullable=False, default=0) | ||
# internal representation of the grade is in % | ||
grade = db.Column(db.Integer, nullable=True) # TODO store grade encrypted | ||
grade = db.Column(db.Float, nullable=True) # TODO store grade encrypted | ||
This comment has been minimized.
Sorry, something went wrong.
urvdp
Member
|
||
|
||
# if a student only wants 'bestanden' instead of the grade value, is set to true | ||
hide_grade = db.Column(db.Boolean, nullable=False, default=False) | ||
|
||
|
Style: import declarations are positioned at the beginning of the .py file