We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
After submitting the exam the learner is still allowed to start the exam.
## Summary
After submitting the exam the learner is still allowed to start the exam. Where as it should show the **Completed** and the learner should not be allowed to retake.


## System information

 - Version: Kolibri 0.4.0aplha2
 - Operating system: Ubuntu 14.04 LTS
 - Browser: Chrome browser and Firefox


## How to reproduce

1. Login as a learner
2. Start giving an exam.
3. Enter all the answers.
4. Click on submit exam.
5. Ideally the learner should be given completed exam status.

## Screenshots
Before Exam
![before](https://cloud.githubusercontent.com/assets/12776071/25124398/3ab80a34-2449-11e7-993b-ff22a4f9b55c.png)

![mid](https://cloud.githubusercontent.com/assets/12776071/25124508/8b1efee2-2449-11e7-8034-38192fbb99a7.png)

After Exam
![after](https://cloud.githubusercontent.com/assets/12776071/25124403/3c89f778-2449-11e7-9fed-ff93e8712af3.png)

coach exam report doesn't reflect actual status
I completed an exam, but it still shows it as 'in progress' with only one question answered:

![image](https://cloud.githubusercontent.com/assets/2367265/25415857/4a66dac2-29ef-11e7-9de7-eed964fb7557.png)




On reviewing the previous questions after entering the answers, the answers disappear for exam.
## Summary
On reviewing the previous questions after entering their answers, the answers disappears for those questions that a user is reviewing.

## System information
 - Version: Kolibri 0.4.0alpha5
 - Operating system: Ubuntu 14.04 LTS
 - Browser: Chrome browser and Firefox

## How to reproduce

1. Login as learner.
2. Click on Exams tab and select any exam.
3. Attempt all questions.
4. Go back and start reviewing each questions.

**Actual results:**
 The answers starts disappearing and the question highlighter on the left also disappears as you continue to review.

**Expected results:**
The previous recorded answers should be present and the question highlighter should be purple.

## Screenshots
Attempted all the questions:
![attempted all question answer_1](https://cloud.githubusercontent.com/assets/12776071/25427620/ca72f632-2a90-11e7-842b-443911f3b4e3.png)

Start reviewing the questions from the beginning:
(The answers starts disappearing with the question highlighter) 
![attempted all question answer_2](https://cloud.githubusercontent.com/assets/12776071/25427711/047c24f2-2a91-11e7-919c-c2fcee139ed0.png)




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kolibri/logger/serializers.py`
Content:
```
1 from django.db.models import Sum
2 from django.utils.timezone import now
3 from kolibri.auth.models import FacilityUser
4 from kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, ExamAttemptLog, ExamLog, MasteryLog, UserSessionLog
5 from rest_framework import serializers
6 
7 
8 class ContentSessionLogSerializer(serializers.ModelSerializer):
9 
10     class Meta:
11         model = ContentSessionLog
12         fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp',
13                   'end_timestamp', 'time_spent', 'kind', 'extra_fields', 'progress')
14 
15 class ExamLogSerializer(serializers.ModelSerializer):
16     progress = serializers.SerializerMethodField()
17     score = serializers.SerializerMethodField()
18 
19     def get_progress(self, obj):
20         return obj.attemptlogs.count()
21 
22     def get_score(self, obj):
23         return obj.attemptlogs.aggregate(Sum('correct')).get('correct__sum')
24 
25     class Meta:
26         model = ExamLog
27         fields = ('id', 'exam', 'user', 'closed', 'progress', 'score', 'completion_timestamp')
28         read_only_fields = ('completion_timestamp')
29 
30     def update(self, instance, validated_data):
31         # This has changed, set the completion timestamp
32         if validated_data.get('closed') and not instance.closed:
33             instance.completion_timestamp = now()
34         return instance
35 
36 class MasteryLogSerializer(serializers.ModelSerializer):
37 
38     pastattempts = serializers.SerializerMethodField()
39     totalattempts = serializers.SerializerMethodField()
40 
41     class Meta:
42         model = MasteryLog
43         fields = ('id', 'summarylog', 'start_timestamp', 'pastattempts', 'totalattempts',
44                   'end_timestamp', 'completion_timestamp', 'mastery_criterion', 'mastery_level', 'complete')
45 
46     def get_pastattempts(self, obj):
47         # will return a list of the latest 10 correct and hint_taken fields for each attempt.
48         return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).values('correct', 'hinted').order_by('-start_timestamp')[:10]
49 
50     def get_totalattempts(self, obj):
51         return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).count()
52 
53 class AttemptLogSerializer(serializers.ModelSerializer):
54 
55     class Meta:
56         model = AttemptLog
57         fields = ('id', 'masterylog', 'start_timestamp', 'sessionlog',
58                   'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',
59                   'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')
60 
61 class ExamAttemptLogSerializer(serializers.ModelSerializer):
62 
63     class Meta:
64         model = ExamAttemptLog
65         fields = ('id', 'examlog', 'start_timestamp', 'channel_id', 'content_id',
66                   'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',
67                   'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')
68 
69     def validate(self, data):
70         # Only do this validation when both are being set
71         # not necessary on PATCH, for example
72         if data.get('examlog') and data.get('user'):
73             try:
74                 if data['examlog'].user != data['user']:
75                     raise serializers.ValidationError('User field and user for related exam log are not the same')
76             except ExamLog.DoesNotExist:
77                 raise serializers.ValidationError('Invalid exam log')
78         return data
79 
80 class ContentSummaryLogSerializer(serializers.ModelSerializer):
81 
82     currentmasterylog = serializers.SerializerMethodField()
83 
84     class Meta:
85         model = ContentSummaryLog
86         fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp', 'currentmasterylog',
87                   'end_timestamp', 'completion_timestamp', 'time_spent', 'progress', 'kind', 'extra_fields')
88 
89     def get_currentmasterylog(self, obj):
90         try:
91             current_log = obj.masterylogs.latest('end_timestamp')
92             return MasteryLogSerializer(current_log).data
93         except MasteryLog.DoesNotExist:
94             return None
95 
96 
97 class ContentRatingLogSerializer(serializers.ModelSerializer):
98 
99     class Meta:
100         model = ContentRatingLog
101         fields = ('pk', 'user', 'content_id', 'channel_id', 'quality', 'ease', 'learning', 'feedback')
102 
103 
104 class UserSessionLogSerializer(serializers.ModelSerializer):
105 
106     class Meta:
107         model = UserSessionLog
108         fields = ('pk', 'user', 'channels', 'start_timestamp', 'last_interaction_timestamp', 'pages')
109 
110 class TotalContentProgressSerializer(serializers.ModelSerializer):
111 
112     progress = serializers.SerializerMethodField()
113 
114     class Meta:
115         model = FacilityUser
116         fields = ('progress', 'id')
117 
118     def get_progress(self, obj):
119         return obj.contentsummarylog_set.filter(progress=1).aggregate(Sum('progress')).get('progress__sum')
120
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/kolibri/logger/serializers.py b/kolibri/logger/serializers.py
--- a/kolibri/logger/serializers.py
+++ b/kolibri/logger/serializers.py
@@ -31,7 +31,7 @@
         # This has changed, set the completion timestamp
         if validated_data.get('closed') and not instance.closed:
             instance.completion_timestamp = now()
-        return instance
+        return super(ExamLogSerializer, self).update(instance, validated_data)
 
 class MasteryLogSerializer(serializers.ModelSerializer):

{"golden_diff": "diff --git a/kolibri/logger/serializers.py b/kolibri/logger/serializers.py\n--- a/kolibri/logger/serializers.py\n+++ b/kolibri/logger/serializers.py\n@@ -31,7 +31,7 @@\n         # This has changed, set the completion timestamp\n         if validated_data.get('closed') and not instance.closed:\n             instance.completion_timestamp = now()\n-        return instance\n+        return super(ExamLogSerializer, self).update(instance, validated_data)\n \n class MasteryLogSerializer(serializers.ModelSerializer):\n", "issue": "After submitting the exam the learner is still allowed to start the exam.\n## Summary\r\nAfter submitting the exam the learner is still allowed to start the exam. Where as it should show the **Completed** and the learner should not be allowed to retake.\r\n\r\n\r\n## System information\r\n\r\n - Version: Kolibri 0.4.0aplha2\r\n - Operating system: Ubuntu 14.04 LTS\r\n - Browser: Chrome browser and Firefox\r\n\r\n\r\n## How to reproduce\r\n\r\n1. Login as a learner\r\n2. Start giving an exam.\r\n3. Enter all the answers.\r\n4. Click on submit exam.\r\n5. Ideally the learner should be given completed exam status.\r\n\r\n## Screenshots\r\nBefore Exam\r\n![before](https://cloud.githubusercontent.com/assets/12776071/25124398/3ab80a34-2449-11e7-993b-ff22a4f9b55c.png)\r\n\r\n![mid](https://cloud.githubusercontent.com/assets/12776071/25124508/8b1efee2-2449-11e7-8034-38192fbb99a7.png)\r\n\r\nAfter Exam\r\n![after](https://cloud.githubusercontent.com/assets/12776071/25124403/3c89f778-2449-11e7-9fed-ff93e8712af3.png)\r\n\ncoach exam report doesn't reflect actual status\nI completed an exam, but it still shows it as 'in progress' with only one question answered:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/2367265/25415857/4a66dac2-29ef-11e7-9de7-eed964fb7557.png)\r\n\r\n\r\n\r\n\nOn reviewing the previous questions after entering the answers, the answers disappear for exam.\n## Summary\r\nOn reviewing the previous questions after entering their answers, the answers disappears for those questions that a user is reviewing.\r\n\r\n## System information\r\n - Version: Kolibri 0.4.0alpha5\r\n - Operating system: Ubuntu 14.04 LTS\r\n - Browser: Chrome browser and Firefox\r\n\r\n## How to reproduce\r\n\r\n1. Login as learner.\r\n2. Click on Exams tab and select any exam.\r\n3. Attempt all questions.\r\n4. Go back and start reviewing each questions.\r\n\r\n**Actual results:**\r\n The answers starts disappearing and the question highlighter on the left also disappears as you continue to review.\r\n\r\n**Expected results:**\r\nThe previous recorded answers should be present and the question highlighter should be purple.\r\n\r\n## Screenshots\r\nAttempted all the questions:\r\n![attempted all question answer_1](https://cloud.githubusercontent.com/assets/12776071/25427620/ca72f632-2a90-11e7-842b-443911f3b4e3.png)\r\n\r\nStart reviewing the questions from the beginning:\r\n(The answers starts disappearing with the question highlighter) \r\n![attempted all question answer_2](https://cloud.githubusercontent.com/assets/12776071/25427711/047c24f2-2a91-11e7-919c-c2fcee139ed0.png)\r\n\r\n\r\n\n", "before_files": [{"content": "from django.db.models import Sum\nfrom django.utils.timezone import now\nfrom kolibri.auth.models import FacilityUser\nfrom kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, ExamAttemptLog, ExamLog, MasteryLog, UserSessionLog\nfrom rest_framework import serializers\n\n\nclass ContentSessionLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ContentSessionLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp',\n                  'end_timestamp', 'time_spent', 'kind', 'extra_fields', 'progress')\n\nclass ExamLogSerializer(serializers.ModelSerializer):\n    progress = serializers.SerializerMethodField()\n    score = serializers.SerializerMethodField()\n\n    def get_progress(self, obj):\n        return obj.attemptlogs.count()\n\n    def get_score(self, obj):\n        return obj.attemptlogs.aggregate(Sum('correct')).get('correct__sum')\n\n    class Meta:\n        model = ExamLog\n        fields = ('id', 'exam', 'user', 'closed', 'progress', 'score', 'completion_timestamp')\n        read_only_fields = ('completion_timestamp')\n\n    def update(self, instance, validated_data):\n        # This has changed, set the completion timestamp\n        if validated_data.get('closed') and not instance.closed:\n            instance.completion_timestamp = now()\n        return instance\n\nclass MasteryLogSerializer(serializers.ModelSerializer):\n\n    pastattempts = serializers.SerializerMethodField()\n    totalattempts = serializers.SerializerMethodField()\n\n    class Meta:\n        model = MasteryLog\n        fields = ('id', 'summarylog', 'start_timestamp', 'pastattempts', 'totalattempts',\n                  'end_timestamp', 'completion_timestamp', 'mastery_criterion', 'mastery_level', 'complete')\n\n    def get_pastattempts(self, obj):\n        # will return a list of the latest 10 correct and hint_taken fields for each attempt.\n        return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).values('correct', 'hinted').order_by('-start_timestamp')[:10]\n\n    def get_totalattempts(self, obj):\n        return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).count()\n\nclass AttemptLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = AttemptLog\n        fields = ('id', 'masterylog', 'start_timestamp', 'sessionlog',\n                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',\n                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')\n\nclass ExamAttemptLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ExamAttemptLog\n        fields = ('id', 'examlog', 'start_timestamp', 'channel_id', 'content_id',\n                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',\n                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')\n\n    def validate(self, data):\n        # Only do this validation when both are being set\n        # not necessary on PATCH, for example\n        if data.get('examlog') and data.get('user'):\n            try:\n                if data['examlog'].user != data['user']:\n                    raise serializers.ValidationError('User field and user for related exam log are not the same')\n            except ExamLog.DoesNotExist:\n                raise serializers.ValidationError('Invalid exam log')\n        return data\n\nclass ContentSummaryLogSerializer(serializers.ModelSerializer):\n\n    currentmasterylog = serializers.SerializerMethodField()\n\n    class Meta:\n        model = ContentSummaryLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp', 'currentmasterylog',\n                  'end_timestamp', 'completion_timestamp', 'time_spent', 'progress', 'kind', 'extra_fields')\n\n    def get_currentmasterylog(self, obj):\n        try:\n            current_log = obj.masterylogs.latest('end_timestamp')\n            return MasteryLogSerializer(current_log).data\n        except MasteryLog.DoesNotExist:\n            return None\n\n\nclass ContentRatingLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ContentRatingLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'quality', 'ease', 'learning', 'feedback')\n\n\nclass UserSessionLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = UserSessionLog\n        fields = ('pk', 'user', 'channels', 'start_timestamp', 'last_interaction_timestamp', 'pages')\n\nclass TotalContentProgressSerializer(serializers.ModelSerializer):\n\n    progress = serializers.SerializerMethodField()\n\n    class Meta:\n        model = FacilityUser\n        fields = ('progress', 'id')\n\n    def get_progress(self, obj):\n        return obj.contentsummarylog_set.filter(progress=1).aggregate(Sum('progress')).get('progress__sum')\n", "path": "kolibri/logger/serializers.py"}], "after_files": [{"content": "from django.db.models import Sum\nfrom django.utils.timezone import now\nfrom kolibri.auth.models import FacilityUser\nfrom kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, ExamAttemptLog, ExamLog, MasteryLog, UserSessionLog\nfrom rest_framework import serializers\n\n\nclass ContentSessionLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ContentSessionLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp',\n                  'end_timestamp', 'time_spent', 'kind', 'extra_fields', 'progress')\n\nclass ExamLogSerializer(serializers.ModelSerializer):\n    progress = serializers.SerializerMethodField()\n    score = serializers.SerializerMethodField()\n\n    def get_progress(self, obj):\n        return obj.attemptlogs.count()\n\n    def get_score(self, obj):\n        return obj.attemptlogs.aggregate(Sum('correct')).get('correct__sum')\n\n    class Meta:\n        model = ExamLog\n        fields = ('id', 'exam', 'user', 'closed', 'progress', 'score', 'completion_timestamp')\n        read_only_fields = ('completion_timestamp')\n\n    def update(self, instance, validated_data):\n        # This has changed, set the completion timestamp\n        if validated_data.get('closed') and not instance.closed:\n            instance.completion_timestamp = now()\n        return super(ExamLogSerializer, self).update(instance, validated_data)\n\nclass MasteryLogSerializer(serializers.ModelSerializer):\n\n    pastattempts = serializers.SerializerMethodField()\n    totalattempts = serializers.SerializerMethodField()\n\n    class Meta:\n        model = MasteryLog\n        fields = ('id', 'summarylog', 'start_timestamp', 'pastattempts', 'totalattempts',\n                  'end_timestamp', 'completion_timestamp', 'mastery_criterion', 'mastery_level', 'complete')\n\n    def get_pastattempts(self, obj):\n        # will return a list of the latest 10 correct and hint_taken fields for each attempt.\n        return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).values('correct', 'hinted').order_by('-start_timestamp')[:10]\n\n    def get_totalattempts(self, obj):\n        return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).count()\n\nclass AttemptLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = AttemptLog\n        fields = ('id', 'masterylog', 'start_timestamp', 'sessionlog',\n                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',\n                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')\n\nclass ExamAttemptLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ExamAttemptLog\n        fields = ('id', 'examlog', 'start_timestamp', 'channel_id', 'content_id',\n                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',\n                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')\n\n    def validate(self, data):\n        # Only do this validation when both are being set\n        # not necessary on PATCH, for example\n        if data.get('examlog') and data.get('user'):\n            try:\n                if data['examlog'].user != data['user']:\n                    raise serializers.ValidationError('User field and user for related exam log are not the same')\n            except ExamLog.DoesNotExist:\n                raise serializers.ValidationError('Invalid exam log')\n        return data\n\nclass ContentSummaryLogSerializer(serializers.ModelSerializer):\n\n    currentmasterylog = serializers.SerializerMethodField()\n\n    class Meta:\n        model = ContentSummaryLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'start_timestamp', 'currentmasterylog',\n                  'end_timestamp', 'completion_timestamp', 'time_spent', 'progress', 'kind', 'extra_fields')\n\n    def get_currentmasterylog(self, obj):\n        try:\n            current_log = obj.masterylogs.latest('end_timestamp')\n            return MasteryLogSerializer(current_log).data\n        except MasteryLog.DoesNotExist:\n            return None\n\n\nclass ContentRatingLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = ContentRatingLog\n        fields = ('pk', 'user', 'content_id', 'channel_id', 'quality', 'ease', 'learning', 'feedback')\n\n\nclass UserSessionLogSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = UserSessionLog\n        fields = ('pk', 'user', 'channels', 'start_timestamp', 'last_interaction_timestamp', 'pages')\n\nclass TotalContentProgressSerializer(serializers.ModelSerializer):\n\n    progress = serializers.SerializerMethodField()\n\n    class Meta:\n        model = FacilityUser\n        fields = ('progress', 'id')\n\n    def get_progress(self, obj):\n        return obj.contentsummarylog_set.filter(progress=1).aggregate(Sum('progress')).get('progress__sum')\n", "path": "kolibri/logger/serializers.py"}]}