public/leaders.js
// show user's score for selected track
show user's score for selected track
show user ' s score for selected track
async function loadUserTrackResult(trackName) {
    let track = document.getElementById("studentTracks");
    const data = await fetch ("/api?action=getresults&track=" + track.value);
    const formatted = await data.json();
    document.getElementById("userResults").innerHTML = "Your score for the " + trackName + " track is " + (formatted.postscore / 5 * 100) + "%";
}
async function loadUserTrackResult ( trackName ) { let track = document . getElementById ( "studentTracks" ) ; const data = await fetch ( "/api?action=getresults&track=" + track . value ) ; const formatted = await data . json ( ) ; document . getElementById ( "userResults" ) . innerHTML = "Your score for the " + trackName + " track is " + ( formatted . postscore / 5 * 100 ) + "%" ; }
show user's score for selected track
show user ' s score for selected track