Commit fe865706 by Chris Dodge

fix some things

parent dbdefa4d
......@@ -166,7 +166,12 @@ def create_exam_attempt(exam_id, user_id, external_id):
raise StudentExamAttemptAlreadyExistsException(err_msg)
attempt = ProctoredExamStudentAttempt.create_exam_attempt(exam_id, user_id, external_id)
attempt = ProctoredExamStudentAttempt.create_exam_attempt(
exam_id,
user_id,
'', # student name is TBD
external_id
)
return attempt.id
......
......@@ -89,6 +89,8 @@ class ProctoredExamStudentAttempt(TimeStampedModel):
# in case there is an option to opt-out
taking_as_proctored = models.BooleanField()
student_name = models.CharField(max_length=255)
class Meta:
""" Meta class for this Django model """
db_table = 'proctoring_proctoredexamstudentattempt'
......@@ -100,7 +102,7 @@ class ProctoredExamStudentAttempt(TimeStampedModel):
return self.started_at and not self.completed_at
@classmethod
def create_exam_attempt(cls, exam_id, user_id, external_id):
def create_exam_attempt(cls, exam_id, user_id, student_name, external_id):
"""
Create a new exam attempt entry for a given exam_id and
user_id.
......@@ -109,6 +111,7 @@ class ProctoredExamStudentAttempt(TimeStampedModel):
return cls.objects.create(
proctored_exam_id=exam_id,
user_id=user_id,
student_name=student_name,
external_id=external_id
)
......
......@@ -17,7 +17,7 @@
var currentTime = (new Date()).getTime();
var lastFetched = this.get('lastFetched').getTime();
var totalSeconds = this.get('time_remaining_seconds') - (currentTime - lastFetched) / 1000;
return (totalSeconds > 0) ? totalSeconds : 0;
return totalSeconds;
},
getFormattedRemainingTime: function () {
var totalSeconds = this.getRemainingSeconds();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment