Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f472ac60
Commit
f472ac60
authored
Dec 19, 2012
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor tweaks to test center registration
parent
f912ffe8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
10 deletions
+36
-10
common/djangoapps/student/models.py
+26
-2
common/djangoapps/student/views.py
+8
-7
lms/templates/dashboard.html
+2
-1
No files found.
common/djangoapps/student/models.py
View file @
f472ac60
...
...
@@ -200,13 +200,37 @@ class TestCenterUser(models.Model):
return
self
.
user
.
email
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
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
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:
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
):
"""
...
...
common/djangoapps/student/views.py
View file @
f472ac60
...
...
@@ -207,11 +207,11 @@ def dashboard(request):
# we want to populate the registration page with the relevant information,
# if it already exists. Create an empty object otherwise.
try
:
testcenteruser
=
TestCenterUser
.
objects
.
get
(
user
=
user
)
except
TestCenterUser
.
DoesNotExist
:
testcenteruser
=
TestCenterUser
()
testcenteruser
.
user
=
user
#
try:
#
testcenteruser = TestCenterUser.objects.get(user=user)
#
except TestCenterUser.DoesNotExist:
#
testcenteruser = TestCenterUser()
#
testcenteruser.user = user
# 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
...
...
@@ -252,7 +252,8 @@ def dashboard(request):
'show_courseware_links_for'
:
show_courseware_links_for
,
'cert_statuses'
:
cert_statuses
,
'news'
:
top_news
,
'testcenteruser'
:
testcenteruser
,
# No longer needed here...move to begin_registration
# 'testcenteruser': testcenteruser,
}
return
render_to_response
(
'dashboard.html'
,
context
)
...
...
@@ -692,7 +693,7 @@ def _do_create_or_update_test_center_user(post_vars):
registration
=
TestCenterRegistration
(
testcenter_user
=
testcenter_user
)
# registration.register(user)
registration
.
course_id
=
post_vars
[
'course_id'
]
registration
.
accommodation_request
=
post_vars
[
'accommodations'
]
return
(
user
,
testcenter_user
,
registration
)
...
...
lms/templates/dashboard.html
View file @
f472ac60
...
...
@@ -239,7 +239,8 @@
</div>
<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=
"message-copy"
>
Write this down! You’ll need it to schedule your exam.
</p>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment