A rating of 0 can now be used to represent an unrated fundamental

This commit is contained in:
neviyn 2020-09-17 13:36:44 +01:00
parent 806a47228a
commit 5a9906bb22

View File

@ -93,7 +93,7 @@ data class Observation(
) {
fun toCsvFormat(): String {
fun escapeSpecialCharacters(data: String): String {
return data.replace("\"", "\"\"")
return data.replace("\"", "\"\"").replace("\n", "")
}
val dataPortion = "${date.toString("dd/MM/yyyy")},\"$person, ${type.name} ${scenarios.joinToString { it.title }}\"," +
"\"Training\",\"Operations - Shift Operations\",\"${site.name}\",\"N/A\"," +
@ -121,7 +121,7 @@ data class Observation(
}
private fun roundScore(input: Double?): String {
if (input != null) {
if (input != null && input > 0) {
return input.roundToInt().toString()
}
return ""
@ -185,7 +185,7 @@ data class Scenario(
) {
private fun ratingValid(rating: Byte): Boolean {
return rating in 1..5
return rating in 0..5
}
fun ratingsAllValid(): Boolean {
return ratingValid(monitoringRating) &&