Skip to content

Commit

Permalink
WIP routes wizard logic
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerldixon committed Dec 17, 2024
1 parent 32a854c commit d02756a
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 7 deletions.
14 changes: 14 additions & 0 deletions app/controllers/routes_into_teaching/steps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ class StepsController < ApplicationController

layout "registration"

def completed
@yaml = YAML.load_file(Rails.root.join('config/values/routes_into_teaching.yml'))
@answers = session[:routes_into_teaching]

@results = @yaml["routes"].select do |route|
next false if route["matches"].nil? || route["matches"].empty?

route["matches"].all? do |match_rule|
match_rule["answer"] == "*" ||
match_rule["answer"] == @answers[match_rule["question"]]
end
end
end

private

def noindex?
Expand Down
4 changes: 2 additions & 2 deletions app/models/routes_into_teaching/steps/undergraduate_degree.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module RoutesIntoTeaching::Steps
class UndergraduateDegree < GITWizard::Step
attribute :has_undergraduate_degree
attribute :undergraduate_degree

validates :has_undergraduate_degree, presence: true
validates :undergraduate_degree, presence: true

def options
option_struct = Struct.new(:answer, :text, keyword_init: true)
Expand Down
4 changes: 2 additions & 2 deletions app/models/routes_into_teaching/steps/unqualified_teacher.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module RoutesIntoTeaching::Steps
class UnqualifiedTeacher < GITWizard::Step
attribute :has_worked_as_unqualified_teacher
attribute :unqualified_teacher

validates :has_worked_as_unqualified_teacher, presence: true
validates :unqualified_teacher, presence: true

def seen?
false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% @page_title = "Do you have an undergraduate degree?" %>

<%= f.govuk_collection_radio_buttons :has_undergraduate_degree, @wizard.find_current_step.options, :answer, :text,
<%= f.govuk_collection_radio_buttons :undergraduate_degree, @wizard.find_current_step.options, :answer, :text,
legend: { tag: "h1", text: @page_title },
hint: { text: "You'll find routes into teaching based on your circumstances" }
%>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% @page_title = "Have you worked as an unqualified teacher?" %>

<%= f.govuk_collection_radio_buttons :has_worked_as_unqualified_teacher, [["Yes"], ["No"]], :first, :first,
<%= f.govuk_collection_radio_buttons :unqualified_teacher, [["Yes"], ["No"]], :first, :first,
legend: { tag: "h1", text: @page_title },
hint: { text: "You'll find routes into teaching based on your circumstances" }
%>
10 changes: 9 additions & 1 deletion app/views/routes_into_teaching/steps/completed.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

<p>You can <%= link_to "change your answers", routes_into_teaching_steps_path %> if you need to.</p>

<%= session[:routes_into_teaching].inspect %>
<%= @answers.inspect %>

<hr>

<ul>
<% @results.each do |result| %>
<li><%= result["title"] %></li>
<% end %>
</ul>
96 changes: 96 additions & 0 deletions config/values/routes_into_teaching.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
routes:
- title: Postgraduate initial teacher training with fees
course_length: 9 months (full time) or up to 2 years (part time)
course_fee: Yes
funding: Scholarships or bursaries, as well as student loans, are available if you’re eligible
description: Postgraduate teacher training combines theoretical learning with at least 2 classroom placements in schools. Over your course, you’ll get the experience and knowledge you need to get qualified teacher status (QTS). On some courses, you can also combine QTS with a postgraduate certificate in education (PGCE).
matches:
- question: undergraduate_degree
answer: "Yes"
- question: unqualified_teacher
answer: "*"
- question: location
answer: "No"

- title: Postgraduate initial teacher training with a salary
course_length: 9 months
course_fee: Varies
funding: Not available
description: Salaried teacher training allows you to earn an unqualified teacher’s salary while you train towards qualified teacher status (QTS). You’ll still do some theoretical learning, but most of your time will be spent in school placements. These courses are in high demand and very competitive, and training providers may want you to have significant teaching or school experience. The main salaried courses include School Direct salaried and postgraduate teaching apprenticeships (PGTA
matches:
- question: undergraduate_degree
answer: "Yes"
- question: unqualified_teacher
answer: "*"
- question: location
answer: "No"

- title: Teach First Training Programme
course_length: 24 months
course_fee: No
funding: Not available
description: Teach First is a charitable organisation that delivers an employment-based route to teaching for high performing graduates and career changers. You’ll earn a salary while working towards qualified teacher status (QTS) with a postgraduate certificate in education (PGCE).
matches:
- question: undergraduate_degree
answer: "Yes"
- question: unqualified_teacher
answer: "*"
- question: location
answer: "No"

- title: Assessment only route
course_length: 12 weeks
course_fee: Yes
funding: Not available
description: If you’ve worked as an unqualified teacher, you may be able to get qualified teacher status (QTS) through an assessment only programme. With this route, you do not need to do any further training. Instead, you’ll undertake a series of assessments. This may include lesson observations, providing a portfolio of evidence to show you meet the teachers’ standards, or written assessments. This will vary by your provider
matches:
- question: undergraduate_degree
answer: "Yes"
- question: unqualified_teacher
answer: "Yes"
- question: location
answer: "No"

# international_qualified_teacher_status:
title: International qualified teacher status (iQTS)
course_length: 4 months
course_fee: Yes
funding: No
description: International qualified teacher status (iQTS) is a teaching qualification backed by the UK government. iQTS meets the same high standards as English qualified teacher status (QTS) and leads to the automatic award of QTS. You can train where you live and work, with no need to visit the UK.



# undergratuate_initial_teacher_training:
title: Undergraduate initial teacher training
course_length: up to 4 years
course_fee: Yes
funding: No
description: These courses are in high demand and very competitive, so it’s important to apply as soon as you can if you’re eligible.standards, or written assessments. This will vary by your provider.

# teacher_degree_apprenticeship:
title: Teacher degree apprenticeship
course_length: 4 years
course_fee: No - you will be paid a salary
funding: No
description: These courses are in high demand and very competitive, so it’s important to apply as soon as you can if you’re eligible.

# undergraduate_degree_followed_by_postgraduate_teacher_training:
title: Undergraduate degree (followed by postgraduate teacher training)
course_length: 4 years
course_fee: Yes
funding: No
description:

# undergraduate_degree_followed_by_assessment_only:
title: Undergraduate degree (followed by Assessment only)
course_length: up to 4 years
course_fee: Yes
funding: No
description:

# undergraduate_degree_followed_by_iqts:
title: Undergraduate degree (followed by iQTS)
course_length: up to 4 years
course_fee: Yes
funding: No
description:

0 comments on commit d02756a

Please sign in to comment.