@instructure/quiz-interactions
Version:
A React UI component Library for quiz interaction types.
66 lines • 1.59 kB
JavaScript
export default {
propValues: {
errors: [{}, {
itemBody: ['You must have an item body'],
interactionData: {
distractors: {
uuid3: {
itemBody: ['Text field cannot be blank']
}
}
}
}],
hasValues: [false, true],
overrideEditableForRegrading: [true, false]
},
getComponentProps: function getComponentProps(props) {
return {
itemBody: 'Categorization Example',
interactionData: {
categoryOrder: ['uuid1', 'uuid2'],
categories: {
uuid1: {
id: 'uuid1',
itemBody: 'Planet'
},
uuid2: {
id: 'uuid2',
itemBody: 'Moon'
}
},
distractors: props.hasValues ? {
uuid3: {
id: 'uuid3',
itemBody: 'Mars'
},
uuid4: {
id: 'uuid4',
itemBody: 'Europa'
},
uuid9: {
id: 'uuid5',
itemBody: 'America'
}
} : {}
},
scoringData: {
value: [{
id: 'uuid1',
scoringAlgorithm: 'AllOrNothing',
scoringData: {
value: props.hasValues ? ['uuid3'] : []
}
}, {
id: 'uuid2',
scoringAlgorithm: 'AllOrNothing',
scoringData: {
value: props.hasValues ? ['uuid4'] : []
}
}]
},
errorsAreShowing: props.errors.itemBody !== null,
changeItemState: Function.prototype,
openImportModal: Function.prototype
};
}
};