append_forms question instance answer request request view self Questi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
append_forms(question, instance=answer, request=request, view=self)
'''
QuestionExtender(question, data, files, instance, request, view=self).extend_question()
'''
class QuestionExtender(object):
def __init__(self, question, data=None, files=None, instance=None, request=None, view=None):
self.question = question
self.data = data
self.files = files
self.instance = instance
self.request = request
self.view = view
'''
def extend_math_question(self):
question = self.question
question.form = QuestionAnswerMathForm(
question,
exam_event=self.view.object
data=self.data,
files=self.files,
instance=self.instance
)