|
|
""" Checks that the user_input is not exceeding the question's time limit.
Only used in the context of survey sessions. """
for user_input in self:
if user_input.is_session_answer and user_input.survey_id.session_question_start_time:
start_time = user_input.survey_id.session_question_start_time
time_limit = user_input.survey_id.session_question_id.time_limit
user_input.question_time_limit_reached = user_input.survey_id.session_question_id.is_time_limited and \
fields.Datetime.now() >= start_time + relativedelta(seconds=time_limit)
else:
user_input.question_time_limit_reached = False
|
|