case-editor-tools 1.0.0-beta.20 → 1.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "case-editor-tools",
|
|
3
3
|
"description": "Javascript tools to simplify survey and study coding for CASE.",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.21",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg,
|
|
1
|
+
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseComponent } from "survey-engine/data_types";
|
|
2
2
|
import { ClozeQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps } from "./types/item-properties";
|
|
3
3
|
import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
|
|
4
4
|
interface OptionQuestionProps extends GenericQuestionProps {
|
|
@@ -20,7 +20,7 @@ interface NumericSliderProps extends GenericQuestionProps {
|
|
|
20
20
|
max?: number | ExpressionArg;
|
|
21
21
|
stepSize?: number | ExpressionArg;
|
|
22
22
|
}
|
|
23
|
-
interface CustomResponseItem extends
|
|
23
|
+
interface CustomResponseItem extends ResponseComponent {
|
|
24
24
|
mapToRole?: 'singleChoiceGroup' | 'multipleChoiceGroup' | 'input';
|
|
25
25
|
}
|
|
26
26
|
interface CustomQuestionProps extends GenericQuestionProps {
|
package/surveys/survey-items.js
CHANGED
|
@@ -199,8 +199,8 @@ const generateClozeQuestion = (props) => {
|
|
|
199
199
|
return commonQuestionGenerator(props, rg_inner);
|
|
200
200
|
};
|
|
201
201
|
const generateCustomQuestion = (props) => {
|
|
202
|
-
const
|
|
203
|
-
const role = `${props.responseItemDef}
|
|
202
|
+
const rolePrefix = props.responseItemDef.mapToRole !== undefined ? `${props.responseItemDef.mapToRole}` : '';
|
|
203
|
+
const role = `${rolePrefix}:${props.responseItemDef.role}`;
|
|
204
204
|
const rg_inner = Object.assign(Object.assign({}, props.responseItemDef), { role: role });
|
|
205
205
|
return commonQuestionGenerator(props, rg_inner);
|
|
206
206
|
};
|