gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
180 stars 134 forks source link

Create Schemas (json/php) to describe course elements, modules, etc #603

Open actual-saurabh opened 6 years ago

actual-saurabh commented 6 years ago

The schema files will contain a data architecture for settings and content elements (#522) . This will be used to describe content architecture as well as a configuration for installation and registration.

The schema will contain meta information (like rest api support, Human readable Labels for keys, etc).

The schema is also an abstraction of the data models for courses, lessons, quizzes, etc and can be used along with traits and interfaces to model each element (#597)

This schema will be used to create flexible and extensible forms & interfaces and during data fetches/loads (#575, #567).

The schema can also be used to build an extremely flexible Merge Code API (#564, #560) for personalising every course element.

thomasplevy commented 6 years ago

@actual-saurabh please see work started on a REST api on this on the rest branch

actual-saurabh commented 6 years ago

Schema files can help in identifying options and metadata as strings and generate a translation config xml (on build) as per https://wpml.org/documentation/support/language-configuration-files/.

Apart from adding support for WPML (#456), this will also automatically add support for Polylang: https://polylang.pro/doc/the-wpml-config-xml-file/.

So, the two most popular multilingual plugins will get automatically supported.

actual-saurabh commented 6 years ago

I see the work done in the REST API branch but there have been developments that can make this easier to implement

Also see: https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/, https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/ & https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/

actual-saurabh commented 6 years ago

So, a LifterLMS level schema can contain enough information to do the following

On execution:

  1. Registering metadata at the post type endpoints.
  2. Generating form fields using the existing (refactored) fields API.
  3. Registering builtin merge codes.

On build

  1. Generating REST API schema.
  2. Generating WPML Schema.
actual-saurabh commented 6 years ago

Also describe Personas, Roles and other capability collections (for builtin Segments, Post Types, Comment Types, etc) Related: #420 #604 #610 #611