Fixed loading of points when logged in
This commit is contained in:
parent
19c989c8a0
commit
2ff70f3fff
1 changed files with 5 additions and 2 deletions
|
@ -160,8 +160,11 @@ function parseTaskStatuses(doc: HTMLDocument): TaskStatus[] {
|
||||||
const pointsStr = r.cells[4].textContent!.trim()
|
const pointsStr = r.cells[4].textContent!.trim()
|
||||||
const pointsMatch = /((–|\.|\d)+) *\/ *(\d+)/.exec(pointsStr)
|
const pointsMatch = /((–|\.|\d)+) *\/ *(\d+)/.exec(pointsStr)
|
||||||
if (!pointsMatch) throw new Error()
|
if (!pointsMatch) throw new Error()
|
||||||
const points = +pointsMatch[1]
|
let points = +pointsMatch[2]
|
||||||
const maxPoints = +pointsMatch[2]
|
if (isNaN(points)) {
|
||||||
|
points = 0
|
||||||
|
}
|
||||||
|
const maxPoints = +pointsMatch[3]
|
||||||
const solved = r.classList.contains("zs-submitted")
|
const solved = r.classList.contains("zs-submitted")
|
||||||
return { id, name, submitted, type, points, maxPoints, solved }
|
return { id, name, submitted, type, points, maxPoints, solved }
|
||||||
})
|
})
|
||||||
|
|
Reference in a new issue