Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions app/flows/student_finance_calculator_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ def define
radio :when_does_your_course_start? do
option :"2025-2026"
option :"2026-2027"
option :"2027-2028"

on_response do |response|
self.calculator = SmartAnswer::Calculators::StudentFinanceCalculator.new
calculator.course_start = response
end

next_node do
question :what_loans_are_you_eligible_for?
next_node do |response|
if response == "2027-2028"
outcome :outcome_lifelong_learning_entitlement
else
question :what_loans_are_you_eligible_for?
end
end
end

Expand Down Expand Up @@ -133,6 +138,7 @@ def define
option :"dependant-adult"
option :"has-disability"
option :"low-income"
option :"care-leaver"
option :no

on_response do |response|
Expand All @@ -148,6 +154,7 @@ def define
checkbox_question :do_any_of_the_following_apply_all_uk_students? do
option :"has-disability"
option :"low-income"
option :"care-leaver"
option :no

on_response do |response|
Expand Down Expand Up @@ -209,5 +216,7 @@ def define
outcome :outcome_tuition_fee_only

outcome :outcome_uk_full_time_dental_medical_students

outcome :outcome_lifelong_learning_entitlement
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@ You could get a <%= format_money(tuition_fee_amount, pounds_only: true) %> [Tuit
<% if maintenance_loan_amount > 0 %>
## Maintenance Loan

You could get a <%= format_money(maintenance_loan_amount, pounds_only: true) %> [Maintenance Loan](<%= maintenance_loan_url %>) to help with your living costs.
<% if uk_ft_circumstances.include?('care-leaver') || uk_all_circumstances.include?('care-leaver') %>
You can choose to borrow the maximum amount.

How your Maintenance Loan is calculated:
If you’re a care leaver, your household income is not used to calculate your Maintenance Loan. Student Loans Company (SLC) will still use your household income to check what other funding you can get.

<%= format_money(max_loan_amount, pounds_only: true) %> (the maximum Maintenance Loan available)
\- <%= format_money(loan_shortfall, pounds_only: true) %> (the amount you might not be eligible for, based on your answers)
= <%= format_money(maintenance_loan_amount, pounds_only: true) %> (the amount you could be eligible for, based on your answers)
<% else %>
You could get a <%= format_money(maintenance_loan_amount, pounds_only: true) %> [Maintenance Loan](<%= maintenance_loan_url %>) to help with your living costs.

You can find out more about [how Maintenance Loans are calculated](/government/publications/student-finance-how-youre-assessed-and-paid).
How your Maintenance Loan is calculated:

You may get less Maintenance Loan in your final year.
<%= format_money(max_loan_amount, pounds_only: true) %> (the maximum Maintenance Loan available)
\- <%= format_money(loan_shortfall, pounds_only: true) %> (the amount you might not be eligible for, based on your answers)
= <%= format_money(maintenance_loan_amount, pounds_only: true) %> (the amount you could be eligible for, based on your answers)

If you need more money to fund your living costs and you qualify, you can apply for extra help.
You can find out more about [how Maintenance Loans are calculated](/government/publications/student-finance-how-youre-assessed-and-paid).

You may get less Maintenance Loan in your final year.

If you need more money to fund your living costs and you qualify, you can apply for extra help.
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% govspeak_for :body do %>
For courses starting on or after 1 January 2027, you may need to apply for student finance through your Lifelong Learning Entitlement (LLE).

You cannot currently get an estimate through this calculator.

Read the guide to [find out more about eligibility and how much you could get](/student-finance-on-or-after-1-january-2027).
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

In each of your first 4 years, you could get:

<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/new-fulltime-students", maintenance_loan_url: "/student-finance/new-fulltime-students" } %>
<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/new-fulltime-students", maintenance_loan_url: "/student-finance/new-fulltime-students", uk_ft_circumstances: calculator.uk_ft_circumstances, uk_all_circumstances: calculator.uk_all_circumstances } %>

In your fifth and sixth years, you could get <%= format_money(calculator.reduced_maintenance_loan_for_healthcare, pounds_only: true) %> reduced Maintenance Loan.
You can also apply for [NHS funding](/nhs-bursaries) and get the following depending on your circumstances:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

^You may get a smaller amount of funding to start with while Student Finance England (SFE) reviews your application. They'll send you a top-up payment later if you're eligible for it – [check your online account for updates](/student-finance-register-login).

<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/new-fulltime-students", maintenance_loan_url: "/student-finance/new-fulltime-students" } %>
<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/new-fulltime-students", maintenance_loan_url: "/student-finance/new-fulltime-students", uk_ft_circumstances: calculator.uk_ft_circumstances, uk_all_circumstances: calculator.uk_all_circumstances } %>

###Extra student funding

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- a Graduate Certificate or Graduate Diploma
<% end %>

<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/parttime-students", maintenance_loan_url: "/student-finance/parttime-students" } %>
<%= render partial: 'tuition_maintenance_summary', locals: { tuition_fee_amount: calculator.tuition_fee_amount, maintenance_loan_amount: calculator.maintenance_loan_amount, maintenance_grant_amount: calculator.maintenance_grant_amount, start_date: calculator.course_start, max_loan_amount: calculator.max_loan_amount, loan_shortfall: calculator.loan_shortfall, tuition_fee_url: "/student-finance/parttime-students", maintenance_loan_url: "/student-finance/parttime-students", uk_ft_circumstances: calculator.uk_ft_circumstances, uk_all_circumstances: calculator.uk_all_circumstances } %>

###Extra student funding

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<% text_for :title do %>
Do any of the following apply? (You might get extra funding.)
Do any of the following apply?
<% end %>

<% options(
"has-disability": "You have a disability, health condition or learning difficulty, for example dyslexia",
"low-income": "You’re on a low income, for example you find it hard to pay for food and accommodation",
"care-leaver": "You are a care leaver",
"no": "None of these"
) %>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<% text_for :title do %>
Do any of the following apply? (You might get extra funding.)
Do any of the following apply?
<% end %>

<% options(
"children-under-17": "You’ve got children under 17",
"dependant-adult": "An adult depends on you financially",
"has-disability": "You have a disability, health condition or learning difficulty, for example dyslexia",
"low-income": "You’re on low income, for example you find it hard to pay for basics like food and accommodation",
"care-leaver": "You are a care leaver",
"no": "None of these"
) %>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<% options(
"2025-2026": "On or after 1 September 2025 and before 1 September 2026",
"2026-2027": "On or after 1 September 2026 and before 1 January 2027",
"2027-2028": "On or after 1 January 2027",
) %>
4 changes: 3 additions & 1 deletion app/flows/student_finance_calculator_flow/start.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
- 2025 to 2026
- 2026 to 2027

^ There’s a different way to check how much you can get if you’re [a student from Scotland](https://www.saas.gov.uk/), [a student from Wales](https://www.studentfinancewales.co.uk/) or [a student from Northern Ireland](https://www.studentfinanceni.co.uk/).
^Student finance is changing. If your course starts on or after 1 January 2027, [find out what you could get](/student-finance-on-or-after-1-january-2027).

There’s a different way to check how much you can get if you’re [a student from Scotland](https://www.saas.gov.uk/), [a student from Wales](https://www.studentfinancewales.co.uk/) or [a student from Northern Ireland](https://www.studentfinanceni.co.uk/).

Use this calculator to estimate the amount you could get in:

Expand Down
1 change: 1 addition & 0 deletions lib/smart_answer/calculators/student_finance_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def initialize(params = {})
@full_time_credits = params[:full_time_credits]
@doctor_or_dentist = params[:doctor_or_dentist]
@uk_ft_circumstances = params.fetch(:uk_ft_circumstances, [])
@uk_all_circumstances = params.fetch(:uk_all_circumstances, [])
@loan_eligibility = params[:loan_eligibility]
end

Expand Down
29 changes: 29 additions & 0 deletions test/flows/student_finance_calculator_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ class StudentFinanceCalculatorTest < ActiveSupport::TestCase
assert_rendered_question
end

context "outcome: outcome_lifelong_learning_entitlement" do
setup do
testing_node :outcome_lifelong_learning_entitlement
add_responses when_does_your_course_start?: "2027-2028"
end

should "render text if course starts on or after 1 January 2027" do
assert_rendered_outcome text: "For courses starting on or after 1 January 2027, you may need to apply for student finance through your Lifelong Learning Entitlement (LLE)."
end
end

context "next_node" do
should "have a next node of what_loans_are_you_eligible_for? for any response" do
assert_next_node :what_loans_are_you_eligible_for?, for_response: "2025-2026"
Expand Down Expand Up @@ -397,6 +408,12 @@ class StudentFinanceCalculatorTest < ActiveSupport::TestCase
should "render the full time student text within the extra help partial" do
assert_rendered_outcome text: "You might be able to get help with the costs of travel for study or work placements"
end

should "render text if student is a care leaver" do
add_responses do_any_of_the_following_apply_uk_full_time_students_only?: "care-leaver"

assert_rendered_outcome text: "If you’re a care leaver, your household income is not used to calculate your Maintenance Loan."
end
end

context "outcome: outcome_uk_part_time_students" do
Expand Down Expand Up @@ -474,6 +491,12 @@ class StudentFinanceCalculatorTest < ActiveSupport::TestCase

assert_rendered_outcome text: "Social Work Bursary"
end

should "render text if student is a care leaver" do
add_responses do_any_of_the_following_apply_all_uk_students?: "care-leaver"

assert_rendered_outcome text: "If you’re a care leaver, your household income is not used to calculate your Maintenance Loan."
end
end

context "outcome: outcome_uk_full_time_dental_medical_students" do
Expand Down Expand Up @@ -540,5 +563,11 @@ class StudentFinanceCalculatorTest < ActiveSupport::TestCase

assert_rendered_outcome text: "University and college hardship funds"
end

should "render text if student is a care leaver" do
add_responses do_any_of_the_following_apply_uk_full_time_students_only?: "care-leaver"

assert_rendered_outcome text: "If you’re a care leaver, your household income is not used to calculate your Maintenance Loan."
end
end
end