-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small layout fixes for JAT from feedback:
- show both scores near commentary box - have save/delete buttons at both ends of the longer movement form - when opening the movment form, ensure the position is at the top - show total scores in the junction list - move controls to make it more clear whether we're editing existing/proposed
- Loading branch information
1 parent
0bf1876
commit 61d838f
Showing
3 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { JunctionAssessment } from "../data"; | ||
|
||
export function describeScore(ja: JunctionAssessment): string { | ||
if (ja.movements.length == 0) { | ||
return "No movements added"; | ||
} | ||
|
||
let score = 0; | ||
let totalPossible = 0; | ||
for (let m of ja.movements) { | ||
score += { | ||
0: 0, | ||
1: 1, | ||
2: 2, | ||
X: 0, | ||
}[m.score]; | ||
totalPossible += 2; | ||
} | ||
let percent = (score / totalPossible) * 100; | ||
return `${Math.round(percent)}%`; | ||
} |