Skip to content
Permalink
Browse files
fixed placement calculation issue
  • Loading branch information
Tom Singleton committed Mar 24, 2017
1 parent 178f7f7 commit 4d8b70ae5d00c7fddb4496979ec76f5638e19ee8
Showing 1 changed file with 5 additions and 3 deletions.
@@ -130,6 +130,8 @@ if (secondParseInfo.noOf40 > 0 && secondParseInfo.totalCredits !== 160) {
process.exit(1)
}

const placementModulesRemoval = secondParseInfo.noOf40>0 ? 2 : 1

console.log("Second year looks good 😄")

const thirdParseInfo = {
@@ -220,7 +222,7 @@ console.log(`Second year w/o placement: ${best120SecondYearWOPlacement.avgGrade}

console.log("Calculating second year '120' credits w/ placement")

const best120SecondYearWPlacement = { modules: removeLowestCreditModules(flattenedSecondYear, 2) }
const best120SecondYearWPlacement = { modules: removeLowestCreditModules(flattenedSecondYear, placementModulesRemoval) }
best120SecondYearWPlacement.avgGrade = averageGrade(best120SecondYearWPlacement.modules)

console.log(`Second year w/ placement: ${best120SecondYearWPlacement.avgGrade}%`)
@@ -234,7 +236,7 @@ console.log(`Second year w/o placement: ${best110SecondYearWOPlacement.avgGrade}

console.log("Calculating second year '110' credits w/ placement")

const best110SecondYearWPlacement = { modules: removeLowestCreditModules(removeLowestCreditModules(secondYear, 2), 1, 10) }
const best110SecondYearWPlacement = { modules: removeLowestCreditModules(removeLowestCreditModules(secondYear, placementModulesRemoval), 1, 10) }
best110SecondYearWPlacement.avgGrade = averageGrade(best110SecondYearWPlacement.modules)

console.log(`Second year w/ placement: ${best110SecondYearWPlacement.avgGrade}%`)
@@ -248,7 +250,7 @@ console.log(`Second year w/o placement: ${best100SecondYearWOPlacement.avgGrade}

console.log("Calculating second year '100' credits w/ placement")

const best100SecondYearWPlacement = { modules: removeLowestCreditModules(flattenedSecondYear, 3) }
const best100SecondYearWPlacement = { modules: removeLowestCreditModules(flattenedSecondYear, placementModulesRemoval+1) }
best100SecondYearWPlacement.avgGrade = averageGrade(best100SecondYearWPlacement.modules)

console.log(`Second year w/ placement: ${best100SecondYearWPlacement.avgGrade}%`)

0 comments on commit 4d8b70a

Please sign in to comment.