Skip to content

Commit 427a6dd

Browse files
Merge pull request #201 from learningequality/a_hex_upon_the_assessment_uuids
Update UUID representations in JSONSchemas used in the content pipeline (ricecooker -> Studio -> Kolibri) to use compact hex representations
2 parents 36555b5 + 2d1ec36 commit 427a6dd

9 files changed

Lines changed: 86 additions & 95 deletions

js/LearningObjectives.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export const SCHEMA = {
1010
"description": "Schema for Learning Objectives mapping",
1111
"additionalProperties": false,
1212
"definitions": {
13-
"uuid": {
13+
"hex-uuid": {
1414
"type": "string",
15-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
16-
"description": "A unique identifier in the form of a UUID v4 or v5"
15+
"pattern": "^[0-9a-f]{32}$",
16+
"description": "A unique identifier in the form of the compact hex representations of a UUID v4 or v5"
1717
},
1818
"learning_objective_id": {
19-
"$ref": "#/definitions/uuid",
19+
"$ref": "#/definitions/hex-uuid",
2020
"description": "Unique identifier for the Learning Objective"
2121
}
2222
},
@@ -51,7 +51,7 @@ export const SCHEMA = {
5151
"minProperties": 1,
5252
"additionalProperties": false,
5353
"patternProperties": {
54-
"^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$": {
54+
"^[0-9a-f]{32}$": {
5555
"type": "array",
5656
"items": {
5757
"$ref": "#/definitions/learning_objective_id"

js/MasteryCriteria.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const SCHEMA = {
4343
"minItems": 2,
4444
"items": {
4545
"type": "string",
46-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
46+
"pattern": "^[0-9a-f]{32}$"
4747
},
4848
"description": "List of assessment item UUIDs for version A and B of the pre/post test"
4949
},
@@ -52,7 +52,7 @@ export const SCHEMA = {
5252
"minItems": 1,
5353
"items": {
5454
"type": "string",
55-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
55+
"pattern": "^[0-9a-f]{32}$"
5656
},
5757
"description": "List of assessment item UUIDs for version A of the pre/post test"
5858
},
@@ -61,7 +61,7 @@ export const SCHEMA = {
6161
"minItems": 1,
6262
"items": {
6363
"type": "string",
64-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
64+
"pattern": "^[0-9a-f]{32}$"
6565
},
6666
"description": "List of assessment item UUIDs for version B of the pre/post test"
6767
}

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.2.13"
30+
"version": "0.2.14"
3131
}

le_utils/constants/learning_objectives.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"description": "Schema for Learning Objectives mapping",
1717
"additionalProperties": False,
1818
"definitions": {
19-
"uuid": {
19+
"hex-uuid": {
2020
"type": "string",
21-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
22-
"description": "A unique identifier in the form of a UUID v4 or v5",
21+
"pattern": "^[0-9a-f]{32}$",
22+
"description": "A unique identifier in the form of the compact hex representations of a UUID v4 or v5",
2323
},
2424
"learning_objective_id": {
25-
"$ref": "#/definitions/uuid",
25+
"$ref": "#/definitions/hex-uuid",
2626
"description": "Unique identifier for the Learning Objective",
2727
},
2828
},
@@ -55,7 +55,7 @@
5555
"minProperties": 1,
5656
"additionalProperties": False,
5757
"patternProperties": {
58-
"^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$": {
58+
"^[0-9a-f]{32}$": {
5959
"type": "array",
6060
"items": {"$ref": "#/definitions/learning_objective_id"},
6161
}

le_utils/constants/mastery_criteria.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,19 @@
6161
"assessment_item_ids": {
6262
"type": "array",
6363
"minItems": 2,
64-
"items": {
65-
"type": "string",
66-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
67-
},
64+
"items": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
6865
"description": "List of assessment item UUIDs for version A and B of the pre/post test",
6966
},
7067
"version_a_item_ids": {
7168
"type": "array",
7269
"minItems": 1,
73-
"items": {
74-
"type": "string",
75-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
76-
},
70+
"items": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
7771
"description": "List of assessment item UUIDs for version A of the pre/post test",
7872
},
7973
"version_b_item_ids": {
8074
"type": "array",
8175
"minItems": 1,
82-
"items": {
83-
"type": "string",
84-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
85-
},
76+
"items": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
8677
"description": "List of assessment item UUIDs for version B of the pre/post test",
8778
},
8879
},

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
setup(
99
name="le-utils",
1010
packages=find_packages(),
11-
version="0.2.13",
11+
version="0.2.14",
1212
description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",

spec/schema-learning_objectives.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"description": "Schema for Learning Objectives mapping",
66
"additionalProperties": false,
77
"definitions": {
8-
"uuid": {
8+
"hex-uuid": {
99
"type": "string",
10-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
11-
"description": "A unique identifier in the form of a UUID v4 or v5"
10+
"pattern": "^[0-9a-f]{32}$",
11+
"description": "A unique identifier in the form of the compact hex representations of a UUID v4 or v5"
1212
},
1313
"learning_objective_id": {
14-
"$ref": "#/definitions/uuid",
14+
"$ref": "#/definitions/hex-uuid",
1515
"description": "Unique identifier for the Learning Objective"
1616
}
1717
},
@@ -46,7 +46,7 @@
4646
"minProperties": 1,
4747
"additionalProperties": false,
4848
"patternProperties": {
49-
"^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$": {
49+
"^[0-9a-f]{32}$": {
5050
"type": "array",
5151
"items": {
5252
"$ref": "#/definitions/learning_objective_id"

spec/schema-mastery_criteria.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"minItems": 2,
3030
"items": {
3131
"type": "string",
32-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
32+
"pattern": "^[0-9a-f]{32}$"
3333
},
3434
"description": "List of assessment item UUIDs for version A and B of the pre/post test"
3535
},
@@ -38,7 +38,7 @@
3838
"minItems": 1,
3939
"items": {
4040
"type": "string",
41-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
41+
"pattern": "^[0-9a-f]{32}$"
4242
},
4343
"description": "List of assessment item UUIDs for version A of the pre/post test"
4444
},
@@ -47,7 +47,7 @@
4747
"minItems": 1,
4848
"items": {
4949
"type": "string",
50-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
50+
"pattern": "^[0-9a-f]{32}$"
5151
},
5252
"description": "List of assessment item UUIDs for version B of the pre/post test"
5353
}

0 commit comments

Comments
 (0)