Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a JSONField to the CCX model for storing custom metadata #35593

Open
JuanDavidBuitrago opened this issue Oct 4, 2024 · 3 comments
Open

Comments

@JuanDavidBuitrago
Copy link
Contributor

JuanDavidBuitrago commented Oct 4, 2024

Description

The current CCX CustomCourseForEdX model in Open edX does not include a flexible field that allows users to store custom metadata or other types of additional information. This limitation can create challenges for developers and institutions that want to extend the functionality of CCX courses by associating them with external systems or by storing custom configurations and data.

Problem

Many use cases require the ability to associate CCX courses with external systems or tools, store analytics tracking information, or save custom attributes relevant to a specific course. However, there is currently no dedicated field in the CCX model that supports this type of dynamic data storage.

In my use case, every time a new CCX course is created from a master course, I need to associate it with a new class in the external platform. Without a dedicated field in the CCX model, it becomes difficult to store and manage this association.

Additionally, I have explored potential solutions such as using extensions or custom attributes, but those either affect the model or create challenges for maintainability during future updates.

Proposed Solution

I propose adding a JSONField to the CCX model that would allow users to store custom data in a flexible and scalable way. This field could be used not only to store external platform IDs (like in my case) but also to store any kind of metadata that other developers might need for their own integrations or customizations.

Advantages

  • Flexibility: A JSONField would enable developers to store structured data, such as strings, arrays, or dictionaries, for any number of purposes.

  • Scalability: This field can grow to accommodate various use cases without requiring future modifications to the model or database structure.

  • General Utility: Other institutions and developers could use this field to store custom metadata, such as external course identifiers, tracking metrics, or any other platform-specific configurations.

  • Enhanced Customization: Institutions could store any additional course-specific data, such as settings, preferences, or metadata that are essential for their specific context.

Example Use Cases:

  • External Platform Integration: External identifiers for linking to third-party systems.
  • Tracking Analytics: Save custom analytics tracking IDs for deeper integration with external reporting tools.
  • Metadata Storage: Allow institutions to store region-specific data, access control settings, or other custom attributes tied to each CCX.

I believe this feature would not only address my specific use case but would also provide value to a broader audience by enabling more flexible course customizations and integrations.

@JuanDavidBuitrago
Copy link
Contributor Author

Hi @pdpinch, @mariajgrimaldi and @felipemontoya

Could you maybe help me with this?
I would really appreciate it.

@scottrish
Copy link

Thanks @JuanDavidBuitrago . Do you have a suggestion on how to namespace attributes? If we have two external providers that use, for example ClassroomCode, how should the two values be stored to avoid clashes?

@JuanDavidBuitrago
Copy link
Contributor Author

Thanks @JuanDavidBuitrago . Do you have a suggestion on how to namespace attributes? If we have two external providers that use, for example ClassroomCode, how should the two values be stored to avoid clashes?

Hi @scottrish

As the proposal is to add a new JSONField, an assignment to the variable could be made with the following arrangement:

{
   "classroom_code": {
      "provider_1": "Classroom code for provider 1",
      "provider_2": "Classroom code for provider 2"
   }
}

Also, if the need arose to store some other value, not necessarily a ClassroomCode, we could add it to the current list

{
   "custom_id": "My custom id to the ccx course"
}

And in the end get the complete array

{
   "classroom_code": {
      "provider_1": "Classroom code for provider 1",
      "provider_2": "Classroom code for provider 2"
   },
   "custom_id": "My custom id to the ccx course"
}

I hope that answers your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants