Skip to content

Commit

Permalink
Merge pull request #109 from learningequality/determined_by_resource
Browse files Browse the repository at this point in the history
Add determined by resource constant to completion criteria.
  • Loading branch information
rtibbles authored Oct 24, 2022
2 parents 890e0c0 + 0443556 commit e8f54a2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
9 changes: 7 additions & 2 deletions js/CompletionCriteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export default {
APPROX_TIME: "approx_time",
DETERMINED_BY_RESOURCE: "determined_by_resource",
MASTERY: "mastery",
PAGES: "pages",
REFERENCE: "reference",
Expand All @@ -25,7 +26,8 @@ export const SCHEMA = {
"approx_time",
"pages",
"mastery",
"reference"
"reference",
"determined_by_resource"
]
},
"mastery_criteria": { "$ref": "/schemas/mastery_criteria" }
Expand Down Expand Up @@ -86,7 +88,10 @@ export const SCHEMA = {
{
"properties": {
"model": {
"const": "reference"
"anyOf": [
{"const": "reference"},
{"const": "determined_by_resource"}
]
},
"threshold": {
"type": "null"
Expand Down
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.41"
"version": "0.1.42"
}
19 changes: 17 additions & 2 deletions le_utils/constants/completion_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
# CompletionCriteria

APPROX_TIME = "approx_time"
DETERMINED_BY_RESOURCE = "determined_by_resource"
MASTERY = "mastery"
PAGES = "pages"
REFERENCE = "reference"
TIME = "time"

choices = (
(APPROX_TIME, "Approx Time"),
(DETERMINED_BY_RESOURCE, "Determined By Resource"),
(MASTERY, "Mastery"),
(PAGES, "Pages"),
(REFERENCE, "Reference"),
Expand All @@ -20,6 +22,7 @@

COMPLETIONCRITERIALIST = [
APPROX_TIME,
DETERMINED_BY_RESOURCE,
MASTERY,
PAGES,
REFERENCE,
Expand All @@ -36,7 +39,14 @@
"model": {
"type": "string",
"$exportConstants": "completion_criteria",
"enum": ["time", "approx_time", "pages", "mastery", "reference"],
"enum": [
"time",
"approx_time",
"pages",
"mastery",
"reference",
"determined_by_resource",
],
},
"mastery_criteria": {"$ref": "/schemas/mastery_criteria"},
},
Expand Down Expand Up @@ -82,7 +92,12 @@
},
{
"properties": {
"model": {"const": "reference"},
"model": {
"anyOf": [
{"const": "reference"},
{"const": "determined_by_resource"},
]
},
"threshold": {"type": "null"},
},
"required": [],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setup(
name="le-utils",
packages=find_packages(),
version="0.1.41",
version="0.1.42",
description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
8 changes: 6 additions & 2 deletions spec/schema-completion_criteria.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"approx_time",
"pages",
"mastery",
"reference"
"reference",
"determined_by_resource"
]
},
"mastery_criteria": { "$ref": "/schemas/mastery_criteria" }
Expand Down Expand Up @@ -74,7 +75,10 @@
{
"properties": {
"model": {
"const": "reference"
"anyOf": [
{"const": "reference"},
{"const": "determined_by_resource"}
]
},
"threshold": {
"type": "null"
Expand Down

0 comments on commit e8f54a2

Please sign in to comment.