Enabling Custom Course Settings

Hi all,
I’ve found this interesting feature: Enabling Custom Course Settings.
This adds an “Other course settings” field in the course’s advance configuration.


Does anybody know where is this data stored? How can it be used in another application?

There’s a brief description included in the PR that brought that feature into the platform:

This adds a field to the “advanced settings” page of each course that allows the user to store additional metadata about the course, in a JSON dictionary, without requiring updating the platform code.

The idea is that this field can hold metadata like “ID of the course in external system”, course difficulty, or other instance-specific metadata about the course that needs to be available to the theme, CRM software, a marketing site, ecommerce, or other external systems.

The new field is protected by a feature flag which is False by default, so it won’t show up in Studio unless you enable the flag.

Hi Dave!
Thanks for your response!
I’ve seen that also in the docs… however I don’t know how to retrieve that information if I want to use it. Do you know where is it stored, and how to query it?

Hello everyone,

I’m using Tutor 13.2.2 e Open edX maple.3 and enable the feature ENABLE_OTHER_COURSE_SETTINGS in CMS. The idea is to have an integration using the REST API, but I couldn’t find an endpoint to get this information.

I’ve tried all GET endpoints with a course_id as path param.

Ref.: Add Course Metadata

1 Like

They should be available as a field for the root CourseBlock of a course in the Course Blocks API

Edit: And probably also as part of the OLX export?

I got it!

  1. Getting access token: the path in the doc is wrong, the right is /oauth2/access_token, without v1 or v2.

    curl --location --request POST 'https://${LMS_HOST}/oauth2/access_token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=client_credentials' \
    --data-urlencode 'client_id=${CLIENT_ID}' \
    --data-urlencode 'client_secret=${CLIENT_SECRET}'
    
    {
        "access_token": "xxx-very-secret-access-token-xxx",
        "expires_in": 36000,
        "token_type": "Bearer",
        "scope": "read write email profile"
    }
    
  2. Enable feature ENABLE_OTHER_COURSE_SETTINGS

  3. Enable COURSE_BLOCKS_API_EXTRA_FIELDS

  4. Getting course blocks: add query param: requested_fields=other_course_settings

    curl --location --request GET 'https://${LMS_HOST}/api/courses/v2/blocks/?course_id=course-v1%3AOrg%2BDO101%2B2022-04&username=admin&requested_fields=other_course_settings' \
    --header 'Authorization: Bearer ${ACCESS_TOKEN}'
    

Great @erickhgm!
Worked like charm! Only had to use double quotes to have the variables replaced.

I also found where is it persisted in MongoDB:
It’s in the modulestore.structures collection, in the fields dict of the course block type:

{
   "_id":"ObjectId(""nnnnnnn"")",
   "root":[
      "course",
      "course"
   ],
   ...
   "blocks":[
      {
         "fields":{
            "display_name":"Demonstration Course",
            ...,
            "other_course_settings":{
               "test_other_course_settings":"value"
            },
            "show_calculator":true,
            ...

Many thanks for your help!

1 Like