File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def make(self):
41
41
@staticmethod
42
42
def new_report (exercise ):
43
43
return {
44
- 'exercise' : exercise . identifier ,
44
+ 'exercise' : exercise ,
45
45
'passage_1_total' : 0 ,
46
46
'passage_2_total' : 0 ,
47
47
'passage_3_total' : 0 ,
Original file line number Diff line number Diff line change @@ -68,9 +68,18 @@ class _PassageDetailSerializer(serializers.Serializer):
68
68
is_correct = serializers .BooleanField ()
69
69
70
70
71
+ class _ExerciseSerializer (serializers .HyperlinkedModelSerializer ):
72
+ class Meta :
73
+ model = ReadingExercise
74
+ fields = ['pk' , 'url' , 'identifier' ]
75
+ extra_kwargs = {
76
+ 'url' : {'view_name' : 'reading-exercise-detail' }
77
+ }
78
+
79
+
71
80
class StudentReadingReportSerializer (serializers .Serializer ):
72
81
student = serializers .IntegerField (write_only = True )
73
- exercise = serializers . CharField (read_only = True )
82
+ exercise = _ExerciseSerializer (read_only = True )
74
83
passage_1_total = serializers .IntegerField (read_only = True )
75
84
passage_2_total = serializers .IntegerField (read_only = True )
76
85
passage_3_total = serializers .IntegerField (read_only = True )
You can’t perform that action at this time.
0 commit comments