Add messaging for when a student's verification will expire before the deadline.
This commit is contained in:
@@ -53,6 +53,7 @@ VERIFY_STATUS_NEED_TO_VERIFY = "verify_need_to_verify"
|
||||
VERIFY_STATUS_SUBMITTED = "verify_submitted"
|
||||
VERIFY_STATUS_APPROVED = "verify_approved"
|
||||
VERIFY_STATUS_MISSED_DEADLINE = "verify_missed_deadline"
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY = "verify_need_to_reverify"
|
||||
|
||||
|
||||
def check_verify_status_by_course(user, course_enrollment_pairs, all_course_modes):
|
||||
@@ -64,6 +65,8 @@ def check_verify_status_by_course(user, course_enrollment_pairs, all_course_mode
|
||||
but has have not yet been approved.
|
||||
* VERIFY_STATUS_APPROVED: The student has been successfully verified.
|
||||
* VERIFY_STATUS_MISSED_DEADLINE: The student did not submit photos within the course's deadline.
|
||||
* VERIFY_STATUS_NEED_TO_REVERIFY: The student has an active verification, but it is
|
||||
set to expire before the verification deadline for the course.
|
||||
|
||||
It is is also possible that a course does NOT have a verification status if:
|
||||
* The user is not enrolled in a verified mode, meaning that the user didn't pay.
|
||||
@@ -142,12 +145,12 @@ def check_verify_status_by_course(user, course_enrollment_pairs, all_course_mode
|
||||
)
|
||||
if status is None and not submitted:
|
||||
if deadline is None or deadline > datetime.now(UTC):
|
||||
# If a user already has an active or pending verification,
|
||||
# but it will expire by the deadline, the we do NOT show the
|
||||
# verification message. This is because we don't currently
|
||||
# allow users to resubmit an attempt before their current
|
||||
# attempt expires.
|
||||
if not has_active_or_pending:
|
||||
if has_active_or_pending:
|
||||
# The user has an active verification, but the verification
|
||||
# is set to expire before the deadline. Tell the student
|
||||
# to reverify.
|
||||
status = VERIFY_STATUS_NEED_TO_REVERIFY
|
||||
else:
|
||||
status = VERIFY_STATUS_NEED_TO_VERIFY
|
||||
else:
|
||||
status = VERIFY_STATUS_MISSED_DEADLINE
|
||||
|
||||
@@ -13,7 +13,8 @@ from student.helpers import (
|
||||
VERIFY_STATUS_NEED_TO_VERIFY,
|
||||
VERIFY_STATUS_SUBMITTED,
|
||||
VERIFY_STATUS_APPROVED,
|
||||
VERIFY_STATUS_MISSED_DEADLINE
|
||||
VERIFY_STATUS_MISSED_DEADLINE,
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY
|
||||
)
|
||||
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@@ -209,7 +210,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
|
||||
# Expect that the "verify now" message is hidden
|
||||
# (since the user isn't allowed to submit another attempt while
|
||||
# a verification is active).
|
||||
self._assert_course_verification_status(None)
|
||||
self._assert_course_verification_status(VERIFY_STATUS_NEED_TO_REVERIFY)
|
||||
|
||||
def _setup_mode_and_enrollment(self, deadline, enrollment_mode):
|
||||
"""Create a course mode and enrollment.
|
||||
@@ -235,7 +236,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
|
||||
VERIFY_STATUS_NEED_TO_VERIFY: "ID verification pending",
|
||||
VERIFY_STATUS_SUBMITTED: "ID verification pending",
|
||||
VERIFY_STATUS_APPROVED: "ID Verified Ribbon/Badge",
|
||||
VERIFY_STATUS_MISSED_DEADLINE: "Honor"
|
||||
VERIFY_STATUS_MISSED_DEADLINE: "Honor",
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY: "Honor"
|
||||
}
|
||||
|
||||
NOTIFICATION_MESSAGES = {
|
||||
@@ -245,6 +247,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
|
||||
],
|
||||
VERIFY_STATUS_SUBMITTED: ["Thanks for your patience as we process your request."],
|
||||
VERIFY_STATUS_APPROVED: ["You have already verified your ID!"],
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY: ["Your verification will expire soon!"]
|
||||
}
|
||||
|
||||
MODE_CLASSES = {
|
||||
@@ -252,7 +255,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
|
||||
VERIFY_STATUS_NEED_TO_VERIFY: "verified",
|
||||
VERIFY_STATUS_SUBMITTED: "verified",
|
||||
VERIFY_STATUS_APPROVED: "verified",
|
||||
VERIFY_STATUS_MISSED_DEADLINE: "honor"
|
||||
VERIFY_STATUS_MISSED_DEADLINE: "honor",
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY: "honor"
|
||||
}
|
||||
|
||||
def _assert_course_verification_status(self, status):
|
||||
|
||||
@@ -10,7 +10,8 @@ from student.helpers import (
|
||||
VERIFY_STATUS_NEED_TO_VERIFY,
|
||||
VERIFY_STATUS_SUBMITTED,
|
||||
VERIFY_STATUS_APPROVED,
|
||||
VERIFY_STATUS_MISSED_DEADLINE
|
||||
VERIFY_STATUS_MISSED_DEADLINE,
|
||||
VERIFY_STATUS_NEED_TO_REVERIFY
|
||||
)
|
||||
%>
|
||||
|
||||
@@ -134,7 +135,7 @@ from student.helpers import (
|
||||
<%include file='_dashboard_certificate_information.html' args='cert_status=cert_status,course=course, enrollment=enrollment'/>
|
||||
% endif
|
||||
|
||||
% if verification_status.get('status') in [VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_APPROVED] and not is_course_blocked:
|
||||
% if verification_status.get('status') in [VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_APPROVED, VERIFY_STATUS_NEED_TO_REVERIFY] and not is_course_blocked:
|
||||
<div class="message message-status is-shown">
|
||||
% if verification_status['status'] == VERIFY_STATUS_NEED_TO_VERIFY:
|
||||
<div class="verification-reminder">
|
||||
@@ -161,6 +162,11 @@ from student.helpers import (
|
||||
% if verification_status['verification_good_until'] is not None:
|
||||
<p class="message-copy">${_('Your verification status is good until {date}.').format(date=verification_status['verification_good_until'])}
|
||||
% endif
|
||||
% elif verification_status['status'] == VERIFY_STATUS_NEED_TO_REVERIFY:
|
||||
<h4 class="message-title">${_('Your verification will expire soon!')}</h4>
|
||||
## Translators: start_link and end_link will be replaced with HTML tags;
|
||||
## please do not translate these.
|
||||
<p class="message-copy">${_('Your current verification will expire before the verification deadline for this course. {start_link}Re-verify your identity now{end_link} using a webcam and a government-issued ID.').format(start_link='<a href="{href}">'.format(href=reverse('verify_student_reverify')), end_link='</a>')}</p>
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<aside class="content-supplementary">
|
||||
<ul class="list-help">
|
||||
<li class="help-item help-item-whyreverify">
|
||||
<h3 class="title">${_("Why Do I Need to Re-Verify?")}</h3>
|
||||
<h3 class="title">${_("Why Do I Need to Re-Verify My Identity?")}</h3>
|
||||
<div class="copy">
|
||||
<p>${_("At key points in a course, the professor will ask you to re-verify your identity. We will send the new photo to be matched up with the photo of the original ID you submitted when you signed up for the course.")}</p>
|
||||
<p>${_("You may need to re-verify your identity if an error occurs with your verification or if your verification has expired. All verifications expire after one year. The re-verification process is the same as the original verification process. You need a webcam and a government-issued photo ID.")}</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -60,9 +60,11 @@
|
||||
<div class="wrapper-reverification">
|
||||
<section class="reverification">
|
||||
<div class="message">
|
||||
<h3 class="title">${_("Please Resubmit Your Verification Information")}</h3>
|
||||
<h3 class="title">${_("Verify Your Identity")}</h3>
|
||||
<div class="copy">
|
||||
<p>${_("There was an error with your previous verification. In order proceed in the verified certificate of achievement track of your current courses, please complete the following steps.")}</p>
|
||||
## Translators: {start_bold} and {end_bold} will be replaced with HTML tags.
|
||||
## Please do not translate these variables.
|
||||
<p>${_("To verify your identity and continue as a verified student in this course, complete the following steps {start_bold}before the course verification deadline{end_bold}. If you do not verify your identity, you can still receive an honor code certificate for the course.").format(start_bold="<b>", end_bold="</b>")}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user