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.
26 lines
1.1 KiB
JavaScript
26 lines
1.1 KiB
JavaScript
import { popuplateItem } from './SettingsParser';
|
|
|
|
class ReactStateSettingsParser {
|
|
constructor(problemState) {
|
|
this.problemState = problemState;
|
|
}
|
|
|
|
getSettings() {
|
|
let settings = {};
|
|
const stateSettings = this.problemState.settings;
|
|
|
|
settings = popuplateItem(settings, 'matLabApiKey', 'matlab_api_key', stateSettings);
|
|
settings = popuplateItem(settings, 'number', 'max_attempts', stateSettings.scoring.attempts);
|
|
settings = popuplateItem(settings, 'weight', 'weight', stateSettings.scoring);
|
|
settings = popuplateItem(settings, 'on', 'showanswer', stateSettings.showAnswer);
|
|
settings = popuplateItem(settings, 'afterAttempts', 'attempts_before_showanswer_button', stateSettings.showAnswer);
|
|
settings = popuplateItem(settings, 'showResetButton', 'show_reset_button', stateSettings);
|
|
settings = popuplateItem(settings, 'timeBetween', 'submission_wait_seconds', stateSettings);
|
|
settings = popuplateItem(settings, 'randomization', 'rerandomize', stateSettings);
|
|
|
|
return settings;
|
|
}
|
|
}
|
|
|
|
export default ReactStateSettingsParser;
|