Skip to content

Commit

Permalink
Add calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Branchverse committed May 13, 2022
1 parent 6f54d2e commit 1ec6f62
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions noten-durchschnitt/actualcodefile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// const results =

const totals = results.reduce((result,entry) => {
if(entry.kind == "Grundstudium" && entry.status == "bestanden" && entry.mark != null){
result.GrStNote += entry.mark * entry.ects
result.GrStECTS += entry.ects
}

if(entry.kind == "Hauptstudium" && entry.status == "bestanden" && entry.mark != null){
result.HpStNote += entry.mark * entry.ects
result.HpStECTS += entry.ects
}
return result

}, {GrStNote: 0.0, GrStECTS: 0, HpStNote: 0.0, HpStECTS: 0})

const averages = {
GrAvg: totals.GrStNote / totals.GrStECTS,
HpAvg: totals.HpStNote / totals.HpStECTS,
BcAvg: (totals.GrStNote + totals.HpStNote) / (totals.GrStECTS + totals.HpStECTS)
}

const GrWeight = 0.15
const HpWeight = 0.70
const BcWeight = 0.15

const prediction = {
GrPred: averages.GrAvg * GrWeight + averages.HpAvg * HpWeight + averages.BcAvg * BcWeight,
}
console.log(totals)
console.log(averages)
console.log(prediction);
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "make-hdm-great-again",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dopeshot/make-hdm-great-again.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/dopeshot/make-hdm-great-again/issues"
},
"homepage": "https://github.com/dopeshot/make-hdm-great-again#readme"
}

0 comments on commit 1ec6f62

Please sign in to comment.