Skip to content

Commit

Permalink
fix: enable Django40 testing (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 committed Apr 7, 2022
1 parent 6406901 commit 1c6f355
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 133 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
toxenv:
[
"django32-drflatest",
"django40-drflatest",
"quality",
"pii_check",
"version_check",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Unreleased
~~~~~~~~~~

[4.10.1] - 2022-04-06
~~~~~~~~~~~~~~~~~~~~~
* Enabled Django40 testing
* Removed Deprecated and Removed Featured from Django40

[4.10.1] - 2022-04-06
~~~~~~~~~~~~~~~~~~~~~
* Fixed the syntax error in CI workflow to make it work.
* Removed Django40 tests for now which will be enabled in subsequent PR

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,6 +3,6 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '4.10.1'
__version__ = '4.10.2'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion edx_proctoring/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.conf import settings
from django.contrib import admin, messages
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from edx_proctoring.api import update_attempt_status
from edx_proctoring.exceptions import ProctoredExamIllegalStatusTransition, StudentExamAttemptDoesNotExistsException
Expand Down
30 changes: 15 additions & 15 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from django.core.mail.message import EmailMessage
from django.template import loader
from django.urls import NoReverseMatch, reverse
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_noop
from django.utils.translation import gettext as _
from django.utils.translation import gettext_noop

from edx_proctoring import constants
from edx_proctoring.backends import get_backend_provider
Expand Down Expand Up @@ -2246,47 +2246,47 @@ def _resolve_prerequisite_links(exam, prerequisites):

STATUS_SUMMARY_MAP = {
'_default': {
'short_description': ugettext_noop('Taking As Proctored Exam'),
'short_description': gettext_noop('Taking As Proctored Exam'),
'suggested_icon': 'fa-pencil-square-o',
'in_completed_state': False
},
ProctoredExamStudentAttemptStatus.eligible: {
'short_description': ugettext_noop('Proctored Option Available'),
'short_description': gettext_noop('Proctored Option Available'),
'suggested_icon': 'fa-pencil-square-o',
'in_completed_state': False
},
ProctoredExamStudentAttemptStatus.declined: {
'short_description': ugettext_noop('Taking As Open Exam'),
'short_description': gettext_noop('Taking As Open Exam'),
'suggested_icon': 'fa-pencil-square-o',
'in_completed_state': False
},
ProctoredExamStudentAttemptStatus.submitted: {
'short_description': ugettext_noop('Pending Session Review'),
'short_description': gettext_noop('Pending Session Review'),
'suggested_icon': 'fa-spinner fa-spin',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.second_review_required: {
'short_description': ugettext_noop('Pending Session Review'),
'short_description': gettext_noop('Pending Session Review'),
'suggested_icon': 'fa-spinner fa-spin',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.verified: {
'short_description': ugettext_noop('Passed Proctoring'),
'short_description': gettext_noop('Passed Proctoring'),
'suggested_icon': 'fa-check',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.rejected: {
'short_description': ugettext_noop('Failed Proctoring'),
'short_description': gettext_noop('Failed Proctoring'),
'suggested_icon': 'fa-exclamation-triangle',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.error: {
'short_description': ugettext_noop('Failed Proctoring'),
'short_description': gettext_noop('Failed Proctoring'),
'suggested_icon': 'fa-exclamation-triangle',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.expired: {
'short_description': ugettext_noop('Proctored Option No Longer Available'),
'short_description': gettext_noop('Proctored Option No Longer Available'),
'suggested_icon': 'fa-times-circle',
'in_completed_state': False
}
Expand All @@ -2295,25 +2295,25 @@ def _resolve_prerequisite_links(exam, prerequisites):

PRACTICE_STATUS_SUMMARY_MAP = {
'_default': {
'short_description': ugettext_noop('Ungraded Practice Exam'),
'short_description': gettext_noop('Ungraded Practice Exam'),
'suggested_icon': '',
'in_completed_state': False
},
ProctoredExamStudentAttemptStatus.submitted: {
'short_description': ugettext_noop('Practice Exam Completed'),
'short_description': gettext_noop('Practice Exam Completed'),
'suggested_icon': 'fa-check',
'in_completed_state': True
},
ProctoredExamStudentAttemptStatus.error: {
'short_description': ugettext_noop('Practice Exam Failed'),
'short_description': gettext_noop('Practice Exam Failed'),
'suggested_icon': 'fa-exclamation-triangle',
'in_completed_state': True
}
}

TIMED_EXAM_STATUS_SUMMARY_MAP = {
'_default': {
'short_description': ugettext_noop('Timed Exam'),
'short_description': gettext_noop('Timed Exam'),
'suggested_icon': 'fa-clock-o',
'in_completed_state': False
}
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/instructor_dashboard_exam_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"""

from django.conf import settings
from django.conf.urls import url
from django.urls import re_path

from edx_proctoring import views

app_name = 'instructor'


urlpatterns = [
url(
re_path(
fr'edx_proctoring/v1/instructor/{settings.COURSE_ID_PATTERN}/(?P<exam_id>\d+)$',
views.InstructorDashboard.as_view(),
name='instructor_dashboard_exam'
Expand Down
19 changes: 11 additions & 8 deletions edx_proctoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from django.db import models
from django.db.models import Q
from django.db.models.base import ObjectDoesNotExist
from django.utils.translation import ugettext_noop
from django.utils.translation import gettext_noop

from edx_proctoring.backends import get_backend_provider
from edx_proctoring.constants import VERIFICATION_DAYS_VALID
Expand Down Expand Up @@ -213,6 +213,7 @@ class ProctoredExamStudentAttemptManager(models.Manager):
"""
Custom manager
"""

def get_current_exam_attempt(self, exam_id, user_id):
"""
Returns the most recent Student Exam Attempt object if found
Expand Down Expand Up @@ -391,11 +392,11 @@ class ProctoredExamStudentAttempt(TimeStampedModel):

# if the user is attempting this as a proctored exam
# in case there is an option to opt-out
taking_as_proctored = models.BooleanField(default=False, verbose_name=ugettext_noop("Taking as Proctored"))
taking_as_proctored = models.BooleanField(default=False, verbose_name=gettext_noop("Taking as Proctored"))

# Whether this attempt is considered a sample attempt, e.g. to try out
# the proctoring software
is_sample_attempt = models.BooleanField(default=False, verbose_name=ugettext_noop("Is Sample Attempt"))
is_sample_attempt = models.BooleanField(default=False, verbose_name=gettext_noop("Is Sample Attempt"))

# what review policy was this exam submitted under
# Note that this is not a foreign key because
Expand All @@ -413,15 +414,15 @@ class ProctoredExamStudentAttempt(TimeStampedModel):
# marks whether the attempt is able to be resumed by user
# Only those attempts which had an error state before, but
# has not yet marked submitted is resumable.
is_resumable = models.BooleanField(default=False, verbose_name=ugettext_noop("Is Resumable"))
is_resumable = models.BooleanField(default=False, verbose_name=gettext_noop("Is Resumable"))

# marks whether or not an attempt has been marked as ready to resume
# by staff. The value of this field does not necessarily mean that an
# attempt is ready to resume by a learner, only that the staff has marked it as such.
ready_to_resume = models.BooleanField(default=False, verbose_name=ugettext_noop("Ready to Resume"))
ready_to_resume = models.BooleanField(default=False, verbose_name=gettext_noop("Ready to Resume"))

# marks whether or not an attempt has been resumed by a learner.
resumed = models.BooleanField(default=False, verbose_name=ugettext_noop("Resumed"))
resumed = models.BooleanField(default=False, verbose_name=gettext_noop("Resumed"))

history = HistoricalRecords(table_name='proctoring_proctoredexamstudentattempt_history')

Expand Down Expand Up @@ -492,6 +493,7 @@ class QuerySetWithUpdateOverride(models.QuerySet):
Custom QuerySet class to make an archive copy
every time the object is updated.
"""

def update(self, **kwargs):
""" Create a copy after update """
super().update(**kwargs)
Expand All @@ -503,6 +505,7 @@ class ProctoredExamStudentAllowanceManager(models.Manager):
Custom manager to override with the custom queryset
to enable archiving on Allowance updation.
"""

def get_queryset(self):
"""
Return a specialized queryset
Expand All @@ -521,8 +524,8 @@ class ProctoredExamStudentAllowance(TimeStampedModel):

# DONT EDIT THE KEYS - THE FIRST VALUE OF THE TUPLE - AS ARE THEY ARE STORED IN THE DATABASE
# THE SECOND ELEMENT OF THE TUPLE IS A DISPLAY STRING AND CAN BE EDITED
ADDITIONAL_TIME_GRANTED = ('additional_time_granted', ugettext_noop('Additional Time (minutes)'))
REVIEW_POLICY_EXCEPTION = ('review_policy_exception', ugettext_noop('Review Policy Exception'))
ADDITIONAL_TIME_GRANTED = ('additional_time_granted', gettext_noop('Additional Time (minutes)'))
REVIEW_POLICY_EXCEPTION = ('review_policy_exception', gettext_noop('Review Policy Exception'))

all_allowances = [
ADDITIONAL_TIME_GRANTED + REVIEW_POLICY_EXCEPTION
Expand Down
11 changes: 1 addition & 10 deletions edx_proctoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@
from django.dispatch import Signal

# Signal that is emitted when an attempt status is updated. Added to utils to avoid cyclic import in signals.py file
exam_attempt_status_signal = Signal(providing_args=[
"attempt_id",
"user_id",
"status",
"full_name",
"profile_name",
"is_practice_exam",
"is_proctored"
"backend_supports_onboarding"
])
exam_attempt_status_signal = Signal()
Loading

0 comments on commit 1c6f355

Please sign in to comment.