Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 3
0
    def add_defaults(self):
        default_questions = []

        if self.tournament.pref('feedback_introduction'):
            default_scale_info = AdjudicatorFeedbackQuestion(
                text=self.tournament.pref('feedback_introduction'), seq=0,
                answer_type='comment', # Custom type just for print display
                required=True, from_team=True, from_adj=True
            )
            default_questions.append(default_scale_info.serialize())

        default_scale_question = AdjudicatorFeedbackQuestion(
            text=_("Overall Score"), seq=0,
            answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_INTEGER_SCALE,
            required=True, from_team=True, from_adj=True,
            min_value=self.tournament.pref('adj_min_score'),
            max_value=self.tournament.pref('adj_max_score')
        )
        default_questions.append(default_scale_question.serialize())

        return default_questions
Ejemplo n.º 4
0
    def add_defaults(self):
        default_questions = []

        if self.tournament.pref('feedback_introduction'):
            default_scale_info = AdjudicatorFeedbackQuestion(
                text=self.tournament.pref('feedback_introduction'),
                seq=0,
                answer_type='comment',  # Custom type just for print display
                required=True,
                from_team=True,
                from_adj=True,
            )
            default_questions.append(default_scale_info.serialize())

        default_scale_question = AdjudicatorFeedbackQuestion(
            text=_("Overall Score"),
            seq=0,
            answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_INTEGER_SCALE,
            required=True,
            from_team=True,
            from_adj=True,
            min_value=self.tournament.pref('adj_min_score'),
            max_value=self.tournament.pref('adj_max_score'),
        )
        default_questions.append(default_scale_question.serialize())

        return default_questions
Ejemplo n.º 5
0
    def add_defaults(self):
        t = self.get_tournament()
        default_questions = []

        if t.pref('feedback_introduction'):
            default_scale_info = AdjudicatorFeedbackQuestion(
                text=t.pref('feedback_introduction'), seq=0,
                answer_type='comment', # Custom type just for print display
                required=True, from_team=True, from_adj=True
            )
            default_questions.append(self.question_to_json(default_scale_info))

        default_scale_question = AdjudicatorFeedbackQuestion(
            text='Overall Score', seq=0,
            answer_type=AdjudicatorFeedbackQuestion.ANSWER_TYPE_INTEGER_SCALE,
            required=True, from_team=True, from_adj=True,
            min_value=t.pref('adj_min_score'),
            max_value=t.pref('adj_max_score')
        )
        default_questions.append(self.question_to_json(default_scale_question))

        return default_questions
Ejemplo n.º 6
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()