All basic question types

This commit is contained in:
Charlotte Van Petegem 2025-04-27 00:13:20 +02:00
parent 3e1e5618ca
commit 4fe218166f
Signed by: chvp
SSH key fingerprint: SHA256:s9rb8jBVfdahqWHuBAcHCBP1wmj4eYQXZfqgz4H3E9E
51 changed files with 760 additions and 92 deletions

View file

@ -0,0 +1,7 @@
require "test_helper"
class QuestionsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View file

@ -0,0 +1,7 @@
require "test_helper"
class SectionsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View file

@ -0,0 +1,7 @@
require "test_helper"
class SessionsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View file

@ -1,9 +1,20 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
question: one
data: MyText
two:
question: two
data: MyText
# == Schema Information
#
# Table name: answers
#
# id :integer not null, primary key
# data :text
# created_at :datetime not null
# updated_at :datetime not null
# question_id :integer not null
#
# Indexes
#
# index_answers_on_question_id (question_id)
#
# Foreign Keys
#
# question_id (question_id => questions.id)
#

View file

@ -1,11 +1,151 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
section: one
text: MyText
type: 1
# == Schema Information
#
# Table name: questions
#
# id :integer not null, primary key
# answer_kind :integer not null
# public_asset_path :string
# question_kind :integer default("simple"), not null
# text :text not null
# created_at :datetime not null
# updated_at :datetime not null
# section_id :integer not null
#
# Indexes
#
# index_questions_on_section_id (section_id)
#
# Foreign Keys
#
# section_id (section_id => sections.id)
#
sport_bashir:
section: sport
text: In welke straat groeide Bashir Abdi op?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
two:
section: two
text: MyText
type: 1
sport_club:
section: sport
text: In welke sport versloeg een Gentse club ooit een team uit Oxford?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
sport_sabbe:
section: sport
text: Waar ligt de Karel Sabbeberg?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
sport_aagent:
section: sport
text: Wat is de meest recente beker van Belgie die AA Gent gewonnen heeft waar Tomas niet in het stadion zat?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
sport_hockey:
section: sport
text: ""
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:video] %>
public_asset_path: "/videos/els_en_geert.mp4"
sport_busschaert:
section: sport
text: Neem een foto op het bankje van Matthias Busschaert (en wandel een rondje rond de Watersportbaan).
answer_kind: <%= Question.answer_kinds[:image] %>
question_kind: <%= Question.question_kinds[:simple] %>
sport_klimmen:
section: sport
text: Bemachtig een foto van Charlotte terwijl ze aan het klimmen is zonder dat ze het merkt.
answer_kind: <%= Question.answer_kinds[:image] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_haven:
section: life
text: Wat moet je 24u voor het binnenkomen van de haven in Gent doen?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_pendelaars:
section: life
text: Hoeveel pendelaars komen dagelijks van buiten Gent in Gent werken?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_repetitieruimtes:
section: life
text: Hoeveel repetitieruimtes en ateliers waren er vroeger in de Leopoldskazerne?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_stam:
section: life
text: Op welke tegel ligt de Leopoldskazerne in het STAM?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_bollekesschool:
section: life
text: Wat is de bollekesschool?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_langst:
section: life
text: Wie woont er al het langst in Gent?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
life_haven_oprichting:
section: life
text: ""
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:video] %>
public_asset_path: "/videos/stijn.mp4"
politics_regenpijpen:
section: politics
text: Welke kleur hebben de regenpijpen van het stadhuis en waarom?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_schepenen:
section: politics
text: Verbind de schepenen en hun bevoegdheden.
answer_kind: <%= Question.answer_kinds[:politicians] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_anneleen:
section: politics
text: Hoeveel keer is Anneleen al op haar gezicht gegaan (fysiek en metaforisch)?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_langste:
section: politics
text: Wie was de langste burgemeester van Gent?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_langst:
section: politics
text: Wie was er het langst burgemeester van Gent?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_nazi:
section: politics
text: Welke Gentse burgemeester is niet opgenomen in de officiële lijst van Gentse burgemeesters?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>
politics_jorg:
section: politics
text: Hoeveel stemmen kwam Jorg te kort om in de provincieraad te zetelen?
answer_kind: <%= Question.answer_kinds[:simple] %>
question_kind: <%= Question.question_kinds[:simple] %>

View file

@ -1,9 +1,23 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
title: MyText
description: MyText
# == Schema Information
#
# Table name: sections
#
# id :integer not null, primary key
# description :text not null
# title :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
sport:
title: Sport
description: Gent is een sportieve stad, dus daarom enkele vragen daarover.
two:
title: MyText
description: MyText
life:
title: Leven, werken en wonen
description: In Gent moet er ook geleefd worden.
politics:
title: Politiek
description: De Gentse politiek is interessanter dan de Duffelse!

View file

@ -1,3 +1,21 @@
# == Schema Information
#
# Table name: answers
#
# id :integer not null, primary key
# data :text
# created_at :datetime not null
# updated_at :datetime not null
# question_id :integer not null
#
# Indexes
#
# index_answers_on_question_id (question_id)
#
# Foreign Keys
#
# question_id (question_id => questions.id)
#
require "test_helper"
class AnswerTest < ActiveSupport::TestCase

View file

@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: questions
#
# id :integer not null, primary key
# answer_kind :integer not null
# public_asset_path :string
# question_kind :integer default("simple"), not null
# text :text not null
# created_at :datetime not null
# updated_at :datetime not null
# section_id :integer not null
#
# Indexes
#
# index_questions_on_section_id (section_id)
#
# Foreign Keys
#
# section_id (section_id => sections.id)
#
require "test_helper"
class QuestionTest < ActiveSupport::TestCase

View file

@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: sections
#
# id :integer not null, primary key
# description :text not null
# title :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
require "test_helper"
class SectionTest < ActiveSupport::TestCase