Repository: learningequality/kolibri

Issue:
Exam Report shows progress status of students as completed even though they are still in progress.
### Observed behavior

As the learner begins the exam, the progress status of the learner changes from not started to completed even though the learners are in progress and still writing the exam.

### Expected behavior

The progress status of the learners who are still writing the exam must be shown as _in Progress_ or whatever the message is.


### User-facing consequences

The admin/coach will get confused whether the learners have completed the exam or not or are still in progress.



### Steps to reproduce

1.Login as admin and go to Coach---> Class---> Create exam---> Activate exam
2.Login as the student of the Class--->Select the class---> Select the exam--->And start the exam and solve and do not submit the exam. 
3.Login as admin and view the Exam Report of the student who started the paper. It will show completed but should have been in Progress.

Kolibri version : kolibri 0.9.0
Operating system : ubuntu 14.04
Browser : Chrome

### Screenshot
![12](https://user-images.githubusercontent.com/38091824/38411289-603537f2-39a4-11e8-94a8-45cce8f83a14.png)
![123](https://user-images.githubusercontent.com/38091824/38411290-6078b9be-39a4-11e8-910b-22b60a3011d3.png)




Discussion:
@mrpau-eugene 
@christianmemije the logic here might need to be different:

https://github.com/learningequality/kolibri/blob/4dbde1028eb0d863b0fe60faf2868a60df41256a/kolibri/plugins/coach/assets/src/views/exams/exam-report-page/index.vue#L68

The whole expression will evaluate to true if, on a 5-exercise exam,  a user has looked at all 5 exercises, but did not actually submit the exam.

Either the `||` needs to be a `&&`
```
(examTaker.progress === exam.question_count) && examTaker.closed
```

or maybe just check that `examTaker.closed`, in case the Learner submitted without going through the whole thing.
Actually, I'm noticing that `ExamLog.progress` goes straight to 100% after only engaging partway with the exam. (E.g. engage with one exercise, it goes straight to 100%)
This is when hitting the ExamLog endpoint. Weirdly, when getting the same data through the LearnerClassroom endpoint, the progress does look correct.
here's the culprit, i think

https://github.com/learningequality/kolibri/blame/develop/kolibri/logger/serializers.py#L23

In this commit:
https://github.com/learningequality/kolibri/commit/022151f1d1f37612ecef07e31c523e701e69fcc2

@mrpau-richard , I think you might need to adjust the logic here, since progress should be equal to the number of Exam exercises attempted, even if the exam is not completed.
@jonboiser Okay, i'll work on this.

Resolving patch:
diff --git a/kolibri/logger/serializers.py b/kolibri/logger/serializers.py
--- a/kolibri/logger/serializers.py
+++ b/kolibri/logger/serializers.py
@@ -20,7 +20,7 @@ class ExamLogSerializer(KolibriModelSerializer):
     score = serializers.SerializerMethodField()
 
     def get_progress(self, obj):
-        return obj.exam.question_count
+        return obj.attemptlogs.values_list('item').distinct().count()
 
     def get_score(self, obj):
         return obj.attemptlogs.values_list('item').order_by('completion_timestamp').distinct().aggregate(Sum('correct')).get('correct__sum')


Test patch: