diff --git a/lang/en/qtype_oumatrix.php b/lang/en/qtype_oumatrix.php index 803a09b..411d500 100644 --- a/lang/en/qtype_oumatrix.php +++ b/lang/en/qtype_oumatrix.php @@ -32,14 +32,14 @@ $string['answermode_desc'] = 'Answer mode can be either \'Single choice\' or \'Multiple response\' for each row in the matrix table.'; $string['answermodemultiple'] = 'Multiple response'; $string['answermodesingle'] = 'Single choice'; -$string['blankcolumnsnotallowed'] = 'Blank columns in the middle are not allowed.'; +$string['blankcolumnsnotallowed'] = 'Empty column name is not allowed.'; $string['column'] = 'Column {$a}'; $string['columnshdr'] = 'Matrix columns (answers)'; $string['correctanswer'] = 'Correct answer'; $string['correctansweris'] = 'The correct answer is: {$a}'; $string['correctanswersare'] = 'The correct answers are: {$a}'; $string['correctanswers'] = 'Correct answers'; -$string['duplicates'] = 'Duplication is not allowed, (\'{$a}\' is a duplicate)'; +$string['duplicates'] = 'Duplicate answer ({$a}) is not allowed.'; $string['grademethod'] = 'Grading type'; $string['grademethod_desc'] = 'Standard (subpoints): each correct response in the body cells is worth one point, so students score a percentage of the total correct responses. All or nothing: students must get every response correct, otherwise they score zero.'; @@ -48,9 +48,9 @@ All or nothing: students must get every response correct, otherwise they score zero.'; $string['gradepartialcredit'] = 'Give partial credit'; $string['gradeallornothing'] = 'All-or-nothing'; -$string['noinputanswer'] = 'Each matrix sub-question should have atleast one correct answer'; -$string['notenoughanswercols'] = 'Matrix question type requires at least {$a} answers columns'; -$string['notenoughquestionrows'] = 'Matrix question type requires at least {$a} question rows'; +$string['noinputanswer'] = 'Each sub-question should have at least one correct answer.'; +$string['notenoughanswercols'] = 'You must have at least {$a} answer columns.'; +$string['notenoughquestionrows'] = 'You must have at least {$a} sub-questions.'; $string['pleaseananswerallparts'] = 'Please answer all parts of the question.'; $string['pluginname'] = 'Matrix'; $string['pluginname_help'] = 'Creating a matrix question requires you to specify column headings (values) to row headings (items). For example, you might ask students to classify an item as animal, vegetable, or mineral using Single Choice. You can use Multiple Response so that several values may apply to an item.'; @@ -58,7 +58,7 @@ $string['pluginnameediting'] = 'Editing a Matrix question'; $string['pluginnamesummary'] = 'A multi-row table that can use single choice or multiple response inputs.'; $string['row'] = 'Row {$a}'; -$string['rowshdr'] = 'Matrix rows (questions)'; +$string['rowshdr'] = 'Matrix rows (sub-questions)'; $string['rowanswerlist'] = 'Select answers'; $string['rowx'] = 'Row{$a})'; $string['shuffleanswers'] = 'Shuffle the items?'; diff --git a/question.php b/question.php index a15d8be..64c9fd0 100644 --- a/question.php +++ b/question.php @@ -346,7 +346,7 @@ public function summarise_response(array $response): ?string { if (array_key_exists($fieldname, $response)) { foreach ($this->columns as $column) { if ($response[$fieldname] == $column->number) { - $responsewords[] = $row->name . " => " . $column->name; + $responsewords[] = $row->name . ' → ' . $column->name; } } } @@ -564,7 +564,7 @@ public function summarise_response(array $response): ?string { foreach ($this->roworder as $key => $rownumber) { // Get the correct row. $row = $this->rows[$rownumber]; - $rowresponse = $row->name . " => "; + $rowresponse = $row->name . ' → '; $answers = []; foreach ($this->columns as $column) { $fieldname = $this->field($key, $column->number); diff --git a/renderer.php b/renderer.php index cc757ee..ac3532a 100644 --- a/renderer.php +++ b/renderer.php @@ -125,11 +125,11 @@ public function get_matrix(question_attempt $qa, question_display_options $optio $question = $qa->get_question(); $response = $qa->get_last_qt_data(); - $caption = "Matrix question"; + $caption = $options->add_question_identifier_to_label('', true, true); $colname[] = null; $table = "
"; $index = 0; @@ -160,15 +160,15 @@ public function get_matrix(question_attempt $qa, question_display_options $optio foreach ($question->get_order($qa) as $rowkey => $rowid) { $row = $question->rows[$rowid]; $rowname = $row->name; - $rownewid = 'row_'. $rowkey; + $rownewid = 'row'. $rowkey; $feedback = ''; - $table .= " | $rowname | "; + $table .= "$rowname | "; for ($j = 0; $j < count($colname); $j++) { $inputattributes['name'] = $this->get_input_name($qa, $rowkey, $j); $inputattributes['value'] = $this->get_input_value($j); $inputattributes['id'] = $this->get_input_id($qa, $rowkey, $j); - $inputattributes['aria-labelledby'] = $inputattributes['id'] . '_label'; + $inputattributes['aria-labelledby'] = 'col' . $j . ' ' . $rownewid; $isselected = $question->is_choice_selected($response, $rowkey, $j); @@ -277,7 +277,7 @@ public function correct_response(question_attempt $qa) { $right = []; foreach ($question->rows as $row) { if ($row->correctanswers != '') { - $right[] = $row->name . " => " . $question->columns[array_key_first($row->correctanswers)]->name; + $right[] = $row->name . ' → ' . $question->columns[array_key_first($row->correctanswers)]->name; } } return $this->correct_choices($right); @@ -378,7 +378,7 @@ public function correct_response(question_attempt $qa) { $question = $qa->get_question(); foreach ($question->rows as $row) { // Get the correct row. - $rowanswer = $row->name . " => "; + $rowanswer = $row->name . ' → '; $answers = []; if ($row->correctanswers != '') { foreach ($row->correctanswers as $columnkey => $notused) {
---|