Finished client result API.

Need to work on adjustment user codes and server email notifications.
This commit is contained in:
2021-11-30 18:06:24 +00:00
parent 475fdfcca7
commit 9b038dc8e4
15 changed files with 710 additions and 54 deletions

View File

@ -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):

View File

@ -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: