Skip to content

Commit f3d73cf

Browse files
committed
fixup! Add question bank filter API guide
Add link to build_query() method.
1 parent 547101f commit f3d73cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/apis/plugintypes/qbank/filters.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ To actually filter the results, define `build_query_from_filter()` which returns
8282
The `$filter` parameter receives an array with a `'values'` key, containing an array of the selected values, and a `'jointype'` key,
8383
containing one of the `JOINTTYPE_ANY`, `JOINTYPE_ALL` or `JOINTYPE_NONE` constants. Use these to build your condition as required.
8484

85+
The conditions from each filter are combined with the query in
86+
[`core_question\local\bank\view::build_query()`](https://github.com/moodle/moodle/blob/c741492c38b9945abbfc7e90dfe8f943279f8265/question/classes/local/bank/view.php#L733)
87+
to select the filtered question list.
88+
8589
```php title="Filter questions"
8690
public function build_query_from_filter(array $filter): array {
8791
$andor = ' AND ';

0 commit comments

Comments
 (0)