#NEWLINE# def set_answer( self , ans ) : #NEWLINE# #INDENT# if ( self . question . question_type == 'INT' ) : #NEWLINE# #INDENT# self . int_field = ans #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . question . question_type == 'TXT' ) : #NEWLINE# #INDENT# self . txt_field = ans #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . question . question_type == 'AFD' ) : #NEWLINE# #INDENT# self . txt_field = ans #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . question . question_type == 'BOOL' ) : #NEWLINE# #INDENT# self . bool_field = ans #NEWLINE# if ( self . bool_field and len ( self . question . options . all ( ) ) ) : #NEWLINE# #INDENT# self . option = self . question . options . all ( ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . option = None #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . question . question_type == 'CHOICE' ) : #NEWLINE# #INDENT# self . option = ans