Commit f472ac60 by Brian Wilson

minor tweaks to test center registration

parent f912ffe8
...@@ -200,13 +200,37 @@ class TestCenterUser(models.Model): ...@@ -200,13 +200,37 @@ class TestCenterUser(models.Model):
return self.user.email return self.user.email
class TestCenterRegistration(models.Model): class TestCenterRegistration(models.Model):
"""
This is our representation of a user's registration for in-person testing,
and specifically for Pearson at this point. A few things to note:
* Pearson only supports Latin-1, so we have to make sure that the data we
capture here will work with that encoding. This is less of an issue
than for the TestCenterUser.
* Registrations are only created here when a user registers to take an exam in person.
The field names and lengths are modeled on the conventions and constraints
of Pearson's data import system.
"""
# TODO: Check the spec to find out lengths specified by Pearson
testcenter_user = models.ForeignKey(TestCenterUser, unique=True, default=None) testcenter_user = models.ForeignKey(TestCenterUser, unique=True, default=None)
created_at = models.DateTimeField(auto_now_add=True, db_index=True) created_at = models.DateTimeField(auto_now_add=True, db_index=True)
updated_at = models.DateTimeField(auto_now=True, db_index=True) updated_at = models.DateTimeField(auto_now=True, db_index=True)
accommodation_request = models.CharField(max_length=1024) course_id = models.CharField(max_length=128, db_index=True)
# store the original text of the accommodation request.
accommodation_request = models.CharField(max_length=1024, blank=True)
# TODO: this should be an enumeration: # TODO: this should be an enumeration:
accommodation_code = models.CharField(max_length=64) accommodation_code = models.CharField(max_length=64, blank=True)
@property
def candidate_id(self):
return self.testcenter_user.candidate_id
@property
def client_candidate_id(self):
return self.testcenter_user.client_candidate_id
def unique_id_for_user(user): def unique_id_for_user(user):
""" """
......
...@@ -207,11 +207,11 @@ def dashboard(request): ...@@ -207,11 +207,11 @@ def dashboard(request):
# we want to populate the registration page with the relevant information, # we want to populate the registration page with the relevant information,
# if it already exists. Create an empty object otherwise. # if it already exists. Create an empty object otherwise.
try: # try:
testcenteruser = TestCenterUser.objects.get(user=user) # testcenteruser = TestCenterUser.objects.get(user=user)
except TestCenterUser.DoesNotExist: # except TestCenterUser.DoesNotExist:
testcenteruser = TestCenterUser() # testcenteruser = TestCenterUser()
testcenteruser.user = user # testcenteruser.user = user
# Build our courses list for the user, but ignore any courses that no longer # Build our courses list for the user, but ignore any courses that no longer
# exist (because the course IDs have changed). Still, we don't delete those # exist (because the course IDs have changed). Still, we don't delete those
...@@ -252,7 +252,8 @@ def dashboard(request): ...@@ -252,7 +252,8 @@ def dashboard(request):
'show_courseware_links_for' : show_courseware_links_for, 'show_courseware_links_for' : show_courseware_links_for,
'cert_statuses': cert_statuses, 'cert_statuses': cert_statuses,
'news': top_news, 'news': top_news,
'testcenteruser': testcenteruser, # No longer needed here...move to begin_registration
# 'testcenteruser': testcenteruser,
} }
return render_to_response('dashboard.html', context) return render_to_response('dashboard.html', context)
...@@ -692,7 +693,7 @@ def _do_create_or_update_test_center_user(post_vars): ...@@ -692,7 +693,7 @@ def _do_create_or_update_test_center_user(post_vars):
registration = TestCenterRegistration(testcenter_user = testcenter_user) registration = TestCenterRegistration(testcenter_user = testcenter_user)
# registration.register(user) # registration.register(user)
registration.course_id = post_vars['course_id']
registration.accommodation_request = post_vars['accommodations'] registration.accommodation_request = post_vars['accommodations']
return (user, testcenter_user, registration) return (user, testcenter_user, registration)
......
...@@ -239,7 +239,8 @@ ...@@ -239,7 +239,8 @@
</div> </div>
<div class="message message-status is-shown exam-schedule"> <div class="message message-status is-shown exam-schedule">
<a href="#" class="exam-button">Schedule Pearson exam</a> <!-- TODO: pull Pearson destination out into a Setting -->
<a href="https://www1.pearsonvue.com/testtaker/signin/SignInPage/EDX" class="exam-button">Schedule Pearson exam</a>
<p class="exam-registration-number">Registration number: <strong>edx00015879548</strong></p> <p class="exam-registration-number">Registration number: <strong>edx00015879548</strong></p>
<p class="message-copy">Write this down! You’ll need it to schedule your exam.</p> <p class="message-copy">Write this down! You’ll need it to schedule your exam.</p>
</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