Skip to content

Commit 42609ab

Browse files
Revert "don't allow student to see answers"
This reverts commit abb7781.
1 parent abb7781 commit 42609ab

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

classroom/serializers/question.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ReadingQuestionSerializer(serializers.HyperlinkedModelSerializer):
88
choices = serializers.ListField(source='get_choices_content')
9-
answers = serializers.SerializerMethodField()
9+
answers = serializers.ListField(source='get_answers_content')
1010

1111
class Meta:
1212
model = ReadingQuestion
@@ -22,13 +22,6 @@ class Meta:
2222
'number': {'min_value': 1},
2323
}
2424

25-
def get_answers(self, question):
26-
user = self.context['request'].user
27-
if user.is_teacher():
28-
return question.get_answers_content()
29-
else:
30-
return [] # Of course we can't allow student to see the answers
31-
3225
def validate(self, attrs):
3326
attrs = super().validate(attrs)
3427
self._validate_question_not_exist(attrs)

0 commit comments

Comments
 (0)