Skip to content

Commit e8f54a2

Browse files
authored
Merge pull request #109 from learningequality/determined_by_resource
Add determined by resource constant to completion criteria.
2 parents 890e0c0 + 0443556 commit e8f54a2

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

js/CompletionCriteria.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
export default {
66
APPROX_TIME: "approx_time",
7+
DETERMINED_BY_RESOURCE: "determined_by_resource",
78
MASTERY: "mastery",
89
PAGES: "pages",
910
REFERENCE: "reference",
@@ -25,7 +26,8 @@ export const SCHEMA = {
2526
"approx_time",
2627
"pages",
2728
"mastery",
28-
"reference"
29+
"reference",
30+
"determined_by_resource"
2931
]
3032
},
3133
"mastery_criteria": { "$ref": "/schemas/mastery_criteria" }
@@ -86,7 +88,10 @@ export const SCHEMA = {
8688
{
8789
"properties": {
8890
"model": {
89-
"const": "reference"
91+
"anyOf": [
92+
{"const": "reference"},
93+
{"const": "determined_by_resource"}
94+
]
9095
},
9196
"threshold": {
9297
"type": "null"

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
"scripts": {
2828
"test": "echo \"Error: no test specified\" && exit 1"
2929
},
30-
"version": "0.1.41"
30+
"version": "0.1.42"
3131
}

le_utils/constants/completion_criteria.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
# CompletionCriteria
66

77
APPROX_TIME = "approx_time"
8+
DETERMINED_BY_RESOURCE = "determined_by_resource"
89
MASTERY = "mastery"
910
PAGES = "pages"
1011
REFERENCE = "reference"
1112
TIME = "time"
1213

1314
choices = (
1415
(APPROX_TIME, "Approx Time"),
16+
(DETERMINED_BY_RESOURCE, "Determined By Resource"),
1517
(MASTERY, "Mastery"),
1618
(PAGES, "Pages"),
1719
(REFERENCE, "Reference"),
@@ -20,6 +22,7 @@
2022

2123
COMPLETIONCRITERIALIST = [
2224
APPROX_TIME,
25+
DETERMINED_BY_RESOURCE,
2326
MASTERY,
2427
PAGES,
2528
REFERENCE,
@@ -36,7 +39,14 @@
3639
"model": {
3740
"type": "string",
3841
"$exportConstants": "completion_criteria",
39-
"enum": ["time", "approx_time", "pages", "mastery", "reference"],
42+
"enum": [
43+
"time",
44+
"approx_time",
45+
"pages",
46+
"mastery",
47+
"reference",
48+
"determined_by_resource",
49+
],
4050
},
4151
"mastery_criteria": {"$ref": "/schemas/mastery_criteria"},
4252
},
@@ -82,7 +92,12 @@
8292
},
8393
{
8494
"properties": {
85-
"model": {"const": "reference"},
95+
"model": {
96+
"anyOf": [
97+
{"const": "reference"},
98+
{"const": "determined_by_resource"},
99+
]
100+
},
86101
"threshold": {"type": "null"},
87102
},
88103
"required": [],

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
setup(
1313
name="le-utils",
1414
packages=find_packages(),
15-
version="0.1.41",
15+
version="0.1.42",
1616
description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
1717
long_description=long_description,
1818
long_description_content_type="text/markdown",

spec/schema-completion_criteria.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"approx_time",
1414
"pages",
1515
"mastery",
16-
"reference"
16+
"reference",
17+
"determined_by_resource"
1718
]
1819
},
1920
"mastery_criteria": { "$ref": "/schemas/mastery_criteria" }
@@ -74,7 +75,10 @@
7475
{
7576
"properties": {
7677
"model": {
77-
"const": "reference"
78+
"anyOf": [
79+
{"const": "reference"},
80+
{"const": "determined_by_resource"}
81+
]
7882
},
7983
"threshold": {
8084
"type": "null"

0 commit comments

Comments
 (0)