Пример #1
0
    def submit(self, submission):
        """
        The parent block is handling a student submission, including a new answer for this
        block. Update accordingly.
        """
        self.student_input = submission[0]['value'].strip()
        self.save()

        if sub_api:
            # Also send to the submissions API:
            item_key = self.student_item_key
            # Need to do this by our own ID, since an answer can be referred to multiple times.
            item_key['item_id'] = self.name
            sub_api.create_submission(item_key, self.student_input)

        log.info(u'Answer submitted for`{}`: "{}"'.format(self.name, self.student_input))
        return self.get_results()
Пример #2
0
    def submit(self, submission):
        """
        The parent block is handling a student submission, including a new answer for this
        block. Update accordingly.
        """
        self.student_input = submission[0]['value'].strip()
        self.save()

        if sub_api:
            # Also send to the submissions API:
            item_key = self.student_item_key
            # Need to do this by our own ID, since an answer can be referred to multiple times.
            item_key['item_id'] = self.name
            sub_api.create_submission(item_key, self.student_input)

        log.info(u'Answer submitted for`{}`: "{}"'.format(self.name, self.student_input))
        return self.get_results()