coveralls: 
[![Coverage Status](https://coveralls.io/builds/28953722/badge)](https://coveralls.io/builds/28953722)

Coverage remained the same at 100.0% when pulling **af9c78fe3a33482d5a6d5ff5eb5009316d7b6397 on Mike-Nahmias:issue/347-quiz-submission-data** into **309210681e28c58256ce5999a513b8a70f8aba31 on ucfopen:develop**.

diff --git a/canvasapi/quiz.py b/canvasapi/quiz.py
index 0cce770..efd945b 100644
--- a/canvasapi/quiz.py
+++ b/canvasapi/quiz.py
@@ -8,6 +8,8 @@ from canvasapi.canvas_object import CanvasObject
 from canvasapi.exceptions import RequiredFieldMissing
 from canvasapi.paginated_list import PaginatedList
 from canvasapi.quiz_group import QuizGroup
+from canvasapi.submission import Submission
+from canvasapi.user import User
 from canvasapi.util import combine_kwargs, obj_or_id
 
 
@@ -374,6 +376,22 @@ class Quiz(CanvasObject):
 
         response_json = response.json()["quiz_submissions"][0]
         response_json.update({"course_id": self.course_id})
+        if len(response.json().get("quizzes", [])) > 0:
+            response_json.update(
+                {"quiz": Quiz(self._requester, response.json()["quizzes"][0])}
+            )
+        if len(response.json().get("submissions", [])) > 0:
+            response_json.update(
+                {
+                    "submission": Submission(
+                        self._requester, response.json()["submissions"][0]
+                    )
+                }
+            )
+        if len(response.json().get("users", [])) > 0:
+            response_json.update(
+                {"user": User(self._requester, response.json()["users"][0])}
+            )
 
         return QuizSubmission(self._requester, response_json)
 

quiz.get_quiz_submission() strips included data
# Describe the bug

quiz.get_quiz_submission() only keeps ["quiz_submissions"][0] from the returned data. If you use the kwarg `include` you can have the request include submission, quiz, or user, but this data is omitted by the function.

# To Reproduce

1. Turn on logging as described in the docs
2. Get a quiz
3. Call `quiz.get_get_quiz_submission(submission_id, include=['quiz'])`
4. The log will show the returned data including more than what is included in the resulting object

# Expected behavior

The raw data returned from the API looks like this:
```
{
  'quiz_submissions': [{...}],
  'quizzes': [{...}]
}
```

# Environment information

- Python version - 3.7.6
- CanvasAPI version - 0.15.0

diff --git a/tests/fixtures/quiz.json b/tests/fixtures/quiz.json
index 1a0c09e..253e05c 100644
--- a/tests/fixtures/quiz.json
+++ b/tests/fixtures/quiz.json
@@ -219,6 +219,30 @@
 					"validation_token": "this is a validation token",
 					"score": 0
 				}
+			],
+			"quizzes": [
+				{
+					"id": 1,
+					"title": "Test Quiz",
+					"quiz_type": "survey"
+				}
+			],
+			"submissions": [
+				{
+					"id": 1,
+					"body": "user: 1, quiz: 1, score: 1.0, time: 2020-01-01 00:00:00Z",
+					"grade": "1",
+					"score": 1,
+					"assignment_id": 1234,
+					"user_id": 1
+				}
+			],
+			"users": [
+				{
+					"id": 1,
+					"name": "Test User",
+					"login_id": "testuser@example.com"
+				}
 			]
 		},
 		"status_code": 200
diff --git a/tests/test_quiz.py b/tests/test_quiz.py
index 4e87972..cf0b010 100644
--- a/tests/test_quiz.py
+++ b/tests/test_quiz.py
@@ -22,6 +22,8 @@ from canvasapi.quiz_group import QuizGroup
 from canvasapi.paginated_list import PaginatedList
 from tests import settings
 from tests.util import register_uris
+from canvasapi.user import User
+from canvasapi.submission import Submission
 
 
 @requests_mock.Mocker()
@@ -319,19 +321,24 @@ class TestQuiz(unittest.TestCase):
         register_uris({"quiz": ["get_quiz_submission"]}, m)
 
         quiz_id = 1
-        submission = self.quiz.get_quiz_submission(quiz_id)
+        quiz_submission = self.quiz.get_quiz_submission(
+            quiz_id, include=["quiz", "submission", "user"]
+        )
 
-        self.assertIsInstance(submission, QuizSubmission)
-        self.assertTrue(hasattr(submission, "id"))
-        self.assertEqual(submission.quiz_id, quiz_id)
-        self.assertTrue(hasattr(submission, "quiz_version"))
-        self.assertEqual(submission.quiz_version, 1)
-        self.assertTrue(hasattr(submission, "user_id"))
-        self.assertEqual(submission.user_id, 1)
-        self.assertTrue(hasattr(submission, "validation_token"))
-        self.assertEqual(submission.validation_token, "this is a validation token")
-        self.assertTrue(hasattr(submission, "score"))
-        self.assertEqual(submission.score, 0)
+        self.assertIsInstance(quiz_submission, QuizSubmission)
+        self.assertTrue(hasattr(quiz_submission, "id"))
+        self.assertEqual(quiz_submission.quiz_id, quiz_id)
+        self.assertTrue(hasattr(quiz_submission, "quiz_version"))
+        self.assertEqual(quiz_submission.quiz_version, 1)
+        self.assertTrue(hasattr(quiz_submission, "user_id"))
+        self.assertEqual(quiz_submission.user_id, 1)
+        self.assertTrue(hasattr(quiz_submission, "validation_token"))
+        self.assertEqual(quiz_submission.validation_token, "this is a validation token")
+        self.assertTrue(hasattr(quiz_submission, "score"))
+        self.assertEqual(quiz_submission.score, 0)
+        self.assertIsInstance(quiz_submission.quiz, Quiz)
+        self.assertIsInstance(quiz_submission.submission, Submission)
+        self.assertIsInstance(quiz_submission.user, User)
 
     # create_submission
     def test_create_submission(self, m):

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest flake8 requests-mock
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
-e git+https://github.com/ucfopen/canvasapi.git@309210681e28c58256ce5999a513b8a70f8aba31#egg=canvasapi
certifi==2021.5.30
charset-normalizer==2.0.12
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==1.1.1
mccabe==0.7.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
requests-mock==1.12.1
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: canvasapi
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - requests-mock==1.12.1
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/canvasapi

tests/test_quiz.py::TestQuiz::test_get_quiz_submission
tests/test_quiz.py::TestQuiz::test_get_all_quiz_submissions
tests/test_quiz.py::TestQuiz::test__str__ tests/test_quiz.py::TestQuiz::test_broadcast_message tests/test_quiz.py::TestQuiz::test_broadcast_message_invalid_params tests/test_quiz.py::TestQuiz::test_create_question tests/test_quiz.py::TestQuiz::test_create_question_group tests/test_quiz.py::TestQuiz::test_create_question_group_empty_list tests/test_quiz.py::TestQuiz::test_create_question_group_incorrect_dict tests/test_quiz.py::TestQuiz::test_create_question_group_incorrect_param tests/test_quiz.py::TestQuiz::test_create_report tests/test_quiz.py::TestQuiz::test_create_report_failure tests/test_quiz.py::TestQuiz::test_create_submission tests/test_quiz.py::TestQuiz::test_delete tests/test_quiz.py::TestQuiz::test_edit tests/test_quiz.py::TestQuiz::test_get_all_quiz_reports tests/test_quiz.py::TestQuiz::test_get_question tests/test_quiz.py::TestQuiz::test_get_questions tests/test_quiz.py::TestQuiz::test_get_quiz_group tests/test_quiz.py::TestQuiz::test_get_quiz_report tests/test_quiz.py::TestQuiz::test_get_statistics tests/test_quiz.py::TestQuiz::test_get_submissions tests/test_quiz.py::TestQuiz::test_set_extensions tests/test_quiz.py::TestQuiz::test_set_extensions_empty_list tests/test_quiz.py::TestQuiz::test_set_extensions_missing_key tests/test_quiz.py::TestQuiz::test_set_extensions_non_dicts tests/test_quiz.py::TestQuiz::test_set_extensions_not_list tests/test_quiz.py::TestQuizReport::test__str__ tests/test_quiz.py::TestQuizReport::test_abort_or_delete tests/test_quiz.py::TestQuizReport::test_abort_or_delete_failure tests/test_quiz.py::TestQuizSubmission::test__str__ tests/test_quiz.py::TestQuizSubmission::test_answer_submission_questions tests/test_quiz.py::TestQuizSubmission::test_answer_submission_questions_manual_validation_token tests/test_quiz.py::TestQuizSubmission::test_answer_submission_questions_no_validation_token tests/test_quiz.py::TestQuizSubmission::test_complete tests/test_quiz.py::TestQuizSubmission::test_complete_no_validation_token tests/test_quiz.py::TestQuizSubmission::test_get_submission_events tests/test_quiz.py::TestQuizSubmission::test_get_submission_questions tests/test_quiz.py::TestQuizSubmission::test_get_times tests/test_quiz.py::TestQuizSubmission::test_submit_events tests/test_quiz.py::TestQuizSubmission::test_submit_events_fail tests/test_quiz.py::TestQuizSubmission::test_update_score_and_comments tests/test_quiz.py::TestQuizExtension::test__str__ tests/test_quiz.py::TestQuizQuestion::test__str__ tests/test_quiz.py::TestQuizQuestion::test_delete tests/test_quiz.py::TestQuizQuestion::test_edit tests/test_quiz.py::TestQuizStatistic::test__str__ tests/test_quiz.py::TestQuizSubmissionEvent::test__str__ tests/test_quiz.py::TestQuizSubmissionQuestion::test__str__ tests/test_quiz.py::TestQuizSubmissionQuestion::test_flag tests/test_quiz.py::TestQuizSubmissionQuestion::test_flag_manual_validation_token tests/test_quiz.py::TestQuizSubmissionQuestion::test_flag_no_validation_token tests/test_quiz.py::TestQuizSubmissionQuestion::test_unflag tests/test_quiz.py::TestQuizSubmissionQuestion::test_unflag_manual_validation_token tests/test_quiz.py::TestQuizSubmissionQuestion::test_unflag_no_validation_token tests/test_quiz.py::TestQuizAssignmentOverrideSet::test__str__
canvasapi/quiz.py
canvasapi/quiz.py