How to create a Programs in discovery?

I have enabled discovery module, I am using Ulmo. I am trying to make the Program feature work, but I am either not using discovery properly or I encountered a bug.

I have followed GitHub - overhangio/tutor-discovery: Course Discovery plugin for Tutor · GitHub instructions and created a user and have run:

tutor local run discovery ./manage.py refresh_course_metadata --partner_code=openedx
tutor local run discovery ./manage.py update_index --disable-change-limit

In https://discovery.openedx.mywebsite.com/admin/course_metadata/course/ I have my courses being displayed. 8 of them.

Questions:

  1. Are we supposed to add Programs through Django admin ?
  2. Why do I have no courses in the courses list, when I want to add a Program ?

https://discovery.mywebsite.com/admin/course_metadata/program/add/

I also have bunch of suspicious select2 errors:

I have confirmed https://discovery.mywebsite.com/static/admin/js/vendor/select2/select2.full.min.js exist.

I have read Introduction — edX Discovery Service 0.1 documentation

  1. I am honestly confused about the discovery module, what it does and provide concretely in term of UI.

  2. Introduction — edX Discovery Service 0.1 documentation say “Other program-related features such as calculating completion and awarding credentials are the responsibilities of separate systems.”, well, what are those separate systems ? Do I have to make them myself or do they exist as plugins? If yes, what are the plugins names and repo?

Unfortunately, this is a known bug in course-discovery(Link) in ulmo. Its fix PR was merged but later reverted as it didn’t work.
Meanwhile you can use discovery shell to add courses to the program, I am attaching an example shell script to add distinct courses to the program.

tutor local run discovery ./manage.py shell -c "
from course_discovery.apps.course_metadata.models import Program, Course
p=Program.objects.get(id=1)
qs=Course.objects.filter(
  partner=p.partner,
  draft=False,
  course_runs__status='published',
  course_runs__draft=False,
  course_runs__hidden=False,
).distinct()
p.courses.set(qs)
print('Attached:', p.courses.count())
"
1 Like