def comparison(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), XAPIObject.answer(comparison.answer1), XAPIObject.answer(comparison.answer2), ]), # grouping is course + assignment + answer1 + answer2 grouping=ActivityList([ XAPIObject.assignment(comparison.assignment), XAPIObject.course(comparison.assignment.course) ]) ) if comparison.attempt_uuid and current_comparison: context.context_activities.parent.append(XAPIObject.comparison_attempt(comparison, current_comparison)) cls._add_sis_data(context, comparison.assignment.course) return context
def comparison(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), XAPIObject.answer(comparison.answer1), XAPIObject.answer(comparison.answer2), ]), # grouping is course + assignment + answer1 + answer2 grouping=ActivityList([ XAPIObject.assignment(comparison.assignment), XAPIObject.course(comparison.assignment.course) ]) ) if comparison.attempt_uuid and current_comparison: context.context_activities.parent.append(XAPIObject.comparison_attempt(comparison, current_comparison)) cls._add_sis_data(context, comparison.assignment.course) return context
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
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
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
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
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
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