fix error
This commit is contained in:
parent
67cd34ab27
commit
59af75e50a
|
@ -144,7 +144,7 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
|||
end
|
||||
|
||||
when ::SurveyQuestion::Check
|
||||
if !@spreadsheet.row(row)[index*2].nil?
|
||||
if !@spreadsheet.row(row)[index*2].nil? && @spreadsheet.row(row)[index*2] != " "
|
||||
@answer_model[question.id.to_s] = @spreadsheet.row(row)[index*2].split("\"").select.each_with_index { |str, i| i.odd? }
|
||||
end
|
||||
|
||||
|
@ -216,7 +216,6 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -224,30 +223,6 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
|||
|
||||
end #end row
|
||||
|
||||
# @start_row = 2
|
||||
# @survey.survey_answers.destroy
|
||||
# @survey_questions.each_with_index do |question,index|
|
||||
# case question.type
|
||||
# when ::SurveyQuestion::Radio, ::SurveyQuestion::Select
|
||||
# (@start_row..(@start_row + question.survey_question_options.count - 1)).each do |row|
|
||||
# (1..@spreadsheet.row(row)[index*2 + 1].to_i).each do
|
||||
# @answer_model = @survey.survey_answers.new
|
||||
# @answer_model[question.id.to_s] = @spreadsheet.row(row)[index*2]
|
||||
# @answer_model.save!
|
||||
# end
|
||||
# end
|
||||
# when ::SurveyQuestion::Check
|
||||
# (@start_row..(@start_row + question.survey_question_options.count - 1)).each do |row|
|
||||
# (1..@spreadsheet.row(row)[index*2 + 1].to_i).each do
|
||||
# @answer_model = @survey.survey_answers.new
|
||||
# @answer_model[question.id.to_s] = [ @spreadsheet.row(row)[index*2] ]
|
||||
# @answer_model.save!
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
# end
|
||||
# end
|
||||
|
||||
redirect_to panel_survey_back_end_surveys_url, :notice => :success
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue