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
4f37ea91
Commit
4f37ea91
authored
Jan 24, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --create_dummy_exam option to pearson_make_tc_registration
parent
cb2d8db5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
common/djangoapps/student/management/commands/pearson_make_tc_registration.py
+11
-1
No files found.
common/djangoapps/student/management/commands/pearson_make_tc_registration.py
View file @
4f37ea91
...
...
@@ -71,6 +71,12 @@ class Command(BaseCommand):
dest
=
'ignore_registration_dates'
,
help
=
'find exam info for course based on exam_series_code, even if the exam is not active.'
),
make_option
(
'--create_dummy_exam'
,
action
=
'store_true'
,
dest
=
'create_dummy_exam'
,
help
=
'create dummy exam info for course, even if course exists'
),
)
args
=
"<student_username course_id>"
help
=
"Create or modify a TestCenterRegistration entry for a given Student"
...
...
@@ -99,6 +105,7 @@ class Command(BaseCommand):
raise
CommandError
(
"User
\"
{}
\"
does not have an existing demographics record"
.
format
(
username
))
# check to see if a course_id was specified, and use information from that:
create_dummy_exam
=
'create_dummy_exam'
in
our_options
and
our_options
[
'create_dummy_exam'
]
try
:
course
=
course_from_id
(
course_id
)
if
'ignore_registration_dates'
in
our_options
:
...
...
@@ -107,6 +114,9 @@ class Command(BaseCommand):
else
:
exam
=
course
.
current_test_center_exam
except
ItemNotFoundError
:
create_dummy_exam
=
True
if
exam
is
None
and
create_dummy_exam
:
# otherwise use explicit values (so we don't have to define a course):
exam_name
=
"Dummy Placeholder Name"
exam_info
=
{
'Exam_Series_Code'
:
our_options
[
'exam_series_code'
],
...
...
@@ -120,7 +130,7 @@ class Command(BaseCommand):
our_options
[
'eligibility_appointment_date_last'
]
=
strftime
(
"
%
Y-
%
m-
%
d"
,
exam
.
last_eligible_appointment_date
)
if
exam
is
None
:
raise
CommandError
(
"Exam for course_id {
%
s
} does not exist"
.
format
(
course_id
))
raise
CommandError
(
"Exam for course_id {} does not exist"
.
format
(
course_id
))
exam_code
=
exam
.
exam_series_code
...
...
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