lib/modules/pivot_tables.rb
# Filters out only multiple choice questions from Section 3,
# except those multiple choice questions, which are set up to use
# a detaiuls field to enter a numeric value.
Filters out only multiple choice questions from Section 3,
except those multiple choice questions, which are set up to use
a detaiuls field to enter a numeric value.
Filters out only multiple choice questions from Section 3 except those multiple choice questions which are set up to use a detaiuls field to enter a numeric value .
def multi_answer_answers_rel(questions_rel)
      MultiAnswer.
        from('pt_multi_answer_answers_by_user_view multi_answers').joins(
          'JOIN (' + questions_rel.to_sql + ') questions' +
          " ON multi_answers.question_id = questions.id AND questions.answer_type_type = 'MultiAnswer'"
        ).
        where('NOT details_field') 
    end
def multi_answer_answers_rel ( questions_rel ) MultiAnswer . from ( 'pt_multi_answer_answers_by_user_view multi_answers' ) . joins ( 'JOIN (' + questions_rel . to_sql + ') questions' + " ON multi_answers.question_id = questions.id AND questions.answer_type_type = 'MultiAnswer'" ) . where ( 'NOT details_field' ) end
Filters out only multiple choice questions from Section 3,
except those multiple choice questions, which are set up to use
a detaiuls field to enter a numeric value.
Filters out only multiple choice questions from Section 3 except those multiple choice questions which are set up to use a detaiuls field to enter a numeric value .
# this to exclude the "exact" etc pseudo-numeric questions
questions_rel