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:
@@ -65,7 +65,21 @@ class ReactStateOLXParser {
|
||||
const choice = [];
|
||||
let compoundhint = [];
|
||||
let widget = {};
|
||||
const { answers } = this.problemState;
|
||||
// eslint-disable-next-line prefer-const
|
||||
let { answers, generalFeedback } = this.problemState;
|
||||
// general feedback replaces selected feedback if all incorrect selected feedback is the same.
|
||||
if (generalFeedback !== ''
|
||||
&& answers.every(
|
||||
answer => (
|
||||
answer.correct
|
||||
? true
|
||||
: answer?.selectedFeedback === answers.find(a => a.correct === false).selectedFeedback
|
||||
),
|
||||
)) {
|
||||
answers = answers.map(answer => (!answer?.correct
|
||||
? { ...answer, selectedFeedback: generalFeedback }
|
||||
: answer));
|
||||
}
|
||||
answers.forEach((answer) => {
|
||||
const feedback = [];
|
||||
let singleAnswer = {};
|
||||
|
||||
Reference in New Issue
Block a user