feat: Group, General Feedback Settings, Randomization
This Ticket adds three new settings widgets to the Problem Editor: Randomization: This is a setting for advanced problems only which deals with python scripts. General Feedback: This is feedback which is only applied to certain problem types for mass-adding feedback to incorrect problems. Group Feedback: For certain problems, the user can provide specific feedback for a combination of specific answers.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash-es';
|
||||
|
||||
import { ShowAnswerTypes } from '../../../data/constants/problem';
|
||||
import { ShowAnswerTypes, RandomizationTypesKeys } from '../../../data/constants/problem';
|
||||
|
||||
export const popuplateItem = (parentObject, itemName, statekey, metadata) => {
|
||||
let parent = parentObject;
|
||||
@@ -57,8 +57,13 @@ export const parseSettings = (metadata) => {
|
||||
if (!_.isEmpty(showAnswer)) {
|
||||
settings = { ...settings, showAnswer };
|
||||
}
|
||||
|
||||
const randomizationType = _.get(metadata, 'rerandomize', {});
|
||||
if (!_.isEmpty(randomizationType) && Object.values(RandomizationTypesKeys).includes(randomizationType)) {
|
||||
settings = popuplateItem(settings, 'rerandomize', 'randomization', metadata);
|
||||
}
|
||||
|
||||
settings = popuplateItem(settings, 'show_reset_button', 'showResetButton', metadata);
|
||||
settings = popuplateItem(settings, 'submission_wait_seconds', 'timeBetween', metadata);
|
||||
|
||||
return settings;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user