From 7e5d3fa52ef52ecb7d8f95dbf896293d48c95352 Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 4 Apr 2014 10:12:55 +0100 Subject: [PATCH 1/5] JSON schema --- bower.json | 5 ++- properties.schema | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 properties.schema diff --git a/bower.json b/bower.json index b8af805..818c447 100644 --- a/bower.json +++ b/bower.json @@ -4,9 +4,12 @@ "homepage": "https://github.com/adaptlearning/adapt-contrib-slider", "authors": [ "Daryl Hedley " + "Dan Gray " ], - "description": "A question component that allows the learner to position a slider on scale", + "description": "A question component that allows the learner to position a slider on a scale", "main": "/js/adapt-contrib-slider.js", + "displayName" : "Slider", + "component" : "slider", "keywords": [ "adapt-plugin", "adapt-component" diff --git a/properties.schema b/properties.schema new file mode 100644 index 0000000..2ad87fe --- /dev/null +++ b/properties.schema @@ -0,0 +1,93 @@ +{ + "type":"object", + "$schema": "http://json-schema.org/draft-04/schema", + "id": "http://jsonschema.net", + "$ref": "http://localhost/plugins/content/component/model.schema", + "properties":{ + "_attempts": { + "type":"number" + }, + "_correctAnswer": { + "type":"string" + }, + "_correctRange": { + "type":"object", + "properties":{ + "bottom": { + "type":"number" + }, + "top": { + "type":"number" + } + } + }, + "_questionWeight": { + "type":"number" + }, + "_scaleEnd": { + "type":"number", + "required":true + }, + "_scaleStart": { + "type":"number", + "required":true + }, + "_showNumber": { + "type":"boolean", + "required":true + }, + "_showScaleIndicator": { + "type":"boolean", + "required":true + }, + "button": { + "type":"object", + "required":true, + "properties":{ + "model": { + "type":"string", + "required":true, + "default" : "Model Answer" + }, + "reset": { + "type":"string", + "default" : "Reset" + }, + "submit": { + "type":"string", + "required":true, + "default" : "Submit" + }, + "user": { + "type":"string", + "required":true, + "default" : "My Answer" + } + } + }, + "feedback": { + "type":"object", + "required":true, + "properties":{ + "correct": { + "type":"string", + "required":true + }, + "incorrect": { + "type":"string", + "required":true + }, + "partly": { + "type":"string", + "required":true + } + } + }, + "labelEnd": { + "type":"string" + }, + "labelStart": { + "type":"string" + } + } +} From af756ffb77bb4abd9e6eb92d470c730d0b9d4cc5 Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 4 Apr 2014 10:33:55 +0100 Subject: [PATCH 2/5] Change karma version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b9af67..b63dff8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "https://github.com/adaptlearning/adapt-contrib-slider/issues" }, "devDependencies": { - "karma": "~0.9", + "karma": "~0.10", "karma-mocha": "*", "karma-expect": "*" } From b362b07fa6c25f2e0100f53ca8f083b8a67ef911 Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 4 Apr 2014 12:17:35 +0100 Subject: [PATCH 3/5] Increment version number --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 818c447..764f803 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-slider", - "version": "0.0.1", + "version": "0.0.2", "homepage": "https://github.com/adaptlearning/adapt-contrib-slider", "authors": [ "Daryl Hedley " diff --git a/package.json b/package.json index b63dff8..602f077 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-slider", - "version": "0.0.1", + "version": "0.0.2", "description": "A question component that allows the learner to position a slider on scale", "main": "", "scripts": { From 7861207a80f05c5b02b26de48a750014289ea110 Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 4 Apr 2014 13:02:56 +0100 Subject: [PATCH 4/5] Missing comma --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 764f803..856bb93 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "version": "0.0.2", "homepage": "https://github.com/adaptlearning/adapt-contrib-slider", "authors": [ - "Daryl Hedley " + "Daryl Hedley ", "Dan Gray " ], "description": "A question component that allows the learner to position a slider on a scale", From dd23c067b606e7040cdf0416b35a65c528c1192a Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 4 Apr 2014 15:21:10 +0100 Subject: [PATCH 5/5] Added requirement for _correctRange values --- properties.schema | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/properties.schema b/properties.schema index 2ad87fe..7a7aaca 100644 --- a/properties.schema +++ b/properties.schema @@ -5,24 +5,29 @@ "$ref": "http://localhost/plugins/content/component/model.schema", "properties":{ "_attempts": { - "type":"number" + "type":"number", + "required":true, + "default":1 }, "_correctAnswer": { - "type":"string" + "type":"number" }, "_correctRange": { "type":"object", "properties":{ "bottom": { - "type":"number" + "type":"number", + "required":true }, "top": { - "type":"number" + "type":"number", + "required":true } } }, "_questionWeight": { - "type":"number" + "type":"number", + "required":false }, "_scaleEnd": { "type":"number",