Skip to content

Commit

Permalink
✨ Personnalise l'algo du remplissage des colonnes réponses d'un expor…
Browse files Browse the repository at this point in the history
…t en fonction du nombre de paramètre pour le type de réponse
  • Loading branch information
marouria committed Nov 19, 2024
1 parent eb79ad9 commit 0a9ca30
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/models/import_export/questions/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,24 @@ def remplis_champs_clic_dans_texte
def ajoute_choix(choix, index)
columns = %w[intitule nom_technique type_choix audio]
columns.each_with_index do |col, i|
@sheet[0, 9 + (index * 4) + i] = "choix_#{index + 1}_#{col}"
@sheet[@ligne, 9 + (index * 4) + i] = choix.send(col)
@sheet[0, 9 + (index * columns.size) + i] = "choix_#{index + 1}_#{col}"
@sheet[@ligne, 9 + (index * columns.size) + i] = choix.send(col)
end
end

def ajoute_saisies(reponse, index)
columns = %w[intitule nom_technique type_choix]
columns.each_with_index do |col, i|
@sheet[0, 11 + (index * 3) + i] = "reponse_#{index + 1}_#{col}"
@sheet[@ligne, 11 + (index * 3) + i] = reponse.send(col)
@sheet[0, 11 + (index * columns.size) + i] = "reponse_#{index + 1}_#{col}"
@sheet[@ligne, 11 + (index * columns.size) + i] = reponse.send(col)
end
end

def ajoute_reponses(choix, index)
columns = %w[nom_technique position_client type_choix illustration]
columns.each_with_index do |col, i|
@sheet[0, 9 + (index * 4) + i] = "reponse_#{index + 1}_#{col}"
@sheet[@ligne, 9 + (index * 4) + i] = choix.send(col)
@sheet[0, 9 + (index * columns.size) + i] = "reponse_#{index + 1}_#{col}"
@sheet[@ligne, 9 + (index * columns.size) + i] = choix.send(col)
end
end
end
Expand Down

0 comments on commit 0a9ca30

Please sign in to comment.