Skip to content

Commit

Permalink
prevent duplicate improvise questions in dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastsg committed Jun 21, 2019
1 parent c00ce3e commit 53fc94e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/improviser.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ public function get_all_improvised_question_definitions() {
$context = \context_module::instance($this->jazzquiz->cm->id);
$parts = explode('/', $context->path);
foreach ($parts as $part) {
$sql = "SELECT q.id,
q.name
// Selecting name first, to prevent duplicate improvise questions.
$sql = "SELECT q.name,
q.id
FROM {question} q
JOIN {question_categories} qc
ON qc.id = q.category
Expand Down

0 comments on commit 53fc94e

Please sign in to comment.