Skip to content

Commit

Permalink
🏗️ Créé une méthode d'instance pour savoir si une question est de typ…
Browse files Browse the repository at this point in the history
…e sous-consigne
  • Loading branch information
marouria committed Nov 4, 2024
1 parent 0699c99 commit e656e97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions app/models/import_question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def cree_question
ActiveRecord::Base.transaction do
intialise_question
cree_transcription(:intitule, @data[4], @data[3])
cree_transcription(:modalite_reponse, @data[6], @data[5]) unless sous_consigne?
cree_transcription(:modalite_reponse, @data[6], @data[5]) unless @question.sous_consigne?
update_champs_specifiques
end
@question
Expand Down Expand Up @@ -90,8 +90,4 @@ def extrait_colonnes_reponses(reponse)
end
end
end

def sous_consigne?
@type == 'QuestionSousConsigne'
end
end
4 changes: 4 additions & 0 deletions app/models/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def json_audio_fields
json
end

def sous_consigne?
type == 'QuestionSousConsigne'
end

private

def audio_url
Expand Down

0 comments on commit e656e97

Please sign in to comment.