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
740d0403
Commit
740d0403
authored
Jan 22, 2013
by
Brian Wilson
Committed by
Ashley Penney
Jan 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change name of function back to get_testcenter_registration, and disable its use as a test
parent
f4703b40
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
common/djangoapps/student/management/commands/pearson_make_tc_registration.py
+3
-3
common/djangoapps/student/management/commands/tests/test_pearson.py
+2
-2
common/djangoapps/student/models.py
+6
-2
common/djangoapps/student/views.py
+3
-3
No files found.
common/djangoapps/student/management/commands/pearson_make_tc_registration.py
View file @
740d0403
...
@@ -4,7 +4,7 @@ from time import strftime
...
@@ -4,7 +4,7 @@ from time import strftime
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management.base
import
BaseCommand
,
CommandError
from
student.models
import
TestCenterUser
,
TestCenterRegistration
,
TestCenterRegistrationForm
,
get_t
c
_registration
from
student.models
import
TestCenterUser
,
TestCenterRegistration
,
TestCenterRegistrationForm
,
get_t
estcenter
_registration
from
student.views
import
course_from_id
from
student.views
import
course_from_id
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
...
@@ -134,7 +134,7 @@ class Command(BaseCommand):
...
@@ -134,7 +134,7 @@ class Command(BaseCommand):
# create and save the registration:
# create and save the registration:
needs_updating
=
False
needs_updating
=
False
registrations
=
get_t
c
_registration
(
student
,
course_id
,
exam_code
)
registrations
=
get_t
estcenter
_registration
(
student
,
course_id
,
exam_code
)
if
len
(
registrations
)
>
0
:
if
len
(
registrations
)
>
0
:
registration
=
registrations
[
0
]
registration
=
registrations
[
0
]
for
fieldname
in
UPDATE_FIELDS
:
for
fieldname
in
UPDATE_FIELDS
:
...
@@ -181,7 +181,7 @@ class Command(BaseCommand):
...
@@ -181,7 +181,7 @@ class Command(BaseCommand):
change_internal
=
False
change_internal
=
False
if
'exam_series_code'
in
our_options
:
if
'exam_series_code'
in
our_options
:
exam_code
=
our_options
[
'exam_series_code'
]
exam_code
=
our_options
[
'exam_series_code'
]
registration
=
get_t
c
_registration
(
student
,
course_id
,
exam_code
)[
0
]
registration
=
get_t
estcenter
_registration
(
student
,
course_id
,
exam_code
)[
0
]
for
internal_field
in
[
'upload_error_message'
,
'upload_status'
,
'authorization_id'
]:
for
internal_field
in
[
'upload_error_message'
,
'upload_status'
,
'authorization_id'
]:
if
internal_field
in
our_options
:
if
internal_field
in
our_options
:
registration
.
__setattr__
(
internal_field
,
our_options
[
internal_field
])
registration
.
__setattr__
(
internal_field
,
our_options
[
internal_field
])
...
...
common/djangoapps/student/management/commands/tests/test_pearson.py
View file @
740d0403
...
@@ -12,7 +12,7 @@ import sys
...
@@ -12,7 +12,7 @@ import sys
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core
import
management
from
django.core
import
management
from
student.models
import
User
,
TestCenterRegistration
,
TestCenterUser
,
get_t
c
_registration
from
student.models
import
User
,
TestCenterRegistration
,
TestCenterUser
,
get_t
estcenter
_registration
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -44,7 +44,7 @@ def create_tc_registration(username, course_id, exam_code, accommodation_code):
...
@@ -44,7 +44,7 @@ def create_tc_registration(username, course_id, exam_code, accommodation_code):
management
.
call_command
(
'pearson_make_tc_registration'
,
username
,
course_id
,
**
options
)
management
.
call_command
(
'pearson_make_tc_registration'
,
username
,
course_id
,
**
options
)
user
=
User
.
objects
.
get
(
username
=
username
)
user
=
User
.
objects
.
get
(
username
=
username
)
registrations
=
get_t
c
_registration
(
user
,
course_id
,
exam_code
)
registrations
=
get_t
estcenter
_registration
(
user
,
course_id
,
exam_code
)
return
registrations
[
0
]
return
registrations
[
0
]
class
PearsonTestCase
(
TestCase
):
class
PearsonTestCase
(
TestCase
):
...
...
common/djangoapps/student/models.py
View file @
740d0403
...
@@ -547,13 +547,17 @@ class TestCenterRegistrationForm(ModelForm):
...
@@ -547,13 +547,17 @@ class TestCenterRegistrationForm(ModelForm):
def
get_t
c
_registration
(
user
,
course_id
,
exam_series_code
):
def
get_t
estcenter
_registration
(
user
,
course_id
,
exam_series_code
):
try
:
try
:
tcu
=
TestCenterUser
.
objects
.
get
(
user
=
user
)
tcu
=
TestCenterUser
.
objects
.
get
(
user
=
user
)
except
TestCenterUser
.
DoesNotExist
:
except
TestCenterUser
.
DoesNotExist
:
return
[]
return
[]
return
TestCenterRegistration
.
objects
.
filter
(
testcenter_user
=
tcu
,
course_id
=
course_id
,
exam_series_code
=
exam_series_code
)
return
TestCenterRegistration
.
objects
.
filter
(
testcenter_user
=
tcu
,
course_id
=
course_id
,
exam_series_code
=
exam_series_code
)
# nosetests thinks that anything with _test_ in the name is a test.
# Correct this (https://nose.readthedocs.org/en/latest/finding_tests.html)
get_testcenter_registration
.
__test__
=
False
def
unique_id_for_user
(
user
):
def
unique_id_for_user
(
user
):
"""
"""
Return a unique id for a user, suitable for inserting into
Return a unique id for a user, suitable for inserting into
...
...
common/djangoapps/student/views.py
View file @
740d0403
...
@@ -31,7 +31,7 @@ from student.models import (Registration, UserProfile, TestCenterUser, TestCente
...
@@ -31,7 +31,7 @@ from student.models import (Registration, UserProfile, TestCenterUser, TestCente
TestCenterRegistration
,
TestCenterRegistrationForm
,
TestCenterRegistration
,
TestCenterRegistrationForm
,
PendingNameChange
,
PendingEmailChange
,
PendingNameChange
,
PendingEmailChange
,
CourseEnrollment
,
unique_id_for_user
,
CourseEnrollment
,
unique_id_for_user
,
get_t
c
_registration
)
get_t
estcenter
_registration
)
from
certificates.models
import
CertificateStatuses
,
certificate_status_for_student
from
certificates.models
import
CertificateStatuses
,
certificate_status_for_student
...
@@ -612,7 +612,7 @@ def exam_registration_info(user, course):
...
@@ -612,7 +612,7 @@ def exam_registration_info(user, course):
return
None
return
None
exam_code
=
exam_info
.
exam_series_code
exam_code
=
exam_info
.
exam_series_code
registrations
=
get_t
c
_registration
(
user
,
course
.
id
,
exam_code
)
registrations
=
get_t
estcenter
_registration
(
user
,
course
.
id
,
exam_code
)
if
registrations
:
if
registrations
:
registration
=
registrations
[
0
]
registration
=
registrations
[
0
]
else
:
else
:
...
@@ -712,7 +712,7 @@ def create_exam_registration(request, post_override=None):
...
@@ -712,7 +712,7 @@ def create_exam_registration(request, post_override=None):
needs_saving
=
False
needs_saving
=
False
exam
=
course
.
current_test_center_exam
exam
=
course
.
current_test_center_exam
exam_code
=
exam
.
exam_series_code
exam_code
=
exam
.
exam_series_code
registrations
=
get_t
c
_registration
(
user
,
course_id
,
exam_code
)
registrations
=
get_t
estcenter
_registration
(
user
,
course_id
,
exam_code
)
if
registrations
:
if
registrations
:
registration
=
registrations
[
0
]
registration
=
registrations
[
0
]
# NOTE: we do not bother to check here to see if the registration has changed,
# NOTE: we do not bother to check here to see if the registration has changed,
...
...
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