Skip to content

Commit

Permalink
Merge pull request #8 from refact0r/log-period-dates
Browse files Browse the repository at this point in the history
Log period dates
  • Loading branch information
refact0r authored Oct 31, 2023
2 parents d10ad71 + b5c3475 commit 97194c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/lib/js/parseData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ export function parseData(session, oldAssignments) {

course.scoreTypes = {}
if (course.Marks.Mark.GradeCalculationSummary.AssignmentGradeCalc) {
for (let type of course.Marks.Mark.GradeCalculationSummary
.AssignmentGradeCalc) {
let gradeCalc = course.Marks.Mark.GradeCalculationSummary.AssignmentGradeCalc
if (!Array.isArray(gradeCalc)) {
gradeCalc = [gradeCalc]
}
for (let type of gradeCalc) {
if (parseInt(type.Weight) !== 100.0) {
course.scoreTypes[type.Type] = {
score: 0,
Expand Down
1 change: 1 addition & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
return
}
const json = await res.json()
console.log(json)
let { student, periods, currentPeriod } = json
$session = {
student,
Expand Down
3 changes: 2 additions & 1 deletion src/routes/data/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export async function GET({ locals }) {
JSON.stringify({
student: result.shift(),
periods: result,
currentPeriod
currentPeriod,
periodDates: result[1].ReportingPeriods.ReportPeriod
}),
{
headers: {
Expand Down

0 comments on commit 97194c3

Please sign in to comment.