{ "source": { "author": { "name": "Christian Lawson-Perfect" } }, "name": "Codeword match", "short_name": "codeword", "description": "
The student must enter the given codeword. Any commas or spaces are stripped out before it's parsed.
", "help_url": "", "input_widget": "string", "input_options": { "correctAnswer": "string(settings[\"correctAnswer\"])", "hint": { "static": true, "value": "" }, "allowEmpty": { "static": true, "value": false } }, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\napply(student_answer);\ncorrectif(student_answer=correct_answer)\n\ninterpreted_answer:\nstudent_answer\n\nfield_size:\nfield_size(correct_answer)\n\ncorrect_answer:\nsettings[\"correctAnswer\"]\n\nstudent_answer:\ntry(\n codeword(studentAnswer,field_size),\n msg,\n fail(\"Your answer is incorrect: \"+msg)\n)", "marking_notes": [ { "name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "apply(student_answer);\ncorrectif(student_answer=correct_answer)" }, { "name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "student_answer" }, { "name": "field_size", "description": "", "definition": "field_size(correct_answer)" }, { "name": "correct_answer", "description": "", "definition": "settings[\"correctAnswer\"]" }, { "name": "student_answer", "description": "", "definition": "try(\n codeword(studentAnswer,field_size),\n msg,\n fail(\"Your answer is incorrect: \"+msg)\n)" } ], "settings": [ { "name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The codeword that the student must enter", "input_type": "code", "default_value": "", "evaluate": true } ], "public_availability": "always", "published": true, "extensions": [ "codewords" ] }