Exemplo n.º 1
0
    def assignment_question(cls, assignment, **kwargs):
        context = cls.basic(**kwargs)

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

        cls._add_sis_data(context, assignment.course)
        return context
Exemplo n.º 2
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
Exemplo n.º 3
0
    def assignment_question(cls, assignment, **kwargs):
        context = cls.basic(**kwargs)

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

        cls._add_sis_data(context, assignment.course)
        return context
Exemplo n.º 4
0
    def self_evaluation_attempt(cls, answer_comment, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment
            parent=ActivityList([
                XAPIObject.self_evaluation_question(answer_comment.answer.assignment)
            ]),
            # grouping is course
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        cls._add_sis_data(context, answer_comment.answer.assignment.course)
        return context
Exemplo n.º 5
0
    def comparison_attempt(cls, comparison, current_comparison, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is comparison question + criterion
            parent=ActivityList([
                XAPIObject.comparison_question(comparison.assignment, current_comparison)
            ]),
            # grouping is course + assignment + answer1 + answer2
            grouping=ActivityList([
                XAPIObject.assignment(comparison.assignment),
                XAPIObject.course(comparison.assignment.course)
            ])
        )

        cls._add_sis_data(context, comparison.assignment.course)
        return context
Exemplo n.º 6
0
    def self_evaluation_attempt(cls, answer_comment, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment
            parent=ActivityList([
                XAPIObject.self_evaluation_question(answer_comment.answer.assignment)
            ]),
            # grouping is course
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        cls._add_sis_data(context, answer_comment.answer.assignment.course)
        return context
Exemplo n.º 7
0
    def comparison_attempt(cls, comparison, current_comparison, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is comparison question + criterion
            parent=ActivityList([
                XAPIObject.comparison_question(comparison.assignment, current_comparison)
            ]),
            # grouping is course + assignment + answer1 + answer2
            grouping=ActivityList([
                XAPIObject.assignment(comparison.assignment),
                XAPIObject.course(comparison.assignment.course)
            ])
        )

        cls._add_sis_data(context, comparison.assignment.course)
        return context
Exemplo n.º 8
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
Exemplo n.º 9
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
Exemplo n.º 10
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
Exemplo n.º 11
0
    def self_evaluation_response(cls, answer_comment, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is self-evaulation question
            parent=ActivityList([
                XAPIObject.self_evaluation_question(answer_comment.answer.assignment),
                XAPIObject.answer(answer_comment.answer)
            ]),
            # grouping is course + assignment + answer
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        if answer_comment.attempt_uuid:
            context.context_activities.parent.append(XAPIObject.self_evaluation_attempt(answer_comment))

        cls._add_sis_data(context, answer_comment.answer.assignment.course)
        return context
Exemplo n.º 12
0
    def evaluation_response(cls, answer_comment, evaluation_number, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment
            parent=ActivityList([
                XAPIObject.evaluation_question(answer_comment.answer.assignment, evaluation_number),
                XAPIObject.answer(answer_comment.answer)
            ]),
            # grouping is course
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        if answer_comment.attempt_uuid and evaluation_number:
            context.context_activities.parent.append(XAPIObject.evaluation_attempt(answer_comment, evaluation_number))

        cls._add_sis_data(context, answer_comment.answer.assignment.course)
        return context
Exemplo n.º 13
0
    def self_evaluation_response(cls, answer_comment, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is self-evaulation question
            parent=ActivityList([
                XAPIObject.self_evaluation_question(answer_comment.answer.assignment),
                XAPIObject.answer(answer_comment.answer)
            ]),
            # grouping is course + assignment + answer
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        if answer_comment.attempt_uuid:
            context.context_activities.parent.append(XAPIObject.self_evaluation_attempt(answer_comment))

        cls._add_sis_data(context, answer_comment.answer.assignment.course)
        return context
Exemplo n.º 14
0
    def evaluation_response(cls, answer_comment, evaluation_number, **kwargs):
        context = cls.basic(**kwargs)

        context.context_activities = ContextActivities(
            # parent is assignment
            parent=ActivityList([
                XAPIObject.evaluation_question(answer_comment.answer.assignment, evaluation_number),
                XAPIObject.answer(answer_comment.answer)
            ]),
            # grouping is course
            grouping=ActivityList([
                XAPIObject.assignment(answer_comment.answer.assignment),
                XAPIObject.course(answer_comment.answer.assignment.course)
            ])
        )

        if answer_comment.attempt_uuid and evaluation_number:
            context.context_activities.parent.append(XAPIObject.evaluation_attempt(answer_comment, evaluation_number))

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