tutor icon indicating copy to clipboard operation
tutor copied to clipboard

Allow importing of custom demo courses

Open frob opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

The provided demo course is a good representation of core edx functionality but what about when working with a customized installation. Often we will want to test custom or contributed xblocks which are not a part of the core product.

Describe the solution you'd like

It would nice to add an option to the importdemocourse command to allow for a custom demo course to be imported.

Describe alternatives you've considered

All other processes for this would be manual. Either manually creating a demo course or importing a demo course through the UI.

Additional context

I was thinking of something like this:

tutor dev importdemocourse --path_to_course ./tests/democourse

Looks like this is mostly just a built in script that does most the work. https://github.com/overhangio/tutor/blob/master/tutor/templates/hooks/cms/importdemocourse

echo "Loading settings $DJANGO_SETTINGS_MODULE"

# Import demo course
git clone https://github.com/openedx/edx-demo-course --branch {{ OPENEDX_COMMON_VERSION }} --depth 1 ../edx-demo-course
python ./manage.py cms import ../data ../edx-demo-course

# Re-index courses
./manage.py cms reindex_course --all --setup

I think this means we could we could override that template with a custom plugin but I think it would be far more useful to make this a part/feature of tutor so that it doesn't need to be hard coded.

frob avatar Oct 05 '22 19:10 frob

Right. I see how custom courses would be a useful addition to the importdemocourse command. Currently, the corresponding import script cannot be templated with variables other than those coming from the Tutor configuration, so we will have to change that. It's certainly not impossible.

regisb avatar Oct 06 '22 06:10 regisb

Is there another script that uses arguments? I can take a first pass if there is an example job runner that has an argument.

frob avatar Oct 17 '22 18:10 frob

Yes, the settheme command for instance.

Note that this issue is somehow related to this one: https://github.com/overhangio/2u-tutor-adoption/issues/75

regisb avatar Oct 18 '22 13:10 regisb

This feature should be even easier now that pluggable "do" tasks are part of Tutor.

regisb avatar Jan 05 '23 16:01 regisb