Skip to content

Commit

Permalink
This reverts "Le superadmin peut paramétrer les textes d’une question…
Browse files Browse the repository at this point in the history
… QCM numératie"

This reverts commit c7a3086.
This reverts commit e84d038.
This reverts commit fb9cb8e.
  • Loading branch information
etienneCharignon committed Aug 8, 2024
1 parent f155ea6 commit e9b1143
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 119 deletions.
23 changes: 0 additions & 23 deletions app/admin/questions.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/javascripts/active_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//= require clipboard
//= require evaluation
//= require cgu
//=require form_question_script

//= require chartkick
//= require Chart.bundle
Expand Down
30 changes: 0 additions & 30 deletions app/assets/javascripts/form_question_script.js

This file was deleted.

11 changes: 1 addition & 10 deletions app/models/question.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
# frozen_string_literal: true

class Question < ApplicationRecord
validates :libelle, :nom_technique, :type, presence: true
validates :intitule, :libelle, :nom_technique, presence: true

CATEGORIE = %i[situation scolarite sante appareils].freeze
TYPES = %i[QuestionQcm QuestionSaisie QuestionSousConsigne].freeze
enum :type, TYPES.zip(TYPES.map(&:to_s)).to_h
enum :categorie, CATEGORIE.zip(CATEGORIE.map(&:to_s)).to_h, prefix: true

has_many :choix, lambda {
order(position: :asc)
}, foreign_key: :question_id,
dependent: :destroy

accepts_nested_attributes_for :choix, allow_destroy: true

acts_as_paranoid

def display_name
Expand Down
21 changes: 0 additions & 21 deletions app/views/admin/questions/_form.html.arb

This file was deleted.

22 changes: 0 additions & 22 deletions app/views/admin/questions/_show.html.arb

This file was deleted.

10 changes: 0 additions & 10 deletions config/locales/views/questions.yml

This file was deleted.

1 change: 0 additions & 1 deletion spec/factories/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
libelle { 'Question' }
nom_technique { 'question' }
intitule { 'Ma Question' }
type { 'QuestionQcm' }
end

factory :question_qcm do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/question_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rails_helper'

RSpec.describe Question, type: :model do
it { is_expected.to validate_presence_of :type }
it { is_expected.to validate_presence_of :intitule }
it { is_expected.to validate_presence_of :libelle }
it { is_expected.to validate_presence_of :nom_technique }
end

0 comments on commit e9b1143

Please sign in to comment.