Finished client result API.
Need to work on adjustment user codes and server email notifications.
This commit is contained in:
@ -47,14 +47,8 @@ class UpdateAccountForm(FlaskForm):
|
||||
|
||||
class CreateTest(FlaskForm):
|
||||
start_date = DateField('Start Date', format="%Y-%m-%d", validators=[InputRequired()], default = date.today() )
|
||||
time_options = [
|
||||
('none', 'None'),
|
||||
('60', '1 hour'),
|
||||
('90', '1 hour 30 minutes'),
|
||||
('120', '2 hours')
|
||||
]
|
||||
expiry_date = DateField('Expiry Date', format="%Y-%m-%d", validators=[InputRequired()], default = date.today() + timedelta(days=1) )
|
||||
time_limit = SelectField('Time Limit', choices=time_options)
|
||||
time_limit = SelectField('Time Limit')
|
||||
dataset = SelectField('Question Dataset')
|
||||
|
||||
class UploadDataForm(FlaskForm):
|
||||
|
@ -14,7 +14,7 @@ class Test:
|
||||
self._id = _id
|
||||
self.start_date = start_date
|
||||
self.expiry_date = expiry_date
|
||||
self.time_limit = None if time_limit == 'none' or time_limit == '' else time_limit
|
||||
self.time_limit = None if time_limit == 'none' or time_limit == '' else int(time_limit)
|
||||
self.creator = creator
|
||||
self.dataset = dataset
|
||||
|
||||
@ -88,7 +88,7 @@ class Test:
|
||||
test['expiry_date'] = self.expiry_date
|
||||
updated.append('expiry date')
|
||||
if not self.time_limit == '' and self.time_limit is not None:
|
||||
test['time_limit'] = self.time_limit
|
||||
test['time_limit'] = int(self.time_limit)
|
||||
updated.append('time limit')
|
||||
output = ''
|
||||
if len(updated) == 0:
|
||||
|
Reference in New Issue
Block a user