Flattened RatingComponent into scenario columns

This commit is contained in:
neviyn 2020-01-08 15:55:49 +00:00
parent 8fb6142cb7
commit ad01ff3cba
9 changed files with 266 additions and 311 deletions

View File

@ -16,7 +16,6 @@ import javax.persistence.JoinTable
import javax.persistence.ManyToMany
import javax.persistence.ManyToOne
import javax.persistence.OneToMany
import javax.persistence.OneToOne
import javax.persistence.Table
import kotlin.math.roundToInt
@ -98,22 +97,22 @@ data class Observation(
"${roundScore(monitoring)},${roundScore(controlProcedural)},${roundScore(control)}," +
"${roundScore(conservatism)},${roundScore(teamworkCommunications)},${roundScore(teamworkLeadership)}," +
"${roundScore(teamworkWorkload)},${roundScore(knowledge)}," +
"\"${scenarios.map { it.monitoring.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlProcedural.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.control.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.conservatism.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkCommunications.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkLeadership.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkWorkload.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.knowledge.strengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.monitoring.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlProcedural.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.control.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.conservatism.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkCommunications.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkLeadership.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkWorkload.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.knowledge.improvements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.monitoringStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlProceduralStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.conservatismStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkCommunicationsStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkLeadershipStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkWorkloadStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.knowledgeStrengths }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.monitoringImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlProceduralImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.controlImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.conservatismImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkCommunicationsImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkLeadershipImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.teamworkWorkloadImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
"\"${scenarios.map { it.knowledgeImprovements }.filter { it.isNotEmpty() }.joinToString(separator = "; ")}\"," +
";#None;#,"
return tutors.joinToString("\n") { it.name + "," + dataPortion }
}
@ -126,53 +125,50 @@ data class Observation(
}
}
@Entity
data class RatingComponent(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
val rating: Int,
val strengths: String = "",
val improvements: String = ""
) {
fun ratingValid(): Boolean {
return rating in 1..5
}
}
@Entity
data class Scenario(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
val title: String,
@OneToOne(cascade = [CascadeType.ALL])
val monitoring: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val controlProcedural: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val control: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val conservatism: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val teamworkCommunications: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val teamworkLeadership: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val teamworkWorkload: RatingComponent,
@OneToOne(cascade = [CascadeType.ALL])
val knowledge: RatingComponent
val monitoringRating: Int,
val monitoringStrengths: String = "",
val monitoringImprovements: String = "",
val controlProceduralRating: Int,
val controlProceduralStrengths: String = "",
val controlProceduralImprovements: String = "",
val controlRating: Int,
val controlStrengths: String = "",
val controlImprovements: String = "",
val conservatismRating: Int,
val conservatismStrengths: String = "",
val conservatismImprovements: String = "",
val teamworkCommunicationsRating: Int,
val teamworkCommunicationsStrengths: String = "",
val teamworkCommunicationsImprovements: String = "",
val teamworkLeadershipRating: Int,
val teamworkLeadershipStrengths: String = "",
val teamworkLeadershipImprovements: String = "",
val teamworkWorkloadRating: Int,
val teamworkWorkloadStrengths: String = "",
val teamworkWorkloadImprovements: String = "",
val knowledgeRating: Int,
val knowledgeStrengths: String = "",
val knowledgeImprovements: String = ""
) {
private fun ratingValid(rating: Int): Boolean {
return rating in 1..5
}
fun ratingsAllValid(): Boolean {
return monitoring.ratingValid() &&
controlProcedural.ratingValid() &&
control.ratingValid() &&
conservatism.ratingValid() &&
teamworkCommunications.ratingValid() &&
teamworkLeadership.ratingValid() &&
teamworkWorkload.ratingValid() &&
knowledge.ratingValid()
return ratingValid(monitoringRating) &&
ratingValid(controlProceduralRating) &&
ratingValid(controlRating) &&
ratingValid(conservatismRating) &&
ratingValid(teamworkCommunicationsRating) &&
ratingValid(teamworkLeadershipRating) &&
ratingValid(teamworkWorkloadRating) &&
ratingValid(knowledgeRating)
}
}
@ -183,4 +179,4 @@ data class Person(
val id: Long = 0,
@JsonProperty
val name: String
)
)

View File

@ -161,14 +161,14 @@ class GroupSessionController {
date = LocalDate.now(),
type = GroupSessionManager.trainingType!!,
observed = x.scenarios.joinToString { it.title },
monitoring = x.scenarios.map { it.monitoring.rating }.average(),
conservatism = x.scenarios.map { it.conservatism.rating }.average(),
controlProcedural = x.scenarios.map { it.controlProcedural.rating }.average(),
control = x.scenarios.map { it.control.rating }.average(),
teamworkCommunications = x.scenarios.map { it.teamworkCommunications.rating }.average(),
teamworkLeadership = x.scenarios.map { it.teamworkLeadership.rating }.average(),
teamworkWorkload = x.scenarios.map { it.teamworkWorkload.rating }.average(),
knowledge = x.scenarios.map { it.knowledge.rating }.average(),
monitoring = x.scenarios.map { it.monitoringRating }.average(),
conservatism = x.scenarios.map { it.conservatismRating }.average(),
controlProcedural = x.scenarios.map { it.controlProceduralRating }.average(),
control = x.scenarios.map { it.controlRating }.average(),
teamworkCommunications = x.scenarios.map { it.teamworkCommunicationsRating }.average(),
teamworkLeadership = x.scenarios.map { it.teamworkLeadershipRating }.average(),
teamworkWorkload = x.scenarios.map { it.teamworkWorkloadRating }.average(),
knowledge = x.scenarios.map { it.knowledgeRating }.average(),
scenarios = x.scenarios,
tutors = tutors,
person = personRepository.findFirstByNameLike(x.person.toUpperCase())

View File

@ -141,14 +141,14 @@ class ObservationsController {
date = LocalDate.now(),
type = newObservation.type,
observed = newObservation.scenarios.joinToString { it.title },
monitoring = newObservation.scenarios.map { it.monitoring.rating }.average(),
conservatism = newObservation.scenarios.map { it.conservatism.rating }.average(),
controlProcedural = newObservation.scenarios.map { it.controlProcedural.rating }.average(),
control = newObservation.scenarios.map { it.control.rating }.average(),
teamworkCommunications = newObservation.scenarios.map { it.teamworkCommunications.rating }.average(),
teamworkLeadership = newObservation.scenarios.map { it.teamworkLeadership.rating }.average(),
teamworkWorkload = newObservation.scenarios.map { it.teamworkWorkload.rating }.average(),
knowledge = newObservation.scenarios.map { it.knowledge.rating }.average(),
monitoring = newObservation.scenarios.map { it.monitoringRating }.average(),
conservatism = newObservation.scenarios.map { it.conservatismRating }.average(),
controlProcedural = newObservation.scenarios.map { it.controlProceduralRating }.average(),
control = newObservation.scenarios.map { it.controlRating }.average(),
teamworkCommunications = newObservation.scenarios.map { it.teamworkCommunicationsRating }.average(),
teamworkLeadership = newObservation.scenarios.map { it.teamworkLeadershipRating }.average(),
teamworkWorkload = newObservation.scenarios.map { it.teamworkWorkloadRating }.average(),
knowledge = newObservation.scenarios.map { it.knowledgeRating }.average(),
scenarios = newObservation.scenarios,
tutors = tutors,
person = personRepository.findFirstByNameLike(newObservation.person.toUpperCase()) ?: personRepository.save(Person(name = newObservation.person.toUpperCase()))
@ -255,21 +255,21 @@ class ObservationsController {
logger.debug("Calculating AFI Data for ${data.size} entries")
for (x in data) {
for (y in x.scenarios) {
if (y.monitoring.rating <= afiPieThreshold)
if (y.monitoringRating <= afiPieThreshold)
monitoring++
if (y.knowledge.rating <= afiPieThreshold)
if (y.knowledgeRating <= afiPieThreshold)
knowledge++
if (y.control.rating <= afiPieThreshold)
if (y.controlRating <= afiPieThreshold)
control++
if (y.controlProcedural.rating <= afiPieThreshold)
if (y.controlProceduralRating <= afiPieThreshold)
control++
if (y.conservatism.rating <= afiPieThreshold)
if (y.conservatismRating <= afiPieThreshold)
conservatism++
if (y.teamworkCommunications.rating <= afiPieThreshold)
if (y.teamworkCommunicationsRating <= afiPieThreshold)
teamwork++
if (y.teamworkLeadership.rating <= afiPieThreshold)
if (y.teamworkLeadershipRating <= afiPieThreshold)
teamwork++
if (y.teamworkWorkload.rating <= afiPieThreshold)
if (y.teamworkWorkloadRating <= afiPieThreshold)
teamwork++
}
}

View File

@ -24,7 +24,6 @@ import uk.co.neviyn.observationdatabase.Observation
import uk.co.neviyn.observationdatabase.ObservationRepository
import uk.co.neviyn.observationdatabase.Person
import uk.co.neviyn.observationdatabase.PersonRepository
import uk.co.neviyn.observationdatabase.RatingComponent
import uk.co.neviyn.observationdatabase.Scenario
import uk.co.neviyn.observationdatabase.Site
import uk.co.neviyn.observationdatabase.SiteRepository
@ -100,8 +99,7 @@ class GroupSessionControllerTest {
Mockito.doReturn(listOf(tutor)).`when`(tutorRepository).findAllById(listOf(1))
val person = Person(1, "A Student")
Mockito.doReturn(person).`when`(personRepository).save(any())
val rc = RatingComponent(rating = 5)
val scenario = Scenario(0, "Sample title", rc, rc, rc, rc, rc, rc, rc, rc)
val scenario = Scenario(0, "Sample title", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "")
Mockito.doReturn(Observation(1, site, LocalDate.now(), TrainingType.INITIAL, "Sample title", 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, listOf(scenario), setOf(tutor), person)).`when`(observationRepository).save(any())
controller.startGroupObservation(GroupObservationInit(1, TrainingType.INITIAL, listOf(1), listOf("Sample title")))
controller.addGroupObservation(GroupObservation("A Student", listOf(scenario)))
@ -126,9 +124,8 @@ class GroupSessionControllerTest {
Mockito.doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
Mockito.doReturn(listOf(Tutor(1, "Mr X", site))).`when`(tutorRepository).findAllById(listOf(1))
controller.startGroupObservation(GroupObservationInit(1, TrainingType.INITIAL, listOf(1), listOf("Sample title")))
val rc = RatingComponent(rating = 5)
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Sample title", RatingComponent(rating = 0), rc, rc, rc, rc, rc, rc, rc))))
verify(websocketMessenger, times(1)).convertAndSend("/ws/scenarios", mapOf("scenarios" to mapOf("Sample title" to listOf(Scenario(0, "A Student", RatingComponent(rating = 0), rc, rc, rc, rc, rc, rc, rc)))))
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Sample title", 0, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", ""))))
verify(websocketMessenger, times(1)).convertAndSend("/ws/scenarios", mapOf("scenarios" to mapOf("Sample title" to listOf(Scenario(0, "A Student", 0, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "")))))
controller.pushObservationsToDatabase()
}
@ -138,8 +135,7 @@ class GroupSessionControllerTest {
Mockito.doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
Mockito.doReturn(listOf(Tutor(1, "Mr X", site))).`when`(tutorRepository).findAllById(listOf(1))
controller.startGroupObservation(GroupObservationInit(1, TrainingType.INITIAL, listOf(1), listOf("Sample title")))
val rc = RatingComponent(rating = 5)
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Different Title", rc, rc, rc, rc, rc, rc, rc, rc))))
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Different Title", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", ""))))
}
@Test
@ -148,8 +144,7 @@ class GroupSessionControllerTest {
Mockito.doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
Mockito.doReturn(listOf(Tutor(1, "Mr X", site))).`when`(tutorRepository).findAllById(listOf(1))
controller.startGroupObservation(GroupObservationInit(1, TrainingType.INITIAL, listOf(1), listOf("Sample title")))
val rc = RatingComponent(rating = 5)
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Sample title", RatingComponent(rating = 0), rc, rc, rc, rc, rc, rc, rc))))
controller.addGroupObservation(GroupObservation("A Student", listOf(Scenario(0, "Sample title", 0, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", ""))))
assertEquals(1, GroupSessionManager.observations.size)
assertEquals("A Student", GroupSessionManager.observations.keys.first())
assertEquals("A Student", GroupSessionManager.observations.values.first().person)
@ -162,16 +157,14 @@ class GroupSessionControllerTest {
@Test(expected = ResponseStatusException::class)
fun testGetParticipantData_WrongName() {
val rc = RatingComponent(rating = 5)
val testData = GroupObservation("A Student", listOf(Scenario(0, "Sample title", rc, rc, rc, rc, rc, rc, rc, rc)))
val testData = GroupObservation("A Student", listOf(Scenario(0, "Sample title", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "")))
GroupSessionManager.observations["A Student"] = testData
controller.getParticipantData("Another Student")
}
@Test
fun testGetParticipantData() {
val rc = RatingComponent(rating = 5)
val testData = GroupObservation("A Student", listOf(Scenario(0, "Sample title", rc, rc, rc, rc, rc, rc, rc, rc)))
val testData = GroupObservation("A Student", listOf(Scenario(0, "Sample title", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "")))
GroupSessionManager.observations["A Student"] = testData
val output = controller.getParticipantData("A Student")
assertEquals(testData, output)

View File

@ -25,7 +25,6 @@ import uk.co.neviyn.observationdatabase.ObservationRepository
import uk.co.neviyn.observationdatabase.ObservationsRequest
import uk.co.neviyn.observationdatabase.Person
import uk.co.neviyn.observationdatabase.PersonRepository
import uk.co.neviyn.observationdatabase.RatingComponent
import uk.co.neviyn.observationdatabase.Scenario
import uk.co.neviyn.observationdatabase.Site
import uk.co.neviyn.observationdatabase.SiteRepository
@ -124,8 +123,7 @@ class ObservationsControllerTest {
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
doReturn(listOf(tutor)).`when`(tutorRepository).findAllById(listOf(1))
doReturn(person).`when`(personRepository).findFirstByNameLike("MR X")
val defaultComponent = RatingComponent(rating = 5, strengths = "", improvements = "")
val newData = NewObservation(1, TrainingType.INITIAL, "An Observation", listOf(Scenario(title = "Something", monitoring = defaultComponent, controlProcedural = defaultComponent, control = defaultComponent, conservatism = defaultComponent, teamworkCommunications = defaultComponent, teamworkLeadership = defaultComponent, teamworkWorkload = defaultComponent, knowledge = defaultComponent)), listOf(1), "Mr X")
val newData = NewObservation(1, TrainingType.INITIAL, "An Observation", listOf(Scenario(1, "Something", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "", 5, "", "")), listOf(1), "Mr X")
val observation = Observation(1, site, LocalDate.now(), TrainingType.INITIAL, "An Observation", 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, newData.scenarios, setOf(tutor), person)
doReturn(observation).`when`(observationRepository).save(ArgumentMatchers.any())
val result = controller.addObservation(newData)

View File

@ -3,22 +3,22 @@
<b-row>
<b-col cols="3">
<p>{{ description }}</p>
<h4 v-bind:class="{ scorewarn: scenariofundamental.rating < 3 }">
{{ scenariofundamental.rating }}
<h4 v-bind:class="{ scorewarn: rating < 3 }">
{{ rating }}
</h4>
</b-col>
<b-col cols="9">
<b-form-textarea
:value="scenariofundamental.strengths"
:value="strengths"
placeholder="-"
:rows="1"
:max-rows="2"
no-resize
class="strength"
class="strengths"
readonly
></b-form-textarea>
<b-form-textarea
:value="scenariofundamental.improvements"
:value="improvements"
placeholder="-"
:rows="1"
:max-rows="2"
@ -33,7 +33,7 @@
<script>
export default {
props: ["scenariofundamental", "description"]
props: ["rating", "strengths", "improvements", "description"]
};
</script>

View File

@ -60,9 +60,9 @@
<b-col>
<h5>Monitoring</h5>
<score-selector
:score-value="item.monitoring.rating"
:score-value="item.monitoringRating"
v-on:newselection="
item.monitoring.rating = $event;
item.monitoringRating = $event;
actuallySubmit();
"
></score-selector>
@ -71,7 +71,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.monitoring.strengths"
v-model="item.monitoringStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -79,7 +79,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.monitoring.improvements"
v-model="item.monitoringImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -94,9 +94,9 @@
<b-col>
<h5>Control Procedural</h5>
<score-selector
:score-value="item.controlProcedural.rating"
:score-value="item.controlProceduralRating"
v-on:newselection="
item.controlProcedural.rating = $event;
item.controlProceduralRating = $event;
actuallySubmit();
"
></score-selector>
@ -105,7 +105,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.controlProcedural.strengths"
v-model="item.controlProceduralStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -113,7 +113,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.controlProcedural.improvements"
v-model="item.controlProceduralImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -128,9 +128,9 @@
<b-col>
<h5>Control</h5>
<score-selector
:score-value="item.control.rating"
:score-value="item.controlRating"
v-on:newselection="
item.control.rating = $event;
item.controlRating = $event;
actuallySubmit();
"
></score-selector>
@ -139,7 +139,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.control.strengths"
v-model="item.controlStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -147,7 +147,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.control.improvements"
v-model="item.controlImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -162,9 +162,9 @@
<b-col>
<h5>Conservatism</h5>
<score-selector
:score-value="item.conservatism.rating"
:score-value="item.conservatismRating"
v-on:newselection="
item.conservatism.rating = $event;
item.conservatismRating = $event;
actuallySubmit();
"
></score-selector>
@ -173,7 +173,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.conservatism.strengths"
v-model="item.conservatismStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -181,7 +181,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.conservatism.improvements"
v-model="item.conservatismImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -196,9 +196,9 @@
<b-col>
<h5>Teamwork Communications</h5>
<score-selector
:score-value="item.teamworkCommunications.rating"
:score-value="item.teamworkCommunicationsRating"
v-on:newselection="
item.teamworkCommunications.rating = $event;
item.teamworkCommunicationsRating = $event;
actuallySubmit();
"
></score-selector>
@ -207,7 +207,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.teamworkCommunications.strengths"
v-model="item.teamworkCommunicationsStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -215,7 +215,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkCommunications.improvements"
v-model="item.teamworkCommunicationsImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -230,9 +230,9 @@
<b-col>
<h5>Teamwork Leadership</h5>
<score-selector
:score-value="item.teamworkLeadership.rating"
:score-value="item.teamworkLeadershipRating"
v-on:newselection="
item.teamworkLeadership.rating = $event;
item.teamworkLeadershipRating = $event;
actuallySubmit();
"
></score-selector>
@ -241,7 +241,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.teamworkLeadership.strengths"
v-model="item.teamworkLeadershipStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -249,7 +249,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkLeadership.improvements"
v-model="item.teamworkLeadershipImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -264,9 +264,9 @@
<b-col>
<h5>Teamwork Workload</h5>
<score-selector
:score-value="item.teamworkWorkload.rating"
:score-value="item.teamworkWorkloadRating"
v-on:newselection="
item.teamworkWorkload.rating = $event;
item.teamworkWorkloadRating = $event;
actuallySubmit();
"
></score-selector>
@ -275,7 +275,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.teamworkWorkload.strengths"
v-model="item.teamworkWorkloadStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -283,7 +283,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkWorkload.improvements"
v-model="item.teamworkWorkloadImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -298,9 +298,9 @@
<b-col>
<h5>Knowledge</h5>
<score-selector
:score-value="item.knowledge.rating"
:score-value="item.knowledgeRating"
v-on:newselection="
item.knowledge.rating = $event;
item.knowledgeRating = $event;
actuallySubmit();
"
></score-selector>
@ -309,7 +309,7 @@
<b-row>
<b-col>
<b-form-textarea
v-model="item.knowledge.strengths"
v-model="item.knowledgeStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -317,7 +317,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.knowledge.improvements"
v-model="item.knowledgeImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -385,46 +385,30 @@ export default {
addAnotherObservation: function(newTitle) {
this.scenarios.push({
title: newTitle,
monitoring: {
rating: 0,
strengths: "",
improvements: ""
},
controlProcedural: {
rating: 0,
strengths: "",
improvements: ""
},
control: {
rating: 0,
strengths: "",
improvements: ""
},
conservatism: {
rating: 0,
strengths: "",
improvements: ""
},
teamworkCommunications: {
rating: 0,
strengths: "",
improvements: ""
},
teamworkLeadership: {
rating: 0,
strengths: "",
improvements: ""
},
teamworkWorkload: {
rating: 0,
strengths: "",
improvements: ""
},
knowledge: {
rating: 0,
strengths: "",
improvements: ""
}
monitoringRating: 0,
monitoringStrengths: "",
monitoringImprovements: "",
controlProceduralRating: 0,
controlProceduralStrengths: "",
controlProceduralImprovements: "",
controlRating: 0,
controlStrengths: "",
controlImprovements: "",
conservatismRating: 0,
conservatismStrengths: "",
conservatismImprovements: "",
teamworkCommunicationsRating: 0,
teamworkCommunicationsStrengths: "",
teamworkCommunicationsImprovements: "",
teamworkLeadershipRating: 0,
teamworkLeadershipStrengths: "",
teamworkLeadershipImprovements: "",
teamworkWorkloadRating: 0,
teamworkWorkloadStrengths: "",
teamworkWorkloadImprovements: "",
knowledgeRating: 0,
knowledgeStrengths: "",
knowledgeImprovements: ""
});
},
actuallySubmit() {

View File

@ -151,16 +151,16 @@
<b-col cols="4">
<h5>Monitoring</h5>
<score-selector
:score-value="item.monitoring.rating"
:score-value="item.monitoringRating"
v-on:newselection="
item.monitoring.rating = $event;
item.monitoringRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.monitoring.strengths"
v-model="item.monitoringStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -168,7 +168,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.monitoring.improvements"
v-model="item.monitoringImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -183,16 +183,16 @@
<b-col cols="4">
<h5>Control Procedural</h5>
<score-selector
:score-value="item.controlProcedural.rating"
:score-value="item.controlProceduralRating"
v-on:newselection="
item.controlProcedural.rating = $event;
item.controlProceduralRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.controlProcedural.strengths"
v-model="item.controlProceduralStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -200,7 +200,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.controlProcedural.improvements"
v-model="item.controlProceduralImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -217,16 +217,16 @@
<b-col cols="4">
<h5>Control</h5>
<score-selector
:score-value="item.control.rating"
:score-value="item.controlRating"
v-on:newselection="
item.control.rating = $event;
item.controlRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.control.strengths"
v-model="item.controlStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -234,7 +234,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.control.improvements"
v-model="item.controlImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -249,16 +249,16 @@
<b-col cols="4">
<h5>Conservatism</h5>
<score-selector
:score-value="item.conservatism.rating"
:score-value="item.conservatismRating"
v-on:newselection="
item.conservatism.rating = $event;
item.conservatismRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.conservatism.strengths"
v-model="item.conservatismStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -266,7 +266,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.conservatism.improvements"
v-model="item.conservatismImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -283,16 +283,16 @@
<b-col cols="4">
<h5>Teamwork Communications</h5>
<score-selector
:score-value="item.teamworkCommunications.rating"
:score-value="item.teamworkCommunicationsRating"
v-on:newselection="
item.teamworkCommunications.rating = $event;
item.teamworkCommunicationsRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.teamworkCommunications.strengths"
v-model="item.teamworkCommunicationsStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -300,7 +300,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkCommunications.improvements"
v-model="item.teamworkCommunicationsImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -315,16 +315,16 @@
<b-col cols="4">
<h5>Teamwork Leadership</h5>
<score-selector
:score-value="item.teamworkLeadership.rating"
:score-value="item.teamworkLeadershipRating"
v-on:newselection="
item.teamworkLeadership.rating = $event;
item.teamworkLeadershipRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.teamworkLeadership.strengths"
v-model="item.teamworkLeadershipStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -332,7 +332,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkLeadership.improvements"
v-model="item.teamworkLeadershipImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -349,16 +349,16 @@
<b-col cols="4">
<h5>Teamwork Workload</h5>
<score-selector
:score-value="item.teamworkWorkload.rating"
:score-value="item.teamworkWorkloadRating"
v-on:newselection="
item.teamworkWorkload.rating = $event;
item.teamworkWorkloadRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.teamworkWorkload.strengths"
v-model="item.teamworkWorkloadStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -366,7 +366,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.teamworkWorkload.improvements"
v-model="item.teamworkWorkloadImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -381,16 +381,16 @@
<b-col cols="4">
<h5>Knowledge</h5>
<score-selector
:score-value="item.knowledge.rating"
:score-value="item.knowledgeRating"
v-on:newselection="
item.knowledge.rating = $event;
item.knowledgeRating = $event;
updateTotals();
"
></score-selector>
</b-col>
<b-col cols="8">
<b-form-textarea
v-model="item.knowledge.strengths"
v-model="item.knowledgeStrengths"
placeholder="Strengths"
:rows="1"
:max-rows="2"
@ -398,7 +398,7 @@
class="strength"
></b-form-textarea>
<b-form-textarea
v-model="item.knowledge.improvements"
v-model="item.knowledgeImprovements"
placeholder="AFIs"
:rows="1"
:max-rows="2"
@ -479,46 +479,30 @@ export default {
scenarios: [
{
title: "",
monitoring: {
rating: null,
strengths: "",
improvements: ""
},
controlProcedural: {
rating: null,
strengths: "",
improvements: ""
},
control: {
rating: null,
strengths: "",
improvements: ""
},
conservatism: {
rating: null,
strengths: "",
improvements: ""
},
teamworkCommunications: {
rating: null,
strengths: "",
improvements: ""
},
teamworkLeadership: {
rating: null,
strengths: "",
improvements: ""
},
teamworkWorkload: {
rating: null,
strengths: "",
improvements: ""
},
knowledge: {
rating: null,
strengths: "",
improvements: ""
}
monitoringRating: null,
monitoringStrengths: "",
monitoringImprovements: "",
controlProceduralRating: null,
controlProceduralStrengths: "",
controlProceduralImprovements: "",
controlRating: null,
controlStrengths: "",
controlImprovements: "",
conservatismRating: null,
conservatismStrengths: "",
conservatismImprovements: "",
teamworkCommunicationsRating: null,
teamworkCommunicationsStrengths: "",
teamworkCommunicationsImprovements: "",
teamworkLeadershipRating: null,
teamworkLeadershipStrengths: "",
teamworkLeadershipImprovements: "",
teamworkWorkloadRating: null,
teamworkWorkloadStrengths: "",
teamworkWorkloadImprovements: "",
knowledgeRating: null,
knowledgeStrengths: "",
knowledgeImprovements: ""
}
],
totals: [0, 0, 0, 0, 0, 0, 0, 0],
@ -533,46 +517,30 @@ export default {
addAnotherObservation: function() {
this.scenarios.push({
title: "",
monitoring: {
rating: null,
strengths: "",
improvements: ""
},
controlProcedural: {
rating: null,
strengths: "",
improvements: ""
},
control: {
rating: null,
strengths: "",
improvements: ""
},
conservatism: {
rating: null,
strengths: "",
improvements: ""
},
teamworkCommunications: {
rating: null,
strengths: "",
improvements: ""
},
teamworkLeadership: {
rating: null,
strengths: "",
improvements: ""
},
teamworkWorkload: {
rating: null,
strengths: "",
improvements: ""
},
knowledge: {
rating: null,
strengths: "",
improvements: ""
}
monitoringRating: null,
monitoringStrengths: "",
monitoringImprovements: "",
controlProceduralRating: null,
controlProceduralStrengths: "",
controlProceduralImprovements: "",
controlRating: null,
controlStrengths: "",
controlImprovements: "",
conservatismRating: null,
conservatismStrengths: "",
conservatismImprovements: "",
teamworkCommunicationsRating: null,
teamworkCommunicationsStrengths: "",
teamworkCommunicationsImprovements: "",
teamworkLeadershipRating: null,
teamworkLeadershipStrengths: "",
teamworkLeadershipImprovements: "",
teamworkWorkloadRating: null,
teamworkWorkloadStrengths: "",
teamworkWorkloadImprovements: "",
knowledgeRating: null,
knowledgeStrengths: "",
knowledgeImprovements: ""
});
Vue.nextTick(function() {
window.scrollTo(
@ -592,36 +560,36 @@ export default {
var iTotals = [0, 0, 0, 0, 0, 0, 0, 0];
var counts = [0, 0, 0, 0, 0, 0, 0, 0];
this.scenarios.forEach(function(element) {
if (element.monitoring.rating) {
iTotals[0] += parseInt(element.monitoring.rating);
if (element.monitoringRating) {
iTotals[0] += parseInt(element.monitoringRating);
counts[0] += 1;
}
if (element.controlProcedural.rating) {
iTotals[1] += parseInt(element.controlProcedural.rating);
if (element.controlProceduralRating) {
iTotals[1] += parseInt(element.controlProceduralRating);
counts[1] += 1;
}
if (element.control.rating) {
iTotals[2] += parseInt(element.control.rating);
if (element.controlRating) {
iTotals[2] += parseInt(element.controlRating);
counts[2] += 1;
}
if (element.conservatism.rating) {
iTotals[3] += parseInt(element.conservatism.rating);
if (element.conservatismRating) {
iTotals[3] += parseInt(element.conservatismRating);
counts[3] += 1;
}
if (element.teamworkCommunications.rating) {
iTotals[4] += parseInt(element.teamworkCommunications.rating);
if (element.teamworkCommunicationsRating) {
iTotals[4] += parseInt(element.teamworkCommunicationsRating);
counts[4] += 1;
}
if (element.teamworkLeadership.rating) {
iTotals[5] += parseInt(element.teamworkLeadership.rating);
if (element.teamworkLeadershipRating) {
iTotals[5] += parseInt(element.teamworkLeadershipRating);
counts[5] += 1;
}
if (element.teamworkWorkload.rating) {
iTotals[6] += parseInt(element.teamworkWorkload.rating);
if (element.teamworkWorkloadRating) {
iTotals[6] += parseInt(element.teamworkWorkloadRating);
counts[6] += 1;
}
if (element.knowledge.rating) {
iTotals[7] += parseInt(element.knowledge.rating);
if (element.knowledgeRating) {
iTotals[7] += parseInt(element.knowledgeRating);
counts[7] += 1;
}
});

View File

@ -258,41 +258,57 @@
</b-row>
<b-row>
<observation-entry
:scenariofundamental="entry.monitoring"
:rating="entry.monitoringRating"
:strengths="entry.monitoringStrengths"
:improvements="entry.monitoringImprovements"
:description="'Monitoring'"
></observation-entry>
<observation-entry
:scenariofundamental="entry.controlProcedural"
:rating="entry.controlProceduralRating"
:strengths="entry.controlProceduralStrengths"
:improvements="entry.controlProceduralImprovements"
:description="'Control Procedural'"
></observation-entry>
</b-row>
<b-row>
<observation-entry
:scenariofundamental="entry.control"
:rating="entry.controlRating"
:strengths="entry.controlStrengths"
:improvements="entry.controlImprovements"
:description="'Control'"
></observation-entry>
<observation-entry
:scenariofundamental="entry.conservatism"
:rating="entry.conservatismRating"
:strengths="entry.conservatismStrengths"
:improvements="entry.conservatismImprovements"
:description="'Conservatism'"
></observation-entry>
</b-row>
<b-row>
<observation-entry
:scenariofundamental="entry.teamworkCommunications"
:rating="entry.teamworkCommunicationsRating"
:strengths="entry.teamworkCommunicationsStrengths"
:improvements="entry.teamworkCommunicationsImprovements"
:description="'Teamwork Communications'"
></observation-entry>
<observation-entry
:scenariofundamental="entry.teamworkLeadership"
:rating="entry.teamworkLeadershipRating"
:strengths="entry.teamworkLeadershipStrengths"
:improvements="entry.teamworkLeadershipImprovements"
:description="'Teamwork Leadership'"
></observation-entry>
</b-row>
<b-row>
<observation-entry
:scenariofundamental="entry.teamworkWorkload"
:rating="entry.teamworkWorkloadRating"
:strengths="entry.teamworkWorkloadStrengths"
:improvements="entry.teamworkWorkloadImprovements"
:description="'Teamwork Workload'"
></observation-entry>
<observation-entry
:scenariofundamental="entry.knowledge"
:rating="entry.knowledgeRating"
:strengths="entry.knowledgeStrengths"
:improvements="entry.knowledgeImprovements"
:description="'Knowledge'"
></observation-entry>
</b-row>