mod/quiz/report/answersheets/classes/output/multichoice/renderer.php inherits from qtype_multichoice_single_renderer
but you can overwrite the question type if you insert following lines, right after you get the input attributes.
I explicitly commented the lines of code only here.
global $DB;
// every question has its unique id
$questionid = $qa->get_question_id();
// Because we have a multicoice question, it is either a single and therefore is rendered originally as radio-button
// or it is a not a single, because more than one answer is possible, then it is originally rendered as checkbox.
// the type can be retrieved from the database table qtype_multichoice_options
$specific_type = $DB->get_record('qtype_multichoice_options', ['questionid' => $questionid], 'single', MUST_EXIST);
if ($specific_type->single == 0){
$inputattributes['type'] = 'checkbox';
}
This fix renders a radio button if it is a single multichoice and renders a checkbox if it is not a single multichoice.
Fixing https://github.com/moodleou/moodle-quiz_answersheets/issues/31
mod/quiz/report/answersheets/classes/output/multichoice/renderer.php
inherits fromqtype_multichoice_single_renderer
but you can overwrite the question type if you insert following lines, right after you get the input attributes. I explicitly commented the lines of code only here.
This fix renders a radio button if it is a single multichoice and renders a checkbox if it is not a single multichoice.