Always display MMS when choosing SCOREX placement criterium

This commit is contained in:
Claude Brisson
2024-08-19 12:50:03 +02:00
parent b039a549e3
commit 7232e69de7
3 changed files with 12 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -60,7 +60,14 @@
#foreach($r in [1..$round])
<th>R$r</th>
#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)
<th>$crit</th>
#end
</thead>
@@ -87,7 +94,7 @@
#end
<td class="nobreak game-result" #if($opponent)title="$esc.html($opponent.name)#if($opponent.firstname) $esc.html($opponent.firstname)#end #rank($opponent.rank)#if($opponent.country) $opponent.country#end"#end>$rst</td>
#end
#foreach($crit in $tour.pairing.placement)
#foreach($crit in $criteres)
<td>$number.format('0.#', $part[$crit])</td>
#end
</tr>