missing_steps.add(step)
questions = Question.objects.filter(seminar=seminar, status=3)
+ missing_step4 = None
for question in questions:
if question.weight:
total += question.weight
- answer = Answer.objects.filter(question=question, status=3, user=user,
- validated=True, treated=True)
+ answer = Answer.objects.filter(question=question, status=3, user=user)
if answer:
+ answer = answer[0]
+ if answer and answer.validated and answer.treated:
progress += question.weight
else:
- missing_steps.add('4')
+ # import pdb;pdb.set_trace()
+ if answer and not answer.treated and not missing_step4 == '4':
+ missing_step4 = '4.5'
+ else:
+ missing_step4 = '4'
+ if missing_step4:
+ missing_steps.add(missing_step4)
if seminar.quiz:
quiz_weight = 3
elif progress == 100 and validated and delta_sec >= 0 and self.template_name == 'teleforma/seminar_detail.html':
messages.info(self.request, _("You have successfully terminated all steps of your e-learning seminar. You can now download your training testimonial below."))
elif len(missing_steps) == 1:
- print missing_steps
- if missing_steps == set('4'):
+ if missing_steps == set(['4.5']):
messages.warning(self.request,
_("Yours submissions have been submitted. They will be processed within 48 hours."))
else: