Skip to content

Commit

Permalink
MDL-72321 core_question: Replace old conditions with new datafilters
Browse files Browse the repository at this point in the history
  • Loading branch information
marxjohnson committed Aug 31, 2023
1 parent d2f68ab commit 823af3a
Show file tree
Hide file tree
Showing 88 changed files with 3,217 additions and 1,102 deletions.
3 changes: 2 additions & 1 deletion lang/en/question.php
Expand Up @@ -398,6 +398,7 @@
$string['markedoutofmax'] = 'Marked out of {$a}';
$string['markoutofmax'] = 'Mark {$a->mark} out of {$a->max}';
$string['marks'] = 'Marks';
$string['noconditionspecified'] = 'Please specify a condition';
$string['noresponse'] = '[No response]';
$string['notanswered'] = 'Not answered';
$string['notgraded'] = 'Not graded';
Expand Down Expand Up @@ -465,9 +466,9 @@
$string['rightanswer_help'] = 'An automatically generated summary of the correct response. This can be limited, so you may wish to consider explaining the correct solution in the general feedback for the question, and turning this option off.';
$string['saved'] = 'Saved: {$a}';
$string['settingsformultipletries'] = 'Multiple tries';
$string['showhidden'] = 'Show hidden questions';
$string['shortversioninfo'] = 'v{$a->version} (of {$a->latestversion})';
$string['shortversioninfolatest'] = 'v{$a->version} (latest)';
$string['showhidden'] = 'Also show old questions';
$string['showmarkandmax'] = 'Show mark and max';
$string['showmaxmarkonly'] = 'Show max mark only';
$string['showquestiontext'] = 'Show question text in the question list?';
Expand Down
4 changes: 4 additions & 0 deletions lib/db/renamedclasses.php
Expand Up @@ -86,4 +86,8 @@
'core_block\\local\\views\\secondary' => 'core_block\\navigation\\views\\secondary',
// Since Moodle 4.2.
'Box\\Spout' => 'OpenSpout',
// Since Moodle 4.3.
'core_question\\bank\\search\\condition' => 'core_question\\local\\bank\\condition',
'core_question\\bank\\search\\category_condition' => 'qbank_managecategories\\category_condition',
'core_question\\bank\\search\\hidden_condition' => 'qbank_deletequestion\\hidden_condition',
];
2 changes: 1 addition & 1 deletion lib/templates/datafilter/filter_row.mustache
Expand Up @@ -36,7 +36,7 @@
<div data-filterregion="filter" data-filter-type="">
<fieldset>
<legend class="sr-only">{{#str}}filterrowlegend, core, {{rownumber}}{{/str}}</legend>
<div class="border-radius my-2 p-2 bg-white border d-flex flex-column flex-md-row align-items-md-start mr-0 ml-0 row">
<div class="border-radius my-2 p-2 bg-white border d-flex flex-column flex-md-row align-items-md-stretch mr-0 ml-0 row">
<div class="d-flex flex-column flex-md-row align-items-md-center my-1">
<label for="core-filter_row-jointype-{{uniqid}}" class="mr-md-2 mb-md-0">{{#str}}match{{/str}}</label>
<select class="custom-select mb-1 mb-md-0 mr-md-2" data-filterfield="join" id="core-filter_row-jointype-{{uniqid}}" disabled>
Expand Down
6 changes: 3 additions & 3 deletions mod/quiz/classes/question/bank/custom_view.php
Expand Up @@ -264,9 +264,9 @@ protected function build_query(): void {

// Build the order by clause.
$sorts = [];
foreach ($this->sort as $sort => $order) {
list($colname, $subsort) = $this->parse_subsort($sort);
$sorts[] = $this->requiredcolumns[$colname]->sort_expression($order < 0, $subsort);
foreach ($this->sort as $sortname => $sortorder) {
list($colname, $subsort) = $this->parse_subsort($sortname);
$sorts[] = $this->requiredcolumns[$colname]->sort_expression($sortorder == SORT_DESC, $subsort);
}

// Build the where clause.
Expand Down
10 changes: 10 additions & 0 deletions question/amd/build/filter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 823af3a

Please sign in to comment.