/tailor

Course authoring platform

Primary LanguageVueMIT LicenseMIT

Tailor

GitHub package version Codacy Badge Known Vulnerabilities GitHub license js semistandard style Open Source Love

Adaptive course authoring platform.

📘 Dependencies

  • Node.js (>= 8.8.0)
  • npm (>= 5.4.2)
  • PostgreSQL (>= 9.6)

☕ Installation

Prerequisites

Setup

  • Run npm install in the repo directory
  • Create database in PostgreSQL
  • App is configured via environment variables contained in a file named .env. Use the .env.example file as a template: cp .env.example .env and enter configuration details.
  • You can init the db (for development) by setting ENABLE_DEFAULT_SCHEMA=1 and running npm run db:seed.
  • You can create admin user by running npm run add:admin <email> <password>
  • App branding is configured via values set in a file named .brand-rc.json. Use the .brand-rc.json.example file as a template: cp .brand-rc.json.example .brand-rc.json and enter configuration details.

🚀 Launch

Development

  • Server: npm run dev:server
  • Client (webpack dev server): npm run dev:client

Production

  • Bundle client by issuing npm run build
  • npm run start

📚 Content repository structure

Repository stucture can be altered through .activities-rc.json file. Use the .activities-rc.json.example file as a template: cp .activities-rc.json.example .activities-rc.json and enter configuration details. It's also possible to use .activities-rc.js, by using module.exports to export the structure. By default, the file is searched for in the root of the project. If a custom location or a custom name is needed, it can be provided through the activitiesConfig param to any of the build scripts (without the extension), for example: npm run dev:client -- --activitiesConfig=server/.custom-activities-rc

Content repository structures are defined using following properties:

SCHEMAS

An array of Schema objects.

Schema

  • id String - Schema identifier.
  • name String - Schema display name.
  • meta Array<Metadata> - An array of objects defining repository metadata.
  • structure Array<ActivityConfig> - An array of objects which define schema structure.
  • contentContainers Array<ContentContainer> - Array of content container configs

ActivityConfig - Schema structure elements

Configuration for schema structure nodes (activities). Contains the following properties:

  • level Number - The hierarchy level for that particular activity type.
  • type String - Const for marking activity type.
  • subLevels Array<String> - An array of sub-types.
  • label String - Display label.
  • color String - Display color in hexadecimal notation.
  • contentContainers Array<String> - Array of content container types that define which content containers can be added.
  • hasAssessments Boolean - Activity allows adding assessments activities to it.
  • hasExams Boolean - Activity allows adding exam activities to it.
  • exams Object - Configuration for activity exams.
  • relationships Array<Relationship> - Defines what relationships this activity has to other activities.
  • meta Array<Metadata> - An array of objects defining activity metadata.

Relationship

Defines the structure of an activity realtionship field.

  • type String - Defines the name of the relationship. The relationship will be published under this value.
  • label String - Display label.
  • placeholder String - Display label for select picker.
  • multiple Boolean - Defines if the relationship can have multiple associations chosen. True by default.
  • searchable Boolean - Defines if the list of activities can be searched. True by default.
  • allowEmpty Boolean - Defines if the member list can be empty. True by default.
  • allowCircularLinks Boolean - Defines if member of a relationship instance can set the owner of that instance as a member of its own instance of that relationship. Example, activity X sets activity Y as its prerequisite. If allowCircualLinks is set to true then activity Y can set activity X as its prerequisite. False by default.
  • allowInsideLineage Boolean - Defines if an ancestor or a descendant can be a member of the relationship. False by default.

Metadata

Defines the structure of an activity metadata field.

  • key String - Unique key for the field.
  • type String - Type of the input component used on the client.
  • label String - Display label.
  • placeholder String - Input component placeholder.
  • validate MetadataValidator - Validator object.
  • defaultValue * - Default field value.

MetadataValidator

Defines validation rules on an activity metadata field.

  • rules Object - Contains the following properties:
    • max Number - Maximum character count.
    • required Boolean - Defines if the field is required.

CONTENT_CONTAINERS

An array of ContentContainer objects.

ContentContainer

Configuration for content containers. Contains the following properties:

  • type String - Const for marking container type.
  • label String - Content container label.
  • multiple Boolean - Defines if there can be multiple instances of the ContentContainer inside one activity. False by default.
  • types Array<String> - An array of possible teaching element types that can exist inside ContentContainer. If not specified all types of elements are allowed.
  • displayHeading Boolean - Defines if a heading is displayed on top of the ContentContainer. False by default.
  • layout Boolean - Defines if elements inside container can be placed two in a row. True by default.

PREVIEW_URL

A string template that will be interpolated on the client using two route params, repositoryId and activityId, into a preview URL for each activiy. Example: https://my.url.com/#/repository/{repositoryId}/activity/{activityId}/preview