Commit cec34841 by Will Daly

Merge pull request #6969 from edx/will/ecom-1055

ECOM-1055: Add messaging for when a student's verification will expire before the deadline
parents d6efd128 6796b07d
...@@ -53,6 +53,7 @@ VERIFY_STATUS_NEED_TO_VERIFY = "verify_need_to_verify" ...@@ -53,6 +53,7 @@ VERIFY_STATUS_NEED_TO_VERIFY = "verify_need_to_verify"
VERIFY_STATUS_SUBMITTED = "verify_submitted" VERIFY_STATUS_SUBMITTED = "verify_submitted"
VERIFY_STATUS_APPROVED = "verify_approved" VERIFY_STATUS_APPROVED = "verify_approved"
VERIFY_STATUS_MISSED_DEADLINE = "verify_missed_deadline" 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): 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 ...@@ -64,6 +65,8 @@ def check_verify_status_by_course(user, course_enrollment_pairs, all_course_mode
but has have not yet been approved. but has have not yet been approved.
* VERIFY_STATUS_APPROVED: The student has been successfully verified. * 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_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: 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. * 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 ...@@ -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 status is None and not submitted:
if deadline is None or deadline > datetime.now(UTC): if deadline is None or deadline > datetime.now(UTC):
# If a user already has an active or pending verification, if has_active_or_pending:
# but it will expire by the deadline, the we do NOT show the # The user has an active verification, but the verification
# verification message. This is because we don't currently # is set to expire before the deadline. Tell the student
# allow users to resubmit an attempt before their current # to reverify.
# attempt expires. status = VERIFY_STATUS_NEED_TO_REVERIFY
if not has_active_or_pending: else:
status = VERIFY_STATUS_NEED_TO_VERIFY status = VERIFY_STATUS_NEED_TO_VERIFY
else: else:
status = VERIFY_STATUS_MISSED_DEADLINE status = VERIFY_STATUS_MISSED_DEADLINE
......
...@@ -13,7 +13,8 @@ from student.helpers import ( ...@@ -13,7 +13,8 @@ from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_NEED_TO_VERIFY,
VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_SUBMITTED,
VERIFY_STATUS_APPROVED, VERIFY_STATUS_APPROVED,
VERIFY_STATUS_MISSED_DEADLINE VERIFY_STATUS_MISSED_DEADLINE,
VERIFY_STATUS_NEED_TO_REVERIFY
) )
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
...@@ -209,7 +210,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): ...@@ -209,7 +210,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
# Expect that the "verify now" message is hidden # Expect that the "verify now" message is hidden
# (since the user isn't allowed to submit another attempt while # (since the user isn't allowed to submit another attempt while
# a verification is active). # 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): def _setup_mode_and_enrollment(self, deadline, enrollment_mode):
"""Create a course mode and enrollment. """Create a course mode and enrollment.
...@@ -235,7 +236,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): ...@@ -235,7 +236,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
VERIFY_STATUS_NEED_TO_VERIFY: "ID verification pending", VERIFY_STATUS_NEED_TO_VERIFY: "ID verification pending",
VERIFY_STATUS_SUBMITTED: "ID verification pending", VERIFY_STATUS_SUBMITTED: "ID verification pending",
VERIFY_STATUS_APPROVED: "ID Verified Ribbon/Badge", 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 = { NOTIFICATION_MESSAGES = {
...@@ -245,6 +247,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): ...@@ -245,6 +247,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
], ],
VERIFY_STATUS_SUBMITTED: ["Thanks for your patience as we process your request."], VERIFY_STATUS_SUBMITTED: ["Thanks for your patience as we process your request."],
VERIFY_STATUS_APPROVED: ["You have already verified your ID!"], VERIFY_STATUS_APPROVED: ["You have already verified your ID!"],
VERIFY_STATUS_NEED_TO_REVERIFY: ["Your verification will expire soon!"]
} }
MODE_CLASSES = { MODE_CLASSES = {
...@@ -252,7 +255,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): ...@@ -252,7 +255,8 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
VERIFY_STATUS_NEED_TO_VERIFY: "verified", VERIFY_STATUS_NEED_TO_VERIFY: "verified",
VERIFY_STATUS_SUBMITTED: "verified", VERIFY_STATUS_SUBMITTED: "verified",
VERIFY_STATUS_APPROVED: "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): def _assert_course_verification_status(self, status):
......
...@@ -10,7 +10,8 @@ from student.helpers import ( ...@@ -10,7 +10,8 @@ from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_NEED_TO_VERIFY,
VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_SUBMITTED,
VERIFY_STATUS_APPROVED, VERIFY_STATUS_APPROVED,
VERIFY_STATUS_MISSED_DEADLINE VERIFY_STATUS_MISSED_DEADLINE,
VERIFY_STATUS_NEED_TO_REVERIFY
) )
%> %>
...@@ -134,7 +135,7 @@ from student.helpers import ( ...@@ -134,7 +135,7 @@ from student.helpers import (
<%include file='_dashboard_certificate_information.html' args='cert_status=cert_status,course=course, enrollment=enrollment'/> <%include file='_dashboard_certificate_information.html' args='cert_status=cert_status,course=course, enrollment=enrollment'/>
% endif % 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"> <div class="message message-status is-shown">
% if verification_status['status'] == VERIFY_STATUS_NEED_TO_VERIFY: % if verification_status['status'] == VERIFY_STATUS_NEED_TO_VERIFY:
<div class="verification-reminder"> <div class="verification-reminder">
...@@ -161,6 +162,11 @@ from student.helpers import ( ...@@ -161,6 +162,11 @@ from student.helpers import (
% if verification_status['verification_good_until'] is not None: % 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'])} <p class="message-copy">${_('Your verification status is good until {date}.').format(date=verification_status['verification_good_until'])}
% endif % 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 % endif
</div> </div>
% endif % endif
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<aside class="content-supplementary"> <aside class="content-supplementary">
<ul class="list-help"> <ul class="list-help">
<li class="help-item help-item-whyreverify"> <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"> <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> </div>
</li> </li>
......
...@@ -60,9 +60,11 @@ ...@@ -60,9 +60,11 @@
<div class="wrapper-reverification"> <div class="wrapper-reverification">
<section class="reverification"> <section class="reverification">
<div class="message"> <div class="message">
<h3 class="title">${_("Please Resubmit Your Verification Information")}</h3> <h3 class="title">${_("Verify Your Identity")}</h3>
<div class="copy"> <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>
</div> </div>
......
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