kolibri-constants
Version:
A package that exposes constants commonly used across the Kolibri Ecosystem
124 lines (121 loc) • 3.16 kB
JavaScript
// -*- coding: utf-8 -*-
// Generated by scripts/generate_from_specs.py
// MasteryCriteria
export default {
DO_ALL: "do_all",
M_OF_N: "m_of_n",
NUM_CORRECT_IN_A_ROW_10: "num_correct_in_a_row_10",
NUM_CORRECT_IN_A_ROW_2: "num_correct_in_a_row_2",
NUM_CORRECT_IN_A_ROW_3: "num_correct_in_a_row_3",
NUM_CORRECT_IN_A_ROW_5: "num_correct_in_a_row_5",
PRE_POST_TEST: "pre_post_test",
};
export const SCHEMA = {
"$id": "/schemas/mastery_criteria",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Schema for mastery criteria of exercise content types",
"additionalProperties": false,
"required": ["mastery_model"],
"definitions": {
"mastery_model": {
"type": "string",
"$exportConstants": "mastery_criteria",
"enum": [
"do_all",
"m_of_n",
"num_correct_in_a_row_2",
"num_correct_in_a_row_3",
"num_correct_in_a_row_5",
"num_correct_in_a_row_10",
"pre_post_test"
]
},
"pre_post_test": {
"type": "object",
"description": "Definition for pre/post test",
"additionalProperties": false,
"properties": {
"assessment_item_ids": {
"type": "array",
"minItems": 2,
"items": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"description": "List of assessment item UUIDs for version A and B of the pre/post test"
},
"version_a_item_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"description": "List of assessment item UUIDs for version A of the pre/post test"
},
"version_b_item_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"description": "List of assessment item UUIDs for version B of the pre/post test"
}
},
"required": [
"assessment_item_ids",
"version_a_item_ids",
"version_b_item_ids"
]
}
},
"properties": {
"m": true,
"n": true,
"mastery_model": {
"$ref": "#/definitions/mastery_model"
},
"pre_post_test": {
"$ref": "#/definitions/pre_post_test"
}
},
"anyOf": [
{
"properties": {
"mastery_model": {
"const": "m_of_n"
}
},
"required": ["m", "n"]
},
{
"properties": {
"mastery_model": {
"enum": [
"do_all",
"num_correct_in_a_row_2",
"num_correct_in_a_row_3",
"num_correct_in_a_row_5",
"num_correct_in_a_row_10"
]
},
"m": {
"type": "null"
},
"n": {
"type": "null"
}
}
},
{
"properties": {
"mastery_model": {
"const": "pre_post_test"
}
},
"required": ["pre_post_test"]
}
]
};