Skip to content

Commit

Permalink
feat: add Software Secure review, history, and comment models to reti…
Browse files Browse the repository at this point in the history
…rement endpoint
  • Loading branch information
MichaelRoytman committed Feb 3, 2025
1 parent ce9c51e commit f873fcc
Show file tree
Hide file tree
Showing 35 changed files with 259 additions and 55 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ Change Log
Unreleased
~~~~~~~~~~

[5.1.0] - 2025-02-03
~~~~~~~~~~~~~~~~~~~~
* add Software Secure review, history, and comment models to retirement endpoint

[5.0.1] - 2024-11-25
~~~~~~~~~~~~~~~~~~~~
* update requirements

[5.0.0] - 2024-11-22
~~~~~~~~~~~~~~~~~~~~
* drop support for Python 3.8

[4.18.4] - 2024-11-21
~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '5.0.1'
__version__ = '5.1.0'
1 change: 0 additions & 1 deletion edx_proctoring/backends/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import time

from unittest.mock import patch

from django.core.exceptions import ImproperlyConfigured
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/backends/tests/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"""

import json
from unittest.mock import patch

import ddt
import jwt
import responses
from unittest.mock import patch

from django.test import TestCase, override_settings
from django.utils import translation
Expand Down
3 changes: 1 addition & 2 deletions edx_proctoring/backends/tests/test_software_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"""
Tests for the software_secure module
"""

import json
from unittest.mock import MagicMock, patch

import ddt
from httmock import HTTMock, all_requests
from unittest.mock import MagicMock, patch

from django.contrib.auth import get_user_model
from django.test import TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from edx_proctoring.api import create_exam
from edx_proctoring.models import ProctoredExamStudentAttempt
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.tests.utils import LoggedInTestCase
from edx_proctoring.tests.test_utils.utils import LoggedInTestCase


@ddt.ddt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""

from datetime import datetime
from unittest.mock import MagicMock, patch

import pytz
from unittest.mock import MagicMock, patch

from django.core.management import call_command

Expand All @@ -19,7 +19,7 @@
MockGradesService,
MockInstructorService
)
from edx_proctoring.tests.utils import LoggedInTestCase
from edx_proctoring.tests.test_utils.utils import LoggedInTestCase


@patch('django.urls.reverse', MagicMock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from edx_proctoring.models import ProctoredExamSoftwareSecureReview, ProctoredExamSoftwareSecureReviewHistory
from edx_proctoring.runtime import set_runtime_service
from edx_proctoring.tests.test_services import MockCertificateService, MockCreditService, MockGradesService
from edx_proctoring.tests.utils import LoggedInTestCase
from edx_proctoring.tests.test_utils.utils import LoggedInTestCase


class SetAttemptActiveFieldTests(LoggedInTestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from edx_proctoring.runtime import set_runtime_service
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus, SoftwareSecureReviewStatus
from edx_proctoring.tests.test_services import MockCertificateService, MockCreditService, MockGradesService
from edx_proctoring.tests.utils import LoggedInTestCase
from edx_proctoring.tests.test_utils.utils import LoggedInTestCase


class SetAttemptActiveFieldTests(LoggedInTestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from edx_proctoring.runtime import set_runtime_service
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.tests.test_services import MockCertificateService, MockCreditService, MockGradesService
from edx_proctoring.tests.utils import LoggedInTestCase
from edx_proctoring.tests.test_utils.utils import LoggedInTestCase

User = get_user_model()

Expand Down
28 changes: 11 additions & 17 deletions edx_proctoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,10 @@ class ProctoredExamSoftwareSecureReview(TimeStampedModel):
This is where we store the proctored exam review feedback
from the exam reviewers
.. pii: Reviews contain video of the exam.
Retirement was supposed to be implemented in https://openedx.atlassian.net/browse/EDUCATOR-4776,
but it is not clear that is was. We pessimistically assume that it was NOT retired, but this
assumption should be revisited in https://github.com/openedx/edx-proctoring/issues/1241.
.. pii_types: video
.. pii_retirement: retained
.. pii: Stores review metadata, which is a free text field, which may contain a learner's name, a learner's email,
a link to a video review link, etc., as well as an encrypted video link.
.. pii_types: email_address, external_service, name, video
.. pii_retirement: local_api
"""

# which student attempt is this feedback for?
Expand Down Expand Up @@ -761,12 +759,10 @@ class ProctoredExamSoftwareSecureReviewHistory(TimeStampedModel):
"""
When records get updated, we will archive them here
.. pii: Reviews contain video of the exam.
Retirement was supposed to be implemented in https://openedx.atlassian.net/browse/EDUCATOR-4776,
but it is not clear that is was. We pessimistically assume that it was NOT retired, but this
assumption should be revisited in https://github.com/openedx/edx-proctoring/issues/1241.
.. pii_types: video
.. pii_retirement: retained
.. pii: Stores review metadata, which is a free text field, which may contain a learner's name, a learner's email,
a link to a video review link, etc., as well as an encrypted video link.
.. pii_types: email_address, external_service, name, video
.. pii_retirement: local_api
"""

# which student attempt is this feedback for?
Expand Down Expand Up @@ -809,12 +805,10 @@ class ProctoredExamSoftwareSecureComment(TimeStampedModel):
This is where we store the proctored exam review comments
from the exam reviewers
.. pii: Comment contains free-form text which could be personally-identifying.
Retirement was supposed to be implemented in https://openedx.atlassian.net/browse/EDUCATOR-4776,
but it is not clear that is was. We pessimistically assume that it was NOT retired, but this
assumption should be revisited in https://github.com/openedx/edx-proctoring/issues/1241.
.. pii: Stores review metadata, which is a free text field, which may contain a learner's name, a learner's email,
a link to a video review link, etc.
.. pii_types: other
.. pii_retirement: retained
.. pii_retirement: local_api
"""

# which student attempt is this feedback for?
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"""
from datetime import datetime, timedelta
from itertools import product
from unittest.mock import MagicMock, patch

import ddt
import pytz
from freezegun import freeze_time
from unittest.mock import MagicMock, patch

from django.conf import settings
from django.core import mail
Expand Down Expand Up @@ -108,7 +108,7 @@
MockInstructorService,
MockNameAffirmationService
)
from .utils import ProctoredExamTestCase
from .test_utils.utils import ProctoredExamTestCase


@patch('django.urls.reverse', MagicMock)
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/tests/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from copy import deepcopy
from itertools import product
from unittest.mock import MagicMock, patch

import ddt
from unittest.mock import MagicMock, patch
from opaque_keys import InvalidKeyError

from django.conf import settings
Expand All @@ -21,7 +21,7 @@
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus

from .test_services import MockCertificateService, MockCreditService, MockGradesService, MockInstructorService
from .utils import ProctoredExamTestCase
from .test_utils.utils import ProctoredExamTestCase


@patch('django.urls.reverse', MagicMock)
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.tests.test_services import MockInstructorService

from .utils import ProctoredExamTestCase
from .test_utils.utils import ProctoredExamTestCase


@ddt.ddt
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/tests/test_mfe_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""
import json
from itertools import product
from unittest.mock import patch
from urllib.parse import urlencode

import ddt
from unittest.mock import patch
from opaque_keys.edx.locator import BlockUsageLocator

from django.conf import settings
Expand All @@ -23,7 +23,7 @@
from edx_proctoring.utils import humanized_time

from .test_services import MockLearningSequencesService, MockScheduleItemData
from .utils import ProctoredExamTestCase
from .test_utils.utils import ProctoredExamTestCase

User = get_user_model()

Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus

from .utils import LoggedInTestCase
from .test_utils.utils import LoggedInTestCase

User = get_user_model()

Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/tests/test_reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import codecs
import json
from unittest.mock import call, patch

import ddt
from crum import set_current_request
from unittest.mock import call, patch

from django.contrib.auth import get_user_model
from django.test import RequestFactory
Expand Down Expand Up @@ -35,7 +35,7 @@
from edx_proctoring.utils import decode_and_decrypt, locate_attempt_by_attempt_code
from edx_proctoring.views import ProctoredExamReviewCallback, is_user_course_or_global_staff

from .utils import LoggedInTestCase
from .test_utils.utils import LoggedInTestCase

User = get_user_model()

Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/tests/test_student_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import itertools
import json
from datetime import datetime, timedelta
from unittest.mock import MagicMock, patch

import ddt
import pytz
from freezegun import freeze_time
from unittest.mock import MagicMock, patch

from django.test.utils import override_settings
from django.urls import reverse
Expand All @@ -39,7 +39,7 @@
MockCreditServiceWithCourseEndDate,
MockInstructorService
)
from .utils import ProctoredExamTestCase
from .test_utils.utils import ProctoredExamTestCase


@patch('django.urls.reverse', MagicMock)
Expand Down
35 changes: 35 additions & 0 deletions edx_proctoring/tests/test_utils/factories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from factory import Sequence, SubFactory
from factory.django import DjangoModelFactory

from edx_proctoring.models import (
ProctoredExamSoftwareSecureComment,
ProctoredExamSoftwareSecureReview,
ProctoredExamSoftwareSecureReviewHistory
)


class ProctoredExamSoftwareSecureReviewFactory(DjangoModelFactory):
class Meta:
model = ProctoredExamSoftwareSecureReview

attempt_code = Sequence(lambda n: 'attempt_code_%d' % n)
review_status = 'review status'
raw_data = 'raw data'
encrypted_video_url = b'www.example.com'


class ProctoredExamSoftwareSecureReviewHistoryFactory(ProctoredExamSoftwareSecureReviewFactory):
class Meta:
model = ProctoredExamSoftwareSecureReviewHistory


class ProctoredExamSoftwareSecureCommentFactory(DjangoModelFactory):
class Meta:
model = ProctoredExamSoftwareSecureComment

review = SubFactory(ProctoredExamSoftwareSecureReviewFactory)
comment = 'comment'
status = 'status'
start_time = 100
stop_time = 150
duration = 150
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f873fcc

Please sign in to comment.