Simplified rating validity check

This commit is contained in:
neviyn 2019-03-05 11:42:54 +00:00
parent 4e81e9a5b9
commit 0ec96a874d

View File

@ -122,7 +122,11 @@ data class RatingComponent(
val rating: Int,
val strengths: String = "",
val improvements: String = ""
)
) {
fun ratingValid(): Boolean {
return rating in 1..5
}
}
@Entity
data class Scenario(
@ -149,15 +153,14 @@ data class Scenario(
) {
fun ratingsAllValid(): Boolean {
val limitation = 1..5
return monitoring.rating in limitation &&
controlProcedural.rating in limitation &&
control.rating in limitation &&
conservatism.rating in limitation &&
teamworkCommunications.rating in limitation &&
teamworkLeadership.rating in limitation &&
teamworkWorkload.rating in limitation &&
knowledge.rating in limitation
return monitoring.ratingValid() &&
controlProcedural.ratingValid()&&
control.ratingValid() &&
conservatism.ratingValid() &&
teamworkCommunications.ratingValid() &&
teamworkLeadership.ratingValid() &&
teamworkWorkload.ratingValid() &&
knowledge.ratingValid()
}
}