diff --git a/help/data_xample.js b/help/data_xample.js index f846b15..41f2827 100644 --- a/help/data_xample.js +++ b/help/data_xample.js @@ -109,7 +109,13 @@ async function createTemp() { ], "result": [ ["Gut, weil ...", 5], - ["Schlecht, weil ...", 1] + ["Schlecht, weil ...", 1], + ["Lorem ipsum dolor sit amet", 2], + ["consetetur sadipscing elitr, sed diam ", 3], + [" nonumy eirmod tempor invidunt ut labore ", 4], + ["et dolore magna aliquyam erat, sed diam", 5], + [" voluptua. At vero eos et accusam et justo duo", 1], + ["the end", 5] ], "result_history": [ { @@ -120,7 +126,13 @@ async function createTemp() { ], "result": [ ["Gut, weil ...", 5], - ["Schlecht, weil ...", 1] + ["Schlecht, weil ...", 1], + ["Lorem ipsum dolor sit amet", 2], + ["consetetur sadipscing elitr, sed diam ", 3], + [" nonumy eirmod tempor invidunt ut labore ", 4], + ["et dolore magna aliquyam erat, sed diam", 5], + [" voluptua. At vero eos et accusam et justo duo", 1], + ["the end", 5] ] } ], diff --git a/prof/kursAnzeige.html b/prof/kursAnzeige.html index e7c8aad..8cda212 100644 --- a/prof/kursAnzeige.html +++ b/prof/kursAnzeige.html @@ -116,11 +116,21 @@ setUserData(couchDB); break; case "scala": - let score = 0; - for(let j = 0; j < courseInfo.result.length; j++) {score += courseInfo.result[j][index]}; - score = score / courseInfo.result.length; - const percent = (score/5)*100; - + var score = 0; + for (let j = 0; j < courseInfo.result.length; j++) { + score += courseInfo.result[j][index]; + } + var percent; + if (courseInfo.result.length > 0) { + score = score / courseInfo.result.length; + percent = (score/5)*100; + } else { + score = 0; + percent = 0; + } + + console.log(courseInfo.result.length); + const resultDisplay = document.createElement("div"); resultDisplay.className = "overlayScalaRes" resultDisplay.innerHTML = ` diff --git a/prof/uebersicht.html b/prof/uebersicht.html index e895f47..cb58f49 100644 --- a/prof/uebersicht.html +++ b/prof/uebersicht.html @@ -558,7 +558,7 @@ function createEvaluation(question) { `; return div;