-
Notifications
You must be signed in to change notification settings - Fork 32
/
mastery_criteria.py
76 lines (71 loc) · 2.18 KB
/
mastery_criteria.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- coding: utf-8 -*-
# Generated by scripts/generate_from_specs.py
from __future__ import unicode_literals
# MasteryCriteria
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"
choices = (
(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"),
)
MASTERYCRITERIALIST = [
DO_ALL,
M_OF_N,
NUM_CORRECT_IN_A_ROW_10,
NUM_CORRECT_IN_A_ROW_2,
NUM_CORRECT_IN_A_ROW_3,
NUM_CORRECT_IN_A_ROW_5,
]
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",
],
}
},
"properties": {
"m": True,
"n": True,
"mastery_model": {"$ref": "#/definitions/mastery_model"},
},
"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"},
}
},
],
}