Class: Qe::QuestionGrid
- Inherits:
-
Element
- Object
- ActiveRecord::Base
- Element
- Qe::QuestionGrid
show all
- Defined in:
- app/models/qe/question_grid.rb
Instance Method Summary
collapse
Methods inherited from Element
#all_elements, #duplicate, max_label_length, #position, #ptemplate, #question?, #required?, #reuseable?, #set_position
Instance Method Details
#has_response?(answer_sheet = nil) ⇒ Boolean
19
20
21
|
# File 'app/models/qe/question_grid.rb', line 19
def has_response?(answer_sheet = nil)
elements.any? {|e| e.has_response?(answer_sheet)}
end
|
#num_cols ⇒ Object
13
14
15
16
17
|
# File 'app/models/qe/question_grid.rb', line 13
def num_cols
num = cols.to_s.split(';').length
num = 1 if num == 0
num
end
|
#questions ⇒ Object
23
24
25
26
27
28
29
30
31
|
# File 'app/models/qe/question_grid.rb', line 23
def questions
ret_val = first_level_questions
elements.each do |e|
if e.respond_to?(:questions)
ret_val += e.questions
end
end
ret_val
end
|