Hello There,
I need to calculate student progress in percentage. Let’s say there are 10 courses that they need to complete and so far they finished 5. I need to show there progress in percentage.
I have a collection studentProgress, which has an array field student.
Student:Array
{“courseId”:
“courseName”:“Social”,
“status”:“completed”
“score”:50
},
{
{“courseId”:
“courseName”:“Math”,
“status”:“completed”
“score”:80
},
Something like above. I need to show this gauge chart. First I added new fields by calculating Total Courses($size:“$student) and then size of the score Total Completed($size:”$student.score").
Individually they are giving me right answers, but when I put them all together like
{$multiply:
[{ $divide:
[“$TotalCompleted”,“$TotalCourses”] },
100
]
}
It isn’t giving me the right answer. I feel like there is something wrong with calculating Total Courses field.
Would someone please help me with this.
Thanks in advance.
Sunita