Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/equal merit tie breakers #1261

Merged
merged 43 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fca250a
Bug Fix - wrong version of jac-kit being used
HalcyonJAC Apr 9, 2021
8ec1cab
resolve some npm warnings that appear during compilation
HalcyonJAC Apr 9, 2021
c938a6e
Merge branch 'develop' into feature/equal-merit-tie-breakers
HalcyonJAC Apr 9, 2021
ffa1bbd
Bug Fix - view QT - if there are no applications the page would not load
HalcyonJAC Apr 9, 2021
cdc1b23
WIP
HalcyonJAC Apr 9, 2021
714014c
don't allow EM tie-breakers to be created for an exercise if it has n…
HalcyonJAC Apr 12, 2021
ac3140d
Bug Fix - if you create a Tie-breaker it is saved as a QT
HalcyonJAC Apr 12, 2021
d74af11
Merge branch 'develop' into feature/equal-merit-tie-breakers
HalcyonJAC Apr 12, 2021
5faa10c
EM tie-breakers - don't allow start or end date to be outside of the …
HalcyonJAC Apr 12, 2021
2328ae1
Merge branch 'feature/equal-merit-tie-breakers' of https://github.com…
HalcyonJAC Apr 12, 2021
e7a2421
simplified some logic
HalcyonJAC Apr 12, 2021
1498b1f
do not allow a tie-breaker to be opened while they are open QTs
HalcyonJAC Apr 12, 2021
cfc2a1e
EM tie-breakers - Create New - stopped passing this.isTieBreakers pro…
HalcyonJAC Apr 12, 2021
25de549
WIP
HalcyonJAC Apr 12, 2021
2665313
simplified some boolean logic
HalcyonJAC Apr 13, 2021
4b14798
new Equal Merit Tie-breaker reports
HalcyonJAC Apr 13, 2021
bf26ca7
Merge branch 'develop' into feature/equal-merit-tie-breakers
HalcyonJAC Apr 13, 2021
47650d8
show a warning message if tie-breaker test can't be opened yet due to…
HalcyonJAC Apr 13, 2021
7382c09
Bug Fix - when viewing a tie-breaker where the Open Tests button was …
HalcyonJAC Apr 13, 2021
81bf82c
when creating a tie-breaker test, default the start and end date to t…
HalcyonJAC Apr 13, 2021
98a389d
specified which versions of vue loader to use
darre1 Apr 13, 2021
5499064
Merge branch 'feature/equal-merit-tie-breakers' of https://github.com…
darre1 Apr 13, 2021
3986bb8
WIP
HalcyonJAC Apr 14, 2021
6c88288
Merge branch 'feature/equal-merit-tie-breakers' of https://github.com…
HalcyonJAC Apr 14, 2021
1168a35
Merge branch 'develop' into feature/equal-merit-tie-breakers
HalcyonJAC Apr 14, 2021
9322c33
allow tie-breakers to be created even if there are no QTs for the exe…
HalcyonJAC Apr 15, 2021
fbdf2da
When creating a tie-breaker force it to be a Scenario type of test
HalcyonJAC Apr 15, 2021
6f3b368
tidy-up
HalcyonJAC Apr 20, 2021
3dff4bd
Tie-breaker - when creating tests, only consider EMP candidates
HalcyonJAC Apr 20, 2021
db6b91d
typo
HalcyonJAC Apr 22, 2021
7f22a91
when creating a tie-breaker show the Scenario option and choose it au…
HalcyonJAC Jun 8, 2021
3182db2
Merge branch 'develop' into feature/equal-merit-tie-breakers
HalcyonJAC Jun 8, 2021
91f18a7
Merge branch 'main' into feature/equal-merit-tie-breakers
HalcyonJAC Jun 8, 2021
2c8b89b
Merge branch 'main' into feature/equal-merit-tie-breakers
warrensearle Jul 10, 2021
f3c2c21
Merge branch 'main' into feature/equal-merit-tie-breakers
adamnlewis Jul 21, 2021
36b34c3
Merge branch 'main' into feature/equal-merit-tie-breakers
HalcyonJAC Jul 21, 2021
7c88545
Merge branch 'feature/equal-merit-tie-breakers' of https://github.com…
HalcyonJAC Jul 21, 2021
f87f1b8
Update package lock
HalcyonJAC Jul 21, 2021
58d50b6
Router.js fix
HalcyonJAC Jul 21, 2021
854326c
Router.js fix
HalcyonJAC Jul 21, 2021
dd06c6e
Revert part "Router.js fix"
HalcyonJAC Jul 21, 2021
beab9db
EM Tie-Breaker - allow tests to be setup after the EM date-range
HalcyonJAC Jul 28, 2021
851ac37
Merge branch 'main' into feature/equal-merit-tie-breakers
HalcyonJAC Jul 29, 2021
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
242 changes: 95 additions & 147 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"jspdf": "^1.5.3",
"save-file": "^2.3.1",
"vue": "^2.6.12",
"vue-loader": "^15.9.2",
"vue-loader-v16": "^16.0.0-beta.5.4",
"vue-json-pretty": "^1.7.1",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
Expand Down
173 changes: 172 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import ExerciseReportsAgency from '@/views/Exercise/Reports/Agency';
import ExerciseReportsHandover from '@/views/Exercise/Reports/Handover';
import QualifyingTestReportCreate from '@/views/Exercise/Reports/QualifyingTestReports/Create';
import QualifyingTestReport from '@/views/Exercise/Reports/QualifyingTestReports/QualifyingTestReport';
import QualifyingTestReports from '@/views/Exercise/Reports/QualifyingTestReports/QualifyingTestReports';
import QualifyingTestReportEdit from '@/views/Exercise/Reports/QualifyingTestReports/QualifyingTestReport/Edit';
import QualifyingTestReportView from '@/views/Exercise/Reports/QualifyingTestReports/QualifyingTestReport/View';
import QualifyingTestReportViewScore from '@/views/Exercise/Reports/QualifyingTestReports/QualifyingTestReport/ViewScore';
Expand All @@ -85,6 +86,7 @@ import QualifyingTestReview from '@/views/Exercise/Tasks/QualifyingTests/Qualify
import QualifyingTestResponses from '@/views/Exercise/Tasks/QualifyingTests/QualifyingTest/Responses';
import QualifyingTestResponse from '@/views/Exercise/Tasks/QualifyingTests/QualifyingTest/Response';
import QualifyingTestResponseView from '@/views/Exercise/Tasks/QualifyingTests/QualifyingTest/Response/View';
import QualifyingTestsCover from '@/views/Exercise/Tasks/QualifyingTests/Cover';

// Exercise stages
import ExerciseStages from '@/views/Exercise/Stages';
Expand Down Expand Up @@ -574,6 +576,105 @@ const router = new Router({
path: '',
redirect: 'qualifying-tests',
},
{
path: 'equal-merit-tie-breakers',
component: QualifyingTestsCover,
props: {
tieBreakers: true,
},
name: 'exercise-tasks-equal-merit-tie-breakers',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breakers',
},
},
{
path: 'equal-merit-tie-breakers/new',
component: QualifyingTestNew,
props: {
isTieBreaker: true,
},
name: 'equal-merit-tie-breaker-new',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breakers | New',
},
},
{
path: 'equal-merit-tie-breakers/:qualifyingTestId',
component: QualifyingTest,
children: [
{
path: '',
component: QualifyingTestView,
name: 'equal-merit-tie-breaker-view',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | View',
},
},
{
path: 'edit',
component: QualifyingTestEdit,
name: 'equal-merit-tie-breaker-edit',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Edit',
},
},
{
path: 'build',
component: QualifyingTestQuestionBuilder,
name: 'equal-merit-tie-breaker-question-builder',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Question Builder',
},
},
{
path: 'dry-run',
component: QualifyingTestDryRun,
name: 'equal-merit-tie-breaker-dry-run',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Dry Run',
},
},
{
path: 'review',
component: QualifyingTestReview,
name: 'equal-merit-tie-breaker-review',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Review',
},
},
{
path: 'responses/:status',
component: QualifyingTestResponses,
name: 'equal-merit-tie-breaker-responses',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Responses',
},
},
{
path: 'response/:responseId',
component: QualifyingTestResponse,
children: [
{
path: '',
component: QualifyingTestResponseView,
name: 'equal-merit-tie-breaker-response-view',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-Breaker | Response View',
},
},
],
},
],
},
{
path: 'independent-assessments',
component: ExerciseTasksIndependentAssessments,
Expand Down Expand Up @@ -604,6 +705,9 @@ const router = new Router({
{
path: 'qualifying-tests',
component: QualifyingTests,
props: {
tieBreakers: false,
},
name: 'exercise-tasks-qualifying-tests',
meta: {
requiresAuth: true,
Expand All @@ -613,6 +717,9 @@ const router = new Router({
{
path: 'qualifying-tests/new',
component: QualifyingTestNew,
props: {
isTieBreaker: false,
},
name: 'qualifying-test-new',
meta: {
requiresAuth: true,
Expand Down Expand Up @@ -955,6 +1062,9 @@ const router = new Router({
{
path: '',
component: ExerciseReportsQualifyingTestReports,
props: {
tieBreakers: false,
},
meta: {
requiresAuth: true,
title: 'Qualifying Test Reports | Exercise Reports',
Expand All @@ -964,6 +1074,9 @@ const router = new Router({
path: 'create',
name: 'qualifying-test-report-create',
component: QualifyingTestReportCreate,
props: {
tieBreakers: false,
},
meta: {
requiresAuth: true,
title: 'Create Qualifying Test Report | Exercise Reports',
Expand Down Expand Up @@ -1002,8 +1115,66 @@ const router = new Router({
},
],
},
],
],
},
{
path: 'equal-merit-tie-breaker-reports',
component: QualifyingTestReports,
props: {
tieBreakers: true,
},
name: 'equal-merit-tie-breaker-reports',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-breaker Reports',
},
},
{
path: 'equal-merit-tie-breaker-report-create',
component: QualifyingTestReportCreate,
props: {
tieBreakers: true,
},
name: 'equal-merit-tie-breaker-report-create',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-breaker Report | New',
},
},
{
path: 'equal-merit-tie-breaker-reports/:qualifyingTestReportId',
component: QualifyingTestReport,
children: [
{
path: '',
component: QualifyingTestReportView,
name: 'equal-merit-tie-breaker-report-view',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-breaker Report | View',
},
},
{
path: 'edit',
component: QualifyingTestReportEdit,
name: 'equal-merit-tie-breaker-report-edit',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-breaker Report | Edit',
},
},
{
path: ':score',
component: QualifyingTestReportViewScore,
name: 'equal-merit-tie-breaker-report-view-score',
meta: {
requiresAuth: true,
title: 'Equal Merit Tie-breaker Report | View Score',
},
},
],
},

{
path: 'agency',
component: ExerciseReportsAgency,
Expand Down
5 changes: 5 additions & 0 deletions src/store/qualifyingTest/qualifyingTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,10 @@ export default {
&& qualifyingTest.mode !== QUALIFYING_TEST.MODE.MOP_UP;
});
},
getActivatedQTs: (state) => {
return state.records.filter(qualifyingTest => {
return qualifyingTest.status === QUALIFYING_TEST.STATUS.ACTIVATED;
});
},
},
};
18 changes: 15 additions & 3 deletions src/views/Exercise/Reports/QualifyingTestReports/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="govuk-grid-column-two-thirds">
<form @submit.prevent="validateAndSave">
<h2 class="govuk-heading-l">
Create a qualifying test
Create a {{ tieBreakers ? 'an equal merit tie-breaker' : 'a qualifying test' }} report
</h2>

<ErrorSummary
Expand Down Expand Up @@ -45,6 +45,12 @@ export default {
CheckboxItem,
},
extends: Form,
props: {
tieBreakers: {
required: true,
type: Boolean,
},
},
data(){
return {
qualifyingTestIds: [],
Expand All @@ -55,7 +61,12 @@ export default {
return this.$route.params.id;
},
qualifyingTests() {
return this.$store.getters['qualifyingTest/getCompletedQTs'];
return this.$store.getters['qualifyingTest/getCompletedQTs'].filter(row => {
return this.tieBreakers == (row.isTieBreaker == true); // to cater for the isTieBreaker field being absent
});
},
routeNamePrefix() {
return this.tieBreakers ? 'equal-merit-tie-breaker' : 'qualifying-test';
},
},
created() {
Expand All @@ -81,11 +92,12 @@ export default {
exercise: {
id: this.exerciseId,
},
tieBreakers: this.tieBreakers,
qualifyingTests: qualifyingTests,
};
await this.$store.dispatch('qualifyingTestReport/create', data);
this.$router.push({
name: 'qualifying-test-reports',
name: `${this.routeNamePrefix}-reports`,
});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="govuk-grid-column-two-thirds">
<form @submit.prevent="validateAndSave">
<h2 class="govuk-heading-m govuk-!-margin-bottom-0">
Qualifying Test Report
{{ tieBreakers ? 'Equal Merit Tie-breaker' : 'Qualifying Test' }} Report
</h2>
<h3 class="govuk-heading-l ">
{{ qualifyingTestReport.title }}
Expand Down Expand Up @@ -96,11 +96,19 @@ export default {
return this.$store.state.exerciseDocument.record;
},
qualifyingTests() {
return this.$store.getters['qualifyingTest/getCompletedQTs'];
return this.$store.getters['qualifyingTest/getCompletedQTs'].filter(row => {
return this.tieBreakers == (row.isTieBreaker == true); // to cater for the isTieBreaker field being absent
});
},
qualifyingTestReport() {
return this.$store.getters['qualifyingTestReport/data'];
},
tieBreakers() {
return this.qualifyingTestReport.tieBreakers;
},
routeNamePrefix() {
return this.tieBreakers ? 'equal-merit-tie-breaker' : 'qualifying-test';
},
},
created() {
if (this.$store.state.qualifyingTest.records.length === 0) {
Expand Down Expand Up @@ -128,7 +136,7 @@ export default {
await this.$store.dispatch('qualifyingTestReport/save', data);
this.$router.push({
name: 'qualifying-test-report-view',
name: `${this.routeNamePrefix}-report-view`,
params: {
qualifyingTestReportId: this.qualifyingTestReportId,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="moj-page-header-actions">
<div class="moj-page-header-actions__title">
<h2 class="govuk-heading-m">
Qualifying Test Report
{{ tieBreakers ? 'Equal Merit Tie-breaker' : 'Qualifying Test' }} Report
</h2>
<h3 class="govuk-heading-l govuk-!-margin-bottom-0">
{{ qualifyingTestReport.title }}
Expand Down Expand Up @@ -67,7 +67,7 @@
</TableCell>
<TableCell :title="tableColumns[2].title">
<RouterLink
:to="{ name: 'qualifying-test-report-view-score', params: { qualifyingTestReportId: qualifyingTestReportId, score: row.score } }"
:to="{ name: `${routeNamePrefix}-report-view-score`, params: { qualifyingTestReportId: qualifyingTestReportId, score: row.score } }"
class="govuk-link"
>
{{ row.score }}
Expand Down Expand Up @@ -151,6 +151,12 @@ export default {
});
return score;
},
tieBreakers() {
return this.qualifyingTestReport.tieBreakers;
},
routeNamePrefix() {
return this.tieBreakers ? 'equal-merit-tie-breaker' : 'qualifying-test';
},
applicationIds() {
const ids = [];
this.qualifyingTestReport.rawData.forEach(data => {
Expand All @@ -174,7 +180,7 @@ export default {
},
btnEdit() {
this.$router.push({
name: 'qualifying-test-report-edit',
name: `${this.routeNamePrefix}-report-edit`,
params: {
qualifyingTestReportId: this.qualifyingTestReportId,
},
Expand Down Expand Up @@ -233,7 +239,7 @@ export default {
];
},
downloadData() {
const title = 'Qualifying Test Report';
const title = `${this.tieBreakers ? 'Equal Merit Tie-breaker' : 'Qualifying Test'} Report`;
const data = this.gatherReportData();
downloadXLSX(
data,
Expand Down
Loading