lib/surveyor_gui/models/response_set_methods.rb
#return a hash of dependent questions.
return a hash of dependent questions.
return a hash of dependent questions .
def all_dependencies(question_ids = nil)
            arr = dependencies(question_ids).partition{|d| d.is_met?(self) }
            {:show => arr[0].map{|d| d.question_group_id.nil? ? (d.question.is_mandatory? ? nil : "q_#{d.question_id}") : "g_#{d.question_group_id}"},
             :show_mandatory => arr[0].map{|d| d.question_group_id.nil? ? (d.question.is_mandatory? ? "q_#{d.question_id}" : nil) : "g_#{d.question_group_id}"},
             :hide => arr[1].map{|d| d.question_group_id.nil? ? "q_#{d.question_id}" : "g_#{d.question_group_id}"}}
      end
def all_dependencies ( question_ids = nil ) arr = dependencies ( question_ids ) . partition { | d | d . is_met? ( self ) } { :show => arr [ 0 ] . map { | d | d . question_group_id . nil? ? ( d . question . is_mandatory? ? nil : "q_#{d.question_id}" ) : "g_#{d.question_group_id}" } , :show_mandatory => arr [ 0 ] . map { | d | d . question_group_id . nil? ? ( d . question . is_mandatory? ? "q_#{d.question_id}" : nil ) : "g_#{d.question_group_id}" } , :hide => arr [ 1 ] . map { | d | d . question_group_id . nil? ? "q_#{d.question_id}" : "g_#{d.question_group_id}" } } end
return a hash of dependent questions.
return a hash of dependent questions .
question_ids