Skip to content

Commit

Permalink
Edit question label when option set levels are present
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jan 30, 2024
1 parent d8eaafd commit 97f6063
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/forms/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ def to_xls
# Modify question name
name_to_push = "#{q.code}_#{level_name}"

# Modify question label
# NOTE: the question "label" (what NEMO calls "name") will have to be manually edited in XLS by the user so that it makes grammatical sense. The below line simply makes the label unique
label_to_push = "#{q.name}_#{level_name}"

# push a row for each level
questions.row(row_index + l_index).push(type_to_push, name_to_push, q.name, q.required.to_s, conditions_to_push, constraints_to_push, choice_filter)
questions.row(row_index + l_index).push(type_to_push, name_to_push, label_to_push, q.required.to_s, conditions_to_push, constraints_to_push, choice_filter)

# define the choice_filter cell for the following row, e.g, "state=${selected_state}"
choice_filter = "#{level_name}=${#{name_to_push}}"
Expand Down

0 comments on commit 97f6063

Please sign in to comment.