hook up more registration status boxes
This commit is contained in:
@@ -0,0 +1,208 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Adding field 'TestCenterUser.processed_at'
|
||||
db.add_column('student_testcenteruser', 'processed_at',
|
||||
self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True),
|
||||
keep_default=False)
|
||||
|
||||
# Adding field 'TestCenterUser.confirmed_at'
|
||||
db.add_column('student_testcenteruser', 'confirmed_at',
|
||||
self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True),
|
||||
keep_default=False)
|
||||
|
||||
# Adding field 'TestCenterRegistration.processed_at'
|
||||
db.add_column('student_testcenterregistration', 'processed_at',
|
||||
self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True),
|
||||
keep_default=False)
|
||||
|
||||
# Adding field 'TestCenterRegistration.authorization_id'
|
||||
db.add_column('student_testcenterregistration', 'authorization_id',
|
||||
self.gf('django.db.models.fields.IntegerField')(null=True, db_index=True),
|
||||
keep_default=False)
|
||||
|
||||
# Adding field 'TestCenterRegistration.confirmed_at'
|
||||
db.add_column('student_testcenterregistration', 'confirmed_at',
|
||||
self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True),
|
||||
keep_default=False)
|
||||
|
||||
# Adding index on 'TestCenterRegistration', fields ['accommodation_request']
|
||||
db.create_index('student_testcenterregistration', ['accommodation_request'])
|
||||
|
||||
# Adding index on 'TestCenterRegistration', fields ['upload_status']
|
||||
db.create_index('student_testcenterregistration', ['upload_status'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Removing index on 'TestCenterRegistration', fields ['upload_status']
|
||||
db.delete_index('student_testcenterregistration', ['upload_status'])
|
||||
|
||||
# Removing index on 'TestCenterRegistration', fields ['accommodation_request']
|
||||
db.delete_index('student_testcenterregistration', ['accommodation_request'])
|
||||
|
||||
# Deleting field 'TestCenterUser.processed_at'
|
||||
db.delete_column('student_testcenteruser', 'processed_at')
|
||||
|
||||
# Deleting field 'TestCenterUser.confirmed_at'
|
||||
db.delete_column('student_testcenteruser', 'confirmed_at')
|
||||
|
||||
# Deleting field 'TestCenterRegistration.processed_at'
|
||||
db.delete_column('student_testcenterregistration', 'processed_at')
|
||||
|
||||
# Deleting field 'TestCenterRegistration.authorization_id'
|
||||
db.delete_column('student_testcenterregistration', 'authorization_id')
|
||||
|
||||
# Deleting field 'TestCenterRegistration.confirmed_at'
|
||||
db.delete_column('student_testcenterregistration', 'confirmed_at')
|
||||
|
||||
|
||||
models = {
|
||||
'auth.group': {
|
||||
'Meta': {'object_name': 'Group'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
|
||||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
|
||||
},
|
||||
'auth.permission': {
|
||||
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
|
||||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
'auth.user': {
|
||||
'Meta': {'object_name': 'User'},
|
||||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
|
||||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
|
||||
},
|
||||
'contenttypes.contenttype': {
|
||||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
|
||||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
'student.courseenrollment': {
|
||||
'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'},
|
||||
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
|
||||
},
|
||||
'student.pendingemailchange': {
|
||||
'Meta': {'object_name': 'PendingEmailChange'},
|
||||
'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
|
||||
},
|
||||
'student.pendingnamechange': {
|
||||
'Meta': {'object_name': 'PendingNameChange'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
|
||||
'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
|
||||
},
|
||||
'student.registration': {
|
||||
'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"},
|
||||
'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
|
||||
},
|
||||
'student.testcenterregistration': {
|
||||
'Meta': {'object_name': 'TestCenterRegistration'},
|
||||
'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}),
|
||||
'accommodation_request': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1024', 'blank': 'True'}),
|
||||
'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
|
||||
'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
|
||||
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
|
||||
'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
|
||||
'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}),
|
||||
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
|
||||
'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}),
|
||||
'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})
|
||||
},
|
||||
'student.testcenteruser': {
|
||||
'Meta': {'object_name': 'TestCenterUser'},
|
||||
'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
|
||||
'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}),
|
||||
'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}),
|
||||
'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}),
|
||||
'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
|
||||
'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}),
|
||||
'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}),
|
||||
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}),
|
||||
'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}),
|
||||
'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
|
||||
'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}),
|
||||
'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}),
|
||||
'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}),
|
||||
'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
|
||||
'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}),
|
||||
'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
|
||||
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
|
||||
'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}),
|
||||
'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}),
|
||||
'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})
|
||||
},
|
||||
'student.userprofile': {
|
||||
'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"},
|
||||
'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}),
|
||||
'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}),
|
||||
'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
|
||||
'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}),
|
||||
'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
|
||||
'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}),
|
||||
'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'})
|
||||
},
|
||||
'student.usertestgroup': {
|
||||
'Meta': {'object_name': 'UserTestGroup'},
|
||||
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}),
|
||||
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['student']
|
||||
@@ -131,6 +131,9 @@ class UserProfile(models.Model):
|
||||
def set_meta(self, js):
|
||||
self.meta = json.dumps(js)
|
||||
|
||||
TEST_CENTER_STATUS_ACCEPTED = "Accepted"
|
||||
TEST_CENTER_STATUS_ERROR = "Error"
|
||||
|
||||
class TestCenterUser(models.Model):
|
||||
"""This is our representation of the User for in-person testing, and
|
||||
specifically for Pearson at this point. A few things to note:
|
||||
@@ -159,10 +162,6 @@ class TestCenterUser(models.Model):
|
||||
# updated_at, this will not get incremented when we do a batch data import.
|
||||
user_updated_at = models.DateTimeField(db_index=True)
|
||||
|
||||
# Unique ID given to us for this User by the Testing Center. It's null when
|
||||
# we first create the User entry, and is assigned by Pearson later.
|
||||
candidate_id = models.IntegerField(null=True, db_index=True)
|
||||
|
||||
# Unique ID we assign our user for the Test Center.
|
||||
client_candidate_id = models.CharField(unique=True, max_length=50, db_index=True)
|
||||
|
||||
@@ -197,10 +196,21 @@ class TestCenterUser(models.Model):
|
||||
# Company
|
||||
company_name = models.CharField(max_length=50, blank=True, db_index=True)
|
||||
|
||||
# Confirmation
|
||||
upload_status = models.CharField(max_length=20, blank=True, db_index=True) # 'Error' or 'Accepted'
|
||||
# time at which edX sent the registration to the test center
|
||||
uploaded_at = models.DateTimeField(null=True, blank=True, db_index=True)
|
||||
|
||||
# confirmation back from the test center, as well as timestamps
|
||||
# on when they processed the request, and when we received
|
||||
# confirmation back.
|
||||
processed_at = models.DateTimeField(null=True, db_index=True)
|
||||
upload_status = models.CharField(max_length=20, blank=True, db_index=True) # 'Error' or 'Accepted'
|
||||
upload_error_message = models.CharField(max_length=512, blank=True)
|
||||
# Unique ID given to us for this User by the Testing Center. It's null when
|
||||
# we first create the User entry, and may be assigned by Pearson later.
|
||||
# (However, it may never be set if we are always initiating such candidate creation.)
|
||||
candidate_id = models.IntegerField(null=True, db_index=True)
|
||||
confirmed_at = models.DateTimeField(null=True, db_index=True)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def user_provided_fields():
|
||||
@@ -237,14 +247,17 @@ class TestCenterUser(models.Model):
|
||||
testcenter_user.client_candidate_id = cand_id
|
||||
return testcenter_user
|
||||
|
||||
@property
|
||||
def is_accepted(self):
|
||||
return self.upload_status == 'Accepted'
|
||||
return self.upload_status == TEST_CENTER_STATUS_ACCEPTED
|
||||
|
||||
@property
|
||||
def is_rejected(self):
|
||||
return self.upload_status == 'Error'
|
||||
return self.upload_status == TEST_CENTER_STATUS_ERROR
|
||||
|
||||
@property
|
||||
def is_pending(self):
|
||||
return self.upload_status == ''
|
||||
return not self.is_accepted and not self.is_rejected
|
||||
|
||||
class TestCenterUserForm(ModelForm):
|
||||
class Meta:
|
||||
@@ -313,19 +326,21 @@ class TestCenterUserForm(ModelForm):
|
||||
# Always return the full collection of cleaned data.
|
||||
return cleaned_data
|
||||
|
||||
|
||||
# our own code to indicate that a request has been rejected.
|
||||
ACCOMMODATION_REJECTED_CODE = 'NONE'
|
||||
|
||||
ACCOMODATION_CODES = (
|
||||
(ACCOMMODATION_REJECTED_CODE, 'No Accommodation Granted'),
|
||||
('EQPMNT', 'Equipment'),
|
||||
('ET12ET', 'Extra Time - 1/2 Exam Time'),
|
||||
('ET30MN', 'Extra Time - 30 Minutes'),
|
||||
('ETDBTM', 'Extra Time - Double Time'),
|
||||
('SEPRMM', 'Separate Room'),
|
||||
('SRREAD', 'Separate Room & Reader'),
|
||||
('SRRERC', 'Separate Room & Reader/Recorder'),
|
||||
('SRRECR', 'Separate Room & Recorder'),
|
||||
('SRSEAN', 'Separate Room & Service Animal'),
|
||||
('SRSGNR', 'Separate Room & Sign Lang Interp'),
|
||||
('SRREAD', 'Separate Room and Reader'),
|
||||
('SRRERC', 'Separate Room and Reader/Recorder'),
|
||||
('SRRECR', 'Separate Room and Recorder'),
|
||||
('SRSEAN', 'Separate Room and Service Animal'),
|
||||
('SRSGNR', 'Separate Room and Sign Language Interpreter'),
|
||||
)
|
||||
|
||||
class TestCenterRegistration(models.Model):
|
||||
@@ -355,7 +370,7 @@ class TestCenterRegistration(models.Model):
|
||||
# The appointment dates, the exam count, and the accommodation codes can be updated,
|
||||
# but hopefully this won't happen often.
|
||||
user_updated_at = models.DateTimeField(db_index=True)
|
||||
# "client_authorization_id" is the client's unique identifier for the authorization.
|
||||
# "client_authorization_id" is our unique identifier for the authorization.
|
||||
# This must be present for an update or delete to be sent to Pearson.
|
||||
client_authorization_id = models.CharField(max_length=20, unique=True, db_index=True)
|
||||
|
||||
@@ -365,17 +380,28 @@ class TestCenterRegistration(models.Model):
|
||||
eligibility_appointment_date_last = models.DateField(db_index=True)
|
||||
|
||||
# this is really a list of codes, using an '*' as a delimiter.
|
||||
# So it's not a choice list.
|
||||
# So it's not a choice list. We use the special value of ACCOMMODATION_REJECTED_CODE
|
||||
# to indicate the rejection of an accommodation request.
|
||||
accommodation_code = models.CharField(max_length=64, blank=True)
|
||||
|
||||
# store the original text of the accommodation request.
|
||||
accommodation_request = models.CharField(max_length=1024, blank=True)
|
||||
accommodation_request = models.CharField(max_length=1024, blank=True, db_index=True)
|
||||
|
||||
# Confirmation
|
||||
upload_status = models.CharField(max_length=20, blank=True) # 'Error' or 'Accepted'
|
||||
# time at which edX sent the registration to the test center
|
||||
uploaded_at = models.DateTimeField(null=True, db_index=True)
|
||||
upload_error_message = models.CharField(max_length=512, blank=True)
|
||||
|
||||
# confirmation back from the test center, as well as timestamps
|
||||
# on when they processed the request, and when we received
|
||||
# confirmation back.
|
||||
processed_at = models.DateTimeField(null=True, db_index=True)
|
||||
upload_status = models.CharField(max_length=20, blank=True, db_index=True) # 'Error' or 'Accepted'
|
||||
upload_error_message = models.CharField(max_length=512, blank=True)
|
||||
# Unique ID given to us for this registration by the Testing Center. It's null when
|
||||
# we first create the registration entry, and may be assigned by Pearson later.
|
||||
# (However, it may never be set if we are always initiating such candidate creation.)
|
||||
authorization_id = models.IntegerField(null=True, db_index=True)
|
||||
confirmed_at = models.DateTimeField(null=True, db_index=True)
|
||||
|
||||
@property
|
||||
def candidate_id(self):
|
||||
return self.testcenter_user.candidate_id
|
||||
@@ -389,11 +415,11 @@ class TestCenterRegistration(models.Model):
|
||||
registration = TestCenterRegistration(testcenter_user = testcenter_user)
|
||||
registration.course_id = exam.course_id
|
||||
registration.accommodation_request = accommodation_request
|
||||
registration.exam_series_code = exam.exam_series_code # .get('Exam_Series_Code')
|
||||
registration.exam_series_code = exam.exam_series_code
|
||||
registration.eligibility_appointment_date_first = strftime("%Y-%m-%d", exam.first_eligible_appointment_date)
|
||||
registration.eligibility_appointment_date_last = strftime("%Y-%m-%d", exam.last_eligible_appointment_date)
|
||||
# accommodation_code remains blank for now, along with Pearson confirmation
|
||||
registration.client_authorization_id = registration._create_client_authorization_id()
|
||||
registration.client_authorization_id = TestCenterRegistration._create_client_authorization_id()
|
||||
# accommodation_code remains blank for now, along with Pearson confirmation information
|
||||
return registration
|
||||
|
||||
@staticmethod
|
||||
@@ -402,7 +428,8 @@ class TestCenterRegistration(models.Model):
|
||||
return u"edX%0d" % randint(1, 10**NUM_DIGITS-1) # binascii.hexlify(os.urandom(8))
|
||||
|
||||
|
||||
def _create_client_authorization_id(self):
|
||||
@staticmethod
|
||||
def _create_client_authorization_id():
|
||||
"""
|
||||
Return a unique id for a registration, suitable for using as an authorization code
|
||||
for Pearson. It must fit within 20 characters.
|
||||
@@ -413,17 +440,68 @@ class TestCenterRegistration(models.Model):
|
||||
auth_id = TestCenterRegistration._generate_authorization_id()
|
||||
return auth_id
|
||||
|
||||
def is_accepted(self):
|
||||
return self.upload_status == 'Accepted' and self.testcenter_user.is_accepted()
|
||||
# methods for providing registration status details on registration page:
|
||||
@property
|
||||
def demographics_is_accepted(self):
|
||||
return self.testcenter_user.is_accepted
|
||||
|
||||
@property
|
||||
def demographics_is_rejected(self):
|
||||
return self.testcenter_user.is_rejected
|
||||
|
||||
@property
|
||||
def demographics_is_pending(self):
|
||||
return self.testcenter_user.is_pending
|
||||
|
||||
@property
|
||||
def accommodation_is_accepted(self):
|
||||
return len(self.accommodation_request) > 0 and len(self.accommodation_code) > 0 and self.accommodation_code != ACCOMMODATION_REJECTED_CODE
|
||||
|
||||
@property
|
||||
def accommodation_is_rejected(self):
|
||||
return len(self.accommodation_request) > 0 and self.accommodation_code == ACCOMMODATION_REJECTED_CODE
|
||||
|
||||
@property
|
||||
def accommodation_is_pending(self):
|
||||
return len(self.accommodation_request) > 0 and len(self.accommodation_code) == 0
|
||||
|
||||
@property
|
||||
def accommodation_is_skipped(self):
|
||||
return len(self.accommodation_request) == 0
|
||||
|
||||
@property
|
||||
def registration_is_accepted(self):
|
||||
return self.upload_status == TEST_CENTER_STATUS_ACCEPTED
|
||||
|
||||
def is_rejected(self):
|
||||
return self.upload_status == 'Error' or self.testcenter_user.is_rejected()
|
||||
@property
|
||||
def registration_is_rejected(self):
|
||||
return self.upload_status == TEST_CENTER_STATUS_ERROR
|
||||
|
||||
@property
|
||||
def registration_is_pending(self):
|
||||
return not self.registration_is_accepted and not self.registration_is_rejected
|
||||
|
||||
# methods for providing registration status summary on dashboard page:
|
||||
@property
|
||||
def is_accepted(self):
|
||||
return self.registration_is_accepted and self.demographics_is_accepted
|
||||
|
||||
@property
|
||||
def is_rejected(self):
|
||||
return self.registration_is_rejected or self.demographics_is_rejected
|
||||
|
||||
@property
|
||||
def is_pending(self):
|
||||
return not self.is_accepted and not self.is_rejected
|
||||
|
||||
@property
|
||||
def is_pending_accommodation(self):
|
||||
return len(self.accommodation_request) > 0 and self.accommodation_code == ''
|
||||
return self.accommodation_is_pending
|
||||
|
||||
@property
|
||||
def is_pending_acknowledgement(self):
|
||||
return (self.upload_status == '' or self.testcenter_user.is_pending()) and not self.is_pending_accommodation()
|
||||
return (not self.is_accepted and not self.is_rejected) and not self.is_pending_accommodation
|
||||
|
||||
|
||||
class TestCenterRegistrationForm(ModelForm):
|
||||
class Meta:
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
% endif
|
||||
<!-- display a registration for a current exam, even if the registration period is over -->
|
||||
% if registration is not None:
|
||||
% if registration.is_accepted():
|
||||
% if registration.is_accepted:
|
||||
<div class="message message-status is-shown exam-schedule">
|
||||
<!-- 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>
|
||||
@@ -242,7 +242,7 @@
|
||||
<p class="message-copy">Write this down! You’ll need it to schedule your exam.</p>
|
||||
</div>
|
||||
% endif
|
||||
% if registration.is_rejected():
|
||||
% if registration.is_rejected:
|
||||
<!-- TODO: revise rejection text -->
|
||||
<div class="message message-status is-shown exam-schedule">
|
||||
<a href="mailto:exam-help@edx.org?subject=Pearson VUE Exam - ${get_course_about_section(course, 'university')} ${course.number}" class="button contact-button">Contact exam-help@edx.org</a>
|
||||
@@ -253,7 +253,7 @@
|
||||
|
||||
</div>
|
||||
% endif
|
||||
% if not registration.is_accepted() and not registration.is_rejected():
|
||||
% if not registration.is_accepted and not registration.is_rejected:
|
||||
<div class="message message-status is-shown">
|
||||
<p class="message-copy">Your
|
||||
<a href="${testcenter_register_target}" id="exam_register_link">registration for the Pearson exam</a>
|
||||
|
||||
@@ -103,25 +103,29 @@
|
||||
|
||||
% if registration:
|
||||
|
||||
<!-- NOTE: reg rejected -->
|
||||
% if registration.is_rejected:
|
||||
<section class="status message message-flash registration-rejected message-action">
|
||||
<h3 class="message-title">Your registration for the Pearson exam has been rejected</h3>
|
||||
<p class="message-copy">Please check the information you provided, and try to correct any demographic errors. Otherwise contact someone at edX or Pearson, or just scream for help.</p>
|
||||
<a href="mailto:exam-help@edx.org?subject=Pearson VUE Exam - ${get_course_about_section(course, 'university')} ${course.number}" class="button contact-button">Contact exam-help@edx.org</a>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
<!-- NOTE: reg processed -->
|
||||
% if registration.is_accepted:
|
||||
<section class="status message message-flash registration-processed message-action">
|
||||
<h3 class="message-title">Your registration for the Pearson exam has been processed</h3>
|
||||
<p class="message-copy">Your registration number is <strong>12345678901</strong> (Write this down! You’ll need it to schedule your exam.)</p>
|
||||
<p class="message-copy">Your registration number is <strong>${registration.client_authorization_id}</strong> (Write this down! You’ll need it to schedule your exam.)</p>
|
||||
<a href="https://www1.pearsonvue.com/testtaker/signin/SignInPage/EDX" class="button exam-button">Schedule Pearson exam</a>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
<!-- NOTE: reg pending -->
|
||||
% if registration.is_pending:
|
||||
<section class="status message message-flash registration-pending">
|
||||
<h3 class="message-title">Your registration for the Pearson exam is pending</h3>
|
||||
<p class="message-copy">Once your information is processed, it will be forwarded to Pearson and you will be able to schedule an exam.</p>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
% endif
|
||||
|
||||
<section class="content">
|
||||
@@ -141,10 +145,10 @@
|
||||
% endif
|
||||
|
||||
<!-- include these as pass-throughs -->
|
||||
<input id="id_email" type="hidden" name="email" maxlength="75" value="${user.email}" />
|
||||
<input id="id_username" type="hidden" name="username" maxlength="75" value="${user.username}" />
|
||||
<input id="id_course_id" type="hidden" name="course_id" maxlength="75" value="${course.id}" />
|
||||
<input id="id_course_id" type="hidden" name="exam_series_code" maxlength="75" value="${exam_info.exam_series_code}" />
|
||||
<input id="id_email" type="hidden" name="email" value="${user.email}" />
|
||||
<input id="id_username" type="hidden" name="username" value="${user.username}" />
|
||||
<input id="id_course_id" type="hidden" name="course_id" value="${course.id}" />
|
||||
<input id="id_course_id" type="hidden" name="exam_series_code" value="${exam_info.exam_series_code}" />
|
||||
|
||||
<div class="form-fields-primary">
|
||||
<fieldset class="group group-form group-form-personalinformation">
|
||||
@@ -312,6 +316,88 @@
|
||||
<aside>
|
||||
% if registration:
|
||||
|
||||
% if registration.is_accepted:
|
||||
<div class="message message-status registration-processed is-shown">
|
||||
% endif
|
||||
% if registration.is_rejected:
|
||||
<div class="message message-status registration-rejected is-shown">
|
||||
% endif
|
||||
% if registration.is_pending:
|
||||
<div class="message message-status registration-pending is-shown">
|
||||
% endif
|
||||
<h3>Pearson Exam Registration Status</h3>
|
||||
|
||||
<ol class="status-list">
|
||||
<!-- first provide status of demographics -->
|
||||
% if registration.demographics_is_pending:
|
||||
<li class="item status status-pending status-demographics">
|
||||
<h4 class="title">Demographic Information</h4>
|
||||
<p class="details">The demographic information you most recently provided is pending. You may edit this information at any point before exam registration closes on <strong>${exam_info.registration_end_date_text}</strong></p>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.demographics_is_accepted:
|
||||
<li class="item status status-processed status-demographics">
|
||||
<h4 class="title">Demographic Information</h4>
|
||||
<p class="details">The demographic information you most recently provided has been processed. You may edit this information at any point before exam registration closes on <strong>${exam_info.registration_end_date_text}</strong></p>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.demographics_is_rejected:
|
||||
<li class="item status status-rejected status-demographics">
|
||||
<h4 class="title">Demographic Information</h4>
|
||||
<p class="details">The demographic information you most recently provided has been rejected by Pearson. You can correct and submit it again before the exam registration closes on <strong>${exam_info.registration_end_date_text}</strong>.</p>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
<!-- then provide status of accommodations, if any -->
|
||||
% if registration.accommodation_is_pending:
|
||||
<li class="item status status-pending status-accommodations">
|
||||
<h4 class="title">Accommodations Request</h4>
|
||||
<p class="details">Your requested accommodations are pending. Within a few days, you should see confirmation here of granted accommodations.</p>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.accommodation_is_accepted:
|
||||
<li class="item status status-processed status-accommodations">
|
||||
<h4 class="title">Accommodations Request</h4>
|
||||
<p class="details">Your requested accommodations have been reviewed and processed. You are allowed:</p>
|
||||
|
||||
<ul class="accommodations-list">
|
||||
<li class="item">Extra Time - Double Time</li>
|
||||
<li class="item">Separate Room & Reader/Recorder</li>
|
||||
<li class="item">Equipment</li>
|
||||
</ul>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.accommodation_is_rejected:
|
||||
<li class="item status status-processed status-accommodations">
|
||||
<h4 class="title">Accommodations Request</h4>
|
||||
<p class="details">Your requested accommodations have been reviewed and processed. You are allowed no accommodations.</p>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
<!-- finally provide status of registration -->
|
||||
% if registration.registration_is_pending:
|
||||
<li class="item status status-pending status-registration">
|
||||
<h4 class="title">Registration Request</h4>
|
||||
<p class="details">Your exam registration is pending. Once your information is processed, it will be forwarded to Pearson and you will be able to schedule an exam.</p>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.registration_is_accepted:
|
||||
<li class="item status status-processed status-registration">
|
||||
<h4 class="title">Registration Request</h4>
|
||||
<p class="details">Your exam registration has been processed and has been forwarded to Pearson. You are now able to schedule an exam.</p>
|
||||
</li>
|
||||
% endif
|
||||
% if registration.registration_is_rejected:
|
||||
<li class="item status status-rejected status-registration">
|
||||
<h4 class="title">Registration Request</h4>
|
||||
<p class="details">Your exam registration has been rejected by Pearson. <strong>You currently cannot schedule an exam</strong>.</p>
|
||||
</li>
|
||||
% endif
|
||||
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- NOTE: Dem processed, Accom pending, Registration pending -->
|
||||
<div class="message message-status registration-pending is-shown">
|
||||
<h3>Pearson Exam Registration Status</h3>
|
||||
|
||||
Reference in New Issue
Block a user