Skip to content

[C2.1] Plugin: BuyCourse: Manage service relation with courses #8366

@NicoDucou

Description

@NicoDucou

In the Buy course plugin you can configure services that give new benefits such as a new maximum number of course, a new hosting limit per course or a document quota.
First we have to change the setting "Maximum courses" in the granted benefits, to name it number of course with these benefits.
To know for which course the user wants those benefits to apply the process will be as follow :

  • In the administration of the buy course plugin on the service creation and edition page add a setting "Display service on course creation page" that can be true or false
  • On the course creation page, if the buy course plugin is available and at least 1 service has the setting "Display service on course creation page" with the value true then show a selector to define the type of course to create with a first bloc for standard course indicating the global setting of the platform for maximum number of course, document quota and maximum student per course and then 1 bloc per service in the buy course plugin that have the setting "Display service on course creation page" on true and for those a link to go to buy this service. The service option is in grey and can not be selected if the user have already used its number of courses available. That is to say that the user have already created the maximum number of courses with those benefits.
  • When selecting a service then the settings of the course created are adapted to the value of the service selected and in the buy course plugin we create a registry in a new table service_rel_course_rel_user to know that a course is related to this specific service for this user. This allow to know the number of course the user has with this benefits.
  • On the course creation page the logic to know if a user can still create a course is a bit different. We always show the page but we put in grey the services if they are already reached and we block the course creation if the platform limit is reach and no service is available.

Extra
Add a command in Chamilo that checks if a service is finished (That means the duration of the service is over and the user has not payed for a new period). If so, for all the course associated with this service for this user set the accessibility setting of those course to closed. If the service is over since more than a month and the course is closed then set all the course accessibility setting to hidden.

Metadata

Metadata

No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions