|
@ -12,7 +12,7 @@ |
|
|
refresh as refreshTaskStatuses, |
|
|
refresh as refreshTaskStatuses, |
|
|
taskStatuses, |
|
|
taskStatuses, |
|
|
} from "./task-status-cache"; |
|
|
} from "./task-status-cache"; |
|
|
import { isLoggedIn } from "./ksp-task-grabber"; |
|
|
import { grabAssignment, isLoggedIn } from "./ksp-task-grabber"; |
|
|
|
|
|
|
|
|
export let tasks: TasksFile; |
|
|
export let tasks: TasksFile; |
|
|
|
|
|
|
|
@ -201,6 +201,22 @@ |
|
|
tasks.tasks = [...tasks.tasks, ...newDescriptors]; |
|
|
tasks.tasks = [...tasks.tasks, ...newDescriptors]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function loadMaxPoints() { |
|
|
|
|
|
const loadedTasks = await Promise.all(tasks.tasks.map(async t => { |
|
|
|
|
|
if (t.type != "open-data") { |
|
|
|
|
|
return t |
|
|
|
|
|
} |
|
|
|
|
|
const a = await grabAssignment(t.taskReference) |
|
|
|
|
|
if (a.points == null) |
|
|
|
|
|
throw Error(`Points are null for ${t.taskReference}`) |
|
|
|
|
|
return { ...t, points: a.points } |
|
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
tasks = { ...tasks, tasks: loadedTasks } |
|
|
|
|
|
|
|
|
|
|
|
alert("Načteno :)") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function hideSelection() { |
|
|
function hideSelection() { |
|
|
for (let t of graph.getCurrentSelection()) { |
|
|
for (let t of graph.getCurrentSelection()) { |
|
|
t.hidden = true; |
|
|
t.hidden = true; |
|
@ -373,8 +389,15 @@ |
|
|
<button |
|
|
<button |
|
|
on:click={loadYear} |
|
|
on:click={loadYear} |
|
|
disabled={!isLoggedIn()} |
|
|
disabled={!isLoggedIn()} |
|
|
title={isLoggedIn() ? 'Nahraje všechny úlohy z jednoho ročníku, které tu ještě nejsou' : 'Je nutné být přihlášený a na stránce v KSP template.'}>Nahrát |
|
|
title={isLoggedIn() ? 'Nahraje všechny úlohy z jednoho ročníku, které tu ještě nejsou' : 'Je nutné být přihlášený a na stránce v KSP template.'}> |
|
|
celý ročník</button> |
|
|
Nahrát celý ročník |
|
|
|
|
|
</button> |
|
|
|
|
|
<button |
|
|
|
|
|
on:click={loadMaxPoints} |
|
|
|
|
|
title="Stáhne ke každé úloze maximální počet bodů" |
|
|
|
|
|
> |
|
|
|
|
|
Aktualizovat počty bodů |
|
|
|
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
<div> |
|
|
<button on:click={hideSelection}>Skrýt výběr</button> |
|
|
<button on:click={hideSelection}>Skrýt výběr</button> |
|
|