[O] Remove unnecessary average() method
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
<div id="assignment-type-head">
|
<div id="assignment-type-head">
|
||||||
<el-card :body-style="{padding: '0px'}">
|
<el-card :body-style="{padding: '0px'}">
|
||||||
<div id="type-info-card">
|
<div id="type-info-card">
|
||||||
<span id="type-average">Average: {{average.toFixed(2)}}%</span>
|
|
||||||
<span id="type-name">{{type.name}}</span>
|
<span id="type-name">{{type.name}}</span>
|
||||||
|
<span id="type-average">Average: {{(type.score / type.scoreMax * 100).toFixed(2)}}%</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AssignmentEntry v-for="assignment of filteredAssignments" :key="assignment.id"
|
<AssignmentEntry v-for="assignment of filteredAssignments" :key="assignment.id"
|
||||||
@@ -32,12 +32,6 @@
|
|||||||
// Filter assignments to only this type
|
// Filter assignments to only this type
|
||||||
return this.assignments.filter(a => a.complete == 'Complete' && a.type == this.typeName);
|
return this.assignments.filter(a => a.complete == 'Complete' && a.type == this.typeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
get average()
|
|
||||||
{
|
|
||||||
return this.filteredAssignments.reduce((a, b) => a + b.score, 0) /
|
|
||||||
this.filteredAssignments.reduce((a, b) => a + b.scoreMax, 0) * 100;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user