Skip to content

Instantly share code, notes, and snippets.

@jkachel
Created June 22, 2023 19:43
Show Gist options
  • Save jkachel/90276ec79dabb0a892920d3eb3bd7116 to your computer and use it in GitHub Desktop.
Save jkachel/90276ec79dabb0a892920d3eb3bd7116 to your computer and use it in GitHub Desktop.
Setup for MITx Online financial aid testing scenarios with ProgramRequirements
#!/bin/bash
# This is organized into blocks
# You may only want to run some blocks, or stop in the middle of the process to check things
# In that case, just cut and paste the blocks you need to run
# But get this alias here too, or search and replace xonmanage appropriately
alias xonmanage="docker compose exec web ./manage.py"
# After running, you will need to make some CMS changes:
# - The FA forms will need to be published so their fields show up. (You should probably also adjust text in them to make it clear which program they belong to.)
# - The courses will need to have Price information added (i.e., the link to the appropriate FA form).
# Creates a normal, unassociated program with two course runs (one req, one elective) and FA form/tiers
xonmanage create_courseware program program-E2E:NPRx "E2E Non-Related Program" --live
xonmanage configure_tiers --program program-E2E:NPRx --program-name "E2E Non-Related Program" --program-abbrev NPRx
xonmanage create_courseware_page program-E2E:NPRx --live
xonmanage create_finaid_form program-E2E:NPRx
xonmanage create_courseware course course-E2E:NPRx-TestCourse1 "NPR Test Course" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:NPRx --required
xonmanage create_courseware_page course-E2E:NPRx-TestCourse1 --live
xonmanage create_product_for_program_courses --active --program program-E2E:NPRx --price 999
xonmanage create_courseware course course-E2E:NPRx-TestCourse2 "NPR Test Course Secondary" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:NPRx --elective
xonmanage create_courseware_page course-E2E:NPRx-TestCourse2 --live
xonmanage create_product_for_program_courses --active --program program-E2E:NPRx --price 999
# Creates two programs, each with FA setup and two courseruns (one req, one elective) and then adds in a relation between the two
# The courses don't overlap here
xonmanage create_courseware program program-E2E:PR1x "E2E Related Program 1" --live
xonmanage configure_tiers --program program-E2E:PR1x --program-name "E2E Related Program 1" --program-abbrev PR1x
xonmanage create_courseware_page program-E2E:PR1x --live
xonmanage create_finaid_form program-E2E:PR1x
xonmanage create_courseware course course-E2E:PR1x-TestCourse1 "RelatedProgram Test Course" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:PR1x --required
xonmanage create_courseware_page course-E2E:PR1x-TestCourse1 --live
xonmanage create_product_for_program_courses --active --program program-E2E:PR1x --price 999
xonmanage create_courseware course course-E2E:PR1x-TestCourse2 "RelatedProgram Test Course 2" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:PR1x --elective
xonmanage create_courseware_page course-E2E:PR1x-TestCourse2 --live
xonmanage create_product_for_program_courses --active --program program-E2E:PR1x --price 999
xonmanage create_courseware program program-E2E:OPR2x "E2E Other Related Program 2" --live --related program-E2E:PR1x
xonmanage configure_tiers --program program-E2E:OPR2x --program-name "E2E Other Related Program 2" --program-abbrev OPR2x
xonmanage create_courseware_page program-E2E:OPR2x --live
xonmanage create_courseware course course-E2E:OPR2x-TestCourse1 "Other Related Program Test Course" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OPR2x --required
xonmanage create_courseware_page course-E2E:OPR2x-TestCourse1 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OPR2x --price 999
xonmanage create_courseware course course-E2E:OPR2x-TestCourse2 "Other Related Program Test Course 2" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OPR2x --elective
xonmanage create_courseware_page course-E2E:OPR2x-TestCourse2 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OPR2x --price 999
# Same as above, except the courses should overlap
# You will have to do this manually - the create_courseware command doesn't know how to (yet).
xonmanage create_courseware program program-E2E:OLPR1x "E2E Overlapping Related Program 1" --live
xonmanage configure_tiers --program program-E2E:OLPR1x --program-name "E2E Overlapping Related Program 1" --program-abbrev OLPR1x
xonmanage create_courseware_page program-E2E:OLPR1x --live
xonmanage create_finaid_form program-E2E:OLPR1x
xonmanage create_courseware course course-E2E:OLPR1x-TestCourse1 "Overlapping Related Program Test Course" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OLPR1x --required
xonmanage create_courseware_page course-E2E:OLPR1x-TestCourse1 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OLPR1x --price 999
xonmanage create_courseware course course-E2E:OLPR1x-TestCourse2 "Overlapping Related Program Test Course 2" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OLPR1x --elective
xonmanage create_courseware_page course-E2E:OLPR1x-TestCourse2 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OLPR1x --price 999
xonmanage create_courseware program program-E2E:OLPR2x "E2E Overlapping Related Program 2" --live --related program-E2E:OLPR1x
xonmanage configure_tiers --program program-E2E:OLPR2x --program-name "E2E Overlapping Related Program 2" --program-abbrev OLPR2x
xonmanage create_courseware_page program-E2E:OLPR2x --live
xonmanage create_courseware course course-E2E:OLPR2x-TestCourse1 "Overlapping Related Program 2 Test Course" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OLPR2x --required
xonmanage create_courseware_page course-E2E:OLPR2x-TestCourse1 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OLPR2x --price 999
xonmanage create_courseware course course-E2E:OLPR2x-TestCourse2 "Overlapping Related Program 2 Test Course 2" --live --create-run 3T2022 --start 2023-06-01 --end 2023-09-01 --enrollment-start 2023-05-01 --enrollment-end 2023-08-01 --program program-E2E:OLPR2x --elective
xonmanage create_courseware_page course-E2E:OLPR2x-TestCourse2 --live
xonmanage create_product_for_program_courses --active --program program-E2E:OLPR2x --price 999
xonmanage create_finaid_form program-E2E:OLPR1x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment