Commit 993d4d12 authored by Tim Honcoop's avatar Tim Honcoop
Browse files

Added branch id

parent b68eca2e
Pipeline #2222 passed with stage
in 2 minutes and 16 seconds
......@@ -47,6 +47,7 @@ class QuizSerializer(serializers.ModelSerializer):
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
]
......@@ -56,6 +57,7 @@ class QuizSerializer(serializers.ModelSerializer):
lesson = serializers.SerializerMethodField()
lesson_name = serializers.SerializerMethodField()
item_id = serializers.SerializerMethodField()
branch = serializers.SerializerMethodField()
average_grade = serializers.FloatField()
average_attempts = serializers.SerializerMethodField()
......@@ -88,6 +90,9 @@ class QuizSerializer(serializers.ModelSerializer):
def get_item_id(self, obj):
return obj.items.all()[0].item_id
def get_branch(self, obj):
return obj.items.all()[0].branch.id
def get_average_attempts(self, obj):
"""
Return the average number of attempts for this quiz within the given
......
......@@ -578,6 +578,7 @@ def test_quiz_analytics_view(
- lesson
- lesson_name
- item_id
- branch
- average_grade
- average_attempts
- grade_distribution
......@@ -617,6 +618,7 @@ def test_quiz_analytics_view(
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
"grade_distribution",
......@@ -764,6 +766,7 @@ def test_quiz_analytics_view_invalid_date_filter(
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
"grade_distribution",
......@@ -817,6 +820,7 @@ def test_quiz_analytics_next_quiz(
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
"grade_distribution",
......@@ -881,6 +885,7 @@ def test_quiz_version_list_view(
- lesson
- lesson_name
- item_id
- branch
- average_grade
- average_attempts
"""
......@@ -905,6 +910,7 @@ def test_quiz_version_list_view(
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
]
......@@ -933,6 +939,7 @@ def test_quiz_list_view(teacher_api_client, coursera_course_id):
- lesson
- lesson_name
- item_id
- branch
- average_grade
- average_attempts
"""
......@@ -951,6 +958,7 @@ def test_quiz_list_view(teacher_api_client, coursera_course_id):
"lesson",
"lesson_name",
"item_id",
"branch",
"average_grade",
"average_attempts",
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment