Skip to content

Commit

Permalink
Changes to language strings
Browse files Browse the repository at this point in the history
  • Loading branch information
AnupamaSarjoshi committed Oct 6, 2023
1 parent 850915b commit a79fdcf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions lang/en/qtype_oumatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand All @@ -48,17 +48,17 @@
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.';
$string['pluginnameadding'] = 'Adding a Matrix question';
$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?';
Expand Down
4 changes: 2 additions & 2 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "
<table class='generaltable'>
<caption class='table_caption sr-only'>$caption</caption>
<caption class='table_caption'>$caption</caption>
<tr>
<th scope='col'></th>";
$index = 0;
Expand Down Expand Up @@ -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 .= "<th scope='col'><span id='$rownewid'>$rowname</span></th>";
$table .= "<th scope='row'><span id='$rownewid'>$rowname</span></th>";

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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a79fdcf

Please sign in to comment.