From eb75e16a39d953c55d74c0cd76fbe7b862ac9e80 Mon Sep 17 00:00:00 2001 From: rbenjos Date: Tue, 29 Jun 2021 18:43:06 +0300 Subject: [PATCH] fixed the bug of the progress update methods --- .../src/components/ProgressBox.vue | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/Closure_Front_End/src/components/ProgressBox.vue b/Closure_Front_End/src/components/ProgressBox.vue index 1bb0f6aa..171ff2b5 100644 --- a/Closure_Front_End/src/components/ProgressBox.vue +++ b/Closure_Front_End/src/components/ProgressBox.vue @@ -3,14 +3,18 @@
סך הכל: - + 15%
חובה: - + 15%
@@ -19,7 +23,7 @@ חובת בחירה: 15% @@ -28,7 +32,7 @@
בחירה: - + 15%
@@ -43,28 +47,39 @@ export default { total: 50, mandatory: 30, mand_choice: 20, - choice: 15 + choice: 15, }; }, methods: { + /** + * a helper method for grouping courses. + * will be mostly used to group by type + */ groupBy: function (xs, key) { return xs.reduce(function (rv, x) { (rv[x[key]] = rv[x[key]] || []).push(x); return rv; }, {}); }, - sum: function(allcourses, index){ - var courses = this.groupBy(this.allcourses, "type")[index]; - var sum = 0; - for (var i = 0; i