diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiTools.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiTools.kt index 22817dd..8017344 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiTools.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiTools.kt @@ -34,6 +34,7 @@ fun Tournament<*>.getSortedPairables(round: Int, includePreliminary: Boolean = f else ceil(score - epsilon) } + // CB TODO - factorize history helper creation between here and solver classes val historyHelper = HistoryHelper(historyBefore(round + 1)) { if (pairing.type == PairingType.SWISS) wins.mapValues { Pair(0.0, it.value) } else pairables.mapValues { diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt index f7f69fc..e103ac1 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt @@ -92,6 +92,9 @@ object StandingsHandler: PairgothApiHandler { response.contentType = "text/plain;charset=${encoding}" val neededCriteria = ArrayList(tournament.pairing.placementParams.criteria) if (!neededCriteria.contains(NBW)) neededCriteria.add(NBW) + if (neededCriteria.first() == SCOREX) { + neededCriteria.add(1, MMS) + } exportToEGFFormat(tournament, sortedPairables, neededCriteria, writer) writer.flush() return null diff --git a/view-webapp/src/main/webapp/tour-standings.inc.html b/view-webapp/src/main/webapp/tour-standings.inc.html index 573fa78..c46e3f9 100644 --- a/view-webapp/src/main/webapp/tour-standings.inc.html +++ b/view-webapp/src/main/webapp/tour-standings.inc.html @@ -60,7 +60,14 @@ #foreach($r in [1..$round]) R$r #end +#set($criteres = []) #foreach($crit in $tour.pairing.placement) + #set($junk = $criteres.add($crit)) +#end +#if($criteres[0] == 'SCOREX') + #set($junk = $criteres.add(1, 'MMS')) +#end +#foreach($crit in $criteres) $crit #end @@ -87,7 +94,7 @@ #end $rst #end - #foreach($crit in $tour.pairing.placement) + #foreach($crit in $criteres) $number.format('0.#', $part[$crit]) #end