Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
OpenEdx
configuration
Commits
9493688c
Commit
9493688c
authored
Aug 08, 2017
by
Shirley He
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more required fields
parent
60aed232
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
util/course-permutation-tool/generate_permutations.py
+20
-7
No files found.
util/course-permutation-tool/generate_permutations.py
View file @
9493688c
...
...
@@ -44,9 +44,13 @@ def parse_field_arguments():
for
permutation_choices
in
num_args
.
fields
:
for
i
in
range
(
0
,
field_length
):
fields
[
permutation_choices
[
i
]]
=
permutation_data
[
permutation_choices
[
i
]]
# for j in range(field_length, total_num_fields):
# fields[permutation_choices[j]] =
# print permutation_data.keys() not in permutation_choices
# the difference btwn all possible fields and the permutation ones
default_fields
=
list
(
set
(
default_data_keys
)
-
set
(
num_args
.
fields
[
0
]))
# add non permutation fields
for
j
in
range
(
0
,
len
(
default_fields
)):
fields
[
default_fields
[
j
]]
=
default_data
[
default_fields
[
j
]]
return
fields
...
...
@@ -59,12 +63,14 @@ def generate_permutations(fields, index, results, current, fields_dict):
for
i
in
range
(
len
(
permutations_values
)):
# add other required default fields to dict
current
[
"organization"
]
=
"RITX"
# generate different organization number for each course
organization_number
=
"PM9003"
+
str
(
i
)
+
"x"
current
[
"number"
]
=
organization_number
# organization_number = "PM9003" + str(i) + "x"
current
[
"number"
]
=
None
# will be generated automatically by course creation script
current
[
"organization"
]
=
"RITX"
current
[
"run"
]
=
"3T2017"
current
[
"user"
]
=
"edx@example.com"
current
[
"partner"
]
=
"edx"
# add permutation fields to dict
...
...
@@ -83,11 +89,18 @@ def generate_permutations(fields, index, results, current, fields_dict):
if
index
+
1
<
len
(
all_permutations_keys
):
generate_permutations
(
fields
,
index
+
1
,
results
,
current
,
fields_dict
)
# configure enrollment seat settings
enrollment_dict
=
{}
enrollment_dict
[
"credit"
]
=
False
enrollment_dict
[
"credit_provider"
]
=
"test-credit-provider"
current
[
"enrollment"
]
=
enrollment_dict
current
[
"fields"
]
=
fields_dict
.
copy
()
results
.
append
(
current
.
copy
())
# results["courses"] = current.copy()
print
results
#
print results
wrapper_courses_dict
=
{}
wrapper_courses_dict
[
"courses"
]
=
results
...
...
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