Beispiel #1
0
    def answer_attachment(cls, answer, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment answer
            parent=ActivityList([XAPIObject.answer(answer)]),
            # grouping is course + assignment + assignment question
            grouping=ActivityList([
                XAPIObject.assignment_question(answer.assignment),
                XAPIObject.assignment(answer.assignment),
                XAPIObject.course(answer.assignment.course)
            ]))

        cls._add_sis_data(context, answer.assignment.course)
        return context
Beispiel #2
0
    def answer_attempt(cls, answer, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment question
            parent=ActivityList([
                XAPIObject.assignment_question(answer.assignment)
            ]),
            # grouping is course + assignment
            grouping=ActivityList([
                XAPIObject.assignment(answer.assignment),
                XAPIObject.course(answer.assignment.course)
            ])
        )

        cls._add_sis_data(context, answer.assignment.course)
        return context
Beispiel #3
0
    def answer(cls, answer, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment question
            parent=ActivityList(
                [XAPIObject.assignment_question(answer.assignment)]),
            # grouping is course + assignment
            grouping=ActivityList([
                XAPIObject.assignment(answer.assignment),
                XAPIObject.course(answer.assignment.course)
            ]))

        if answer.attempt_uuid:
            context.context_activities.parent.append(
                XAPIObject.answer_attempt(answer))

        cls._add_sis_data(context, answer.assignment.course)
        return context