Beispiel #1
0
    def import_questions(self):
        self.questions = {}

        for i, question in enumerate(self.root.findall('question'), 1):
            q = AdjudicatorFeedbackQuestion(
                tournament=self.tournament, seq=i, text=question.text,
                name=question.get('name'), reference=slugify(question.get('name')[:50]),
                from_adj=question.get('from-adjudicators') == 'true', from_team=question.get('from-teams') == 'true',
                answer_type=question.get('type'), required=False,
            )
            q.save()
            self.questions[question.get('id')] = q
Beispiel #2
0
 def add_default_feedback_questions(tournament):
     agree = AdjudicatorFeedbackQuestion(
         tournament=tournament, seq=2, required=True,
         text=_("Did you agree with their decision?"), name=_("Agree?"),
         reference="agree", from_adj=True, from_team=True,
         answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_BOOLEAN_SELECT)
     agree.save()
     comments = AdjudicatorFeedbackQuestion(
         tournament=tournament, seq=3, required=False,
         text=_("Comments"), name=_("Comments"),
         reference="comments", from_adj=True, from_team=True,
         answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_LONGTEXT)
     comments.save()
Beispiel #3
0
 def add_default_feedback_questions(tournament):
     agree = AdjudicatorFeedbackQuestion(
         tournament=tournament, seq=2, required=True,
         text=_("Did you agree with their decision?"), name=_("Agree?"),
         reference="agree", from_adj=True, from_team=True,
         answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_BOOLEAN_SELECT)
     agree.save()
     comments = AdjudicatorFeedbackQuestion(
         tournament=tournament, seq=3, required=False,
         text=_("Comments"), name=_("Comments"),
         reference="comments", from_adj=True, from_team=True,
         answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_LONGTEXT)
     comments.save()