-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Past tasks should default to data entry only * Tasks should support existing QTs * Status updates should be optional for past tasks * Change text BAME to ethinc minority * Update expired task message * Lint fixes
- Loading branch information
1 parent
ae0ad12
commit fcffc1d
Showing
9 changed files
with
433 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/views/Exercise/Tasks/Task/Data/AddMarkingSchemeItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template> | ||
<Form | ||
@save="save" | ||
@cancel="cancel" | ||
> | ||
<Select | ||
id="type" | ||
v-model="formData.type" | ||
label="Please select a type" | ||
required | ||
> | ||
<option | ||
v-for="type in types" | ||
:key="type.value" | ||
:value="type.value" | ||
> | ||
{{ type.title }} | ||
</option> | ||
</Select> | ||
|
||
<TextField | ||
id="title" | ||
v-model="formData.title" | ||
type="text" | ||
label="Title" | ||
required | ||
/> | ||
<TextField | ||
id="ref" | ||
v-model="formData.ref" | ||
type="text" | ||
label="Ref" | ||
required | ||
/> | ||
<Checkbox | ||
id="exclude-from-score" | ||
v-model="formData.excludeFromScore" | ||
> | ||
Exclude from score? | ||
</Checkbox> | ||
</Form> | ||
</template> | ||
|
||
<script> | ||
import Form from '@/components/Page/Form'; | ||
import Select from '@jac-uk/jac-kit/draftComponents/Form/Select'; | ||
import TextField from '@jac-uk/jac-kit/draftComponents/Form/TextField'; | ||
import Checkbox from '@jac-uk/jac-kit/draftComponents/Form/Checkbox'; | ||
export default { | ||
name: 'SelectPanel', | ||
components: { | ||
Form, | ||
Select, | ||
TextField, | ||
Checkbox, | ||
}, | ||
extends: Form, | ||
data() { | ||
return { | ||
types: [ | ||
{ | ||
value: 'grade', | ||
title: 'Grade', | ||
}, | ||
{ | ||
value: 'bool', | ||
title: 'Boolean', | ||
}, | ||
{ | ||
value: 'number', | ||
title: 'Number', | ||
}, | ||
// { | ||
// value: 'select', | ||
// title: 'Choice', | ||
// }, | ||
], | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,161 @@ | ||
<template> | ||
<p>[ Data entry: configure settings - e.g. marking scheme ]</p> | ||
<div> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-one-half"> | ||
<h1 class="govuk-heading-l"> | ||
{{ type | lookup }} | ||
</h1> | ||
</div> | ||
<div class="text-right govuk-grid-column-one-half"> | ||
<ActionButton | ||
class="govuk-!-margin-bottom-1" | ||
type="primary" | ||
@click="btnContinue" | ||
> | ||
Continue | ||
</ActionButton> | ||
</div> | ||
</div> | ||
<p class="govuk-body-l govuk-!-margin-bottom-4"> | ||
Please check the marking scheme is correct then press Continue | ||
</p> | ||
|
||
<div | ||
v-for="group in markingScheme" | ||
:key="group.ref" | ||
> | ||
<Table | ||
data-key="ref" | ||
:data="group.children" | ||
:columns="[ | ||
{ title: $options.filters.lookup(group.ref) }, | ||
{ title: '' }, | ||
{ title: '' }, | ||
]" | ||
local-data | ||
> | ||
<template #row="{row, index}"> | ||
<TableCell> | ||
{{ row.ref | lookup }} | ||
</TableCell> | ||
<TableCell> | ||
{{ row.type | lookup }} | ||
</TableCell> | ||
<TableCell> | ||
<ActionButton | ||
class="govuk-!-margin-bottom-0" | ||
@click="btnRemove(group, index)" | ||
> | ||
Remove | ||
</ActionButton> | ||
</TableCell> | ||
</template> | ||
</Table> | ||
|
||
<button | ||
type="button" | ||
class="govuk-button govuk-button--secondary govuk-!-margin-bottom-0" | ||
@click="btnAdd(group)" | ||
> | ||
Add | ||
</button> | ||
</div> | ||
|
||
<Modal ref="modalAddMarkingSchemeItem"> | ||
<TitleBar> | ||
Add to marking scheme | ||
</TitleBar> | ||
<AddMarkingSchemeItem | ||
class="govuk-!-margin-6" | ||
@save="btnSave" | ||
@cancel="btnCancelAdd" | ||
/> | ||
</Modal> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { beforeRouteEnter, btnNext } from '../helper'; | ||
import ActionButton from '@jac-uk/jac-kit/draftComponents/ActionButton'; | ||
import Table from '@jac-uk/jac-kit/components/Table/Table'; | ||
import TableCell from '@jac-uk/jac-kit/components/Table/TableCell'; | ||
import Modal from '@jac-uk/jac-kit/components/Modal/Modal'; | ||
import TitleBar from '@/components/Page/TitleBar'; | ||
import AddMarkingSchemeItem from './AddMarkingSchemeItem'; | ||
import { functions } from '@/firebase'; | ||
export default { | ||
components: { | ||
ActionButton, | ||
Table, | ||
TableCell, | ||
Modal, | ||
TitleBar, | ||
AddMarkingSchemeItem, | ||
}, | ||
beforeRouteEnter: beforeRouteEnter, | ||
props: { | ||
type: { | ||
required: true, | ||
type: String, | ||
}, | ||
}, | ||
data() { | ||
const task = this.$store.getters['tasks/getTask'](this.type); | ||
return { | ||
markingScheme: task.markingScheme, | ||
tableColumns: [ | ||
{ title: 'Criteria' }, | ||
{ title: 'Type' }, | ||
{ title: '' }, | ||
], | ||
currentGroup: null, | ||
}; | ||
}, | ||
computed: { | ||
exercise() { | ||
return this.$store.state.exerciseDocument.record; | ||
}, | ||
task() { | ||
return this.$store.getters['tasks/getTask'](this.type); | ||
}, | ||
}, | ||
watch: { | ||
task() { | ||
this.markingScheme = this.task.markingScheme; | ||
}, | ||
}, | ||
methods: { | ||
btnNext, | ||
async btnContinue() { | ||
await functions.httpsCallable('updateTask')({ | ||
exerciseId: this.exercise.id, | ||
type: this.type, | ||
}); | ||
this.btnNext(); | ||
}, | ||
async btnRemove(group, rowIndex) { | ||
group.children.splice(rowIndex, 1); | ||
await this.$store.dispatch('task/update', { exerciseId: this.exercise.id, type: this.type, data: { markingScheme: this.markingScheme } } ); | ||
return true; | ||
}, | ||
btnAdd(group) { | ||
this.currentGroup = group; | ||
this.$refs.modalAddMarkingSchemeItem.openModal(); | ||
}, | ||
async btnSave({ type, title, ref, excludeFromScore }) { | ||
const newItem = {}; | ||
newItem.type = type; | ||
newItem.title = title; | ||
newItem.ref = ref; | ||
if (excludeFromScore) newItem.excludeFromScore = excludeFromScore; | ||
this.currentGroup.children.push(newItem); | ||
await this.$store.dispatch('task/update', { exerciseId: this.exercise.id, type: this.type, data: { markingScheme: this.markingScheme } } ); | ||
this.$refs.modalAddMarkingSchemeItem.closeModal(); | ||
}, | ||
btnCancelAdd() { | ||
this.$refs.modalAddMarkingSchemeItem.closeModal(); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.