newUI #1
@ -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) &&
|
||||
|
Loading…
Reference in New Issue
Block a user