Coding error detected, it must be fixed by a programmer when trying to add a question from a test bank

Coding error detected, it must be fixed by a programmer when trying to add a question from a test bank

by Paul Preikschas -
Number of replies: 1

Having an issue in 2 of our courses, when a teacher is trying to add a new Quiz with questions from the test bank. They get the following error:

Any help.

codingerror


Coding error detected, it must be fixed by a programmer: Category id=10 is already on the list - loop of categories detected.


File: /lib/questionlib.php


Line: 1476


Error code: codingerror

* line 1476 of /lib/questionlib.php: coding_exception thrown

* line 88 of /question/classes/bank/search/category_condition.php: call to question_categorylist()

* line 75 of /question/classes/bank/search/category_condition.php: call to core_question\bank\search\category_condition->init()

* line 479 of /question/classes/bank/view.php: call to core_question\bank\search\category_condition->__construct()

* line 144 of /mod/quiz/classes/question/bank/custom_view.php: call to core_question\bank\view->display()

* line 1237 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\question\bank\custom_view->render()

* line 2468 of /mod/quiz/lib.php: call to mod_quiz\output\edit_renderer->question_bank_contents()

* line 7684 of /lib/moodlelib.php: call to mod_quiz_output_fragment_quiz_question_bank()

* line 415 of /lib/external/externallib.php: call to component_callback()

* line 228 of /lib/externallib.php: call to core_external::get_fragment()

* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()


Error code: codingerror

* line 1476 of /lib/questionlib.php: coding_exception thrown

* line 88 of /question/classes/bank/search/category_condition.php: call to question_categorylist()

* line 75 of /question/classes/bank/search/category_condition.php: call to core_question\bank\search\category_condition->init()

* line 479 of /question/classes/bank/view.php: call to core_question\bank\search\category_condition->__construct()

* line 144 of /mod/quiz/classes/question/bank/custom_view.php: call to core_question\bank\view->display()

* line 1237 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\question\bank\custom_view->render()

* line 2468 of /mod/quiz/lib.php: call to mod_quiz\output\edit_renderer->question_bank_contents()

* line 7684 of /lib/moodlelib.php: call to mod_quiz_output_fragment_quiz_question_bank()

* line 415 of /lib/external/externallib.php: call to component_callback()

* line 228 of /lib/externallib.php: call to core_external::get_fragment()

* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()


Error code: codingerror

* line 1476 of /lib/questionlib.php: coding_exception thrown

* line 88 of /question/classes/bank/search/category_condition.php: call to question_categorylist()

* line 75 of /question/classes/bank/search/category_condition.php: call to core_question\bank\search\category_condition->init()

* line 479 of /question/classes/bank/view.php: call to core_question\bank\search\category_condition->__construct()

* line 144 of /mod/quiz/classes/question/bank/custom_view.php: call to core_question\bank\view->display()

* line 1237 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\question\bank\custom_view->render()

* line 2468 of /mod/quiz/lib.php: call to mod_quiz\output\edit_renderer->question_bank_contents()

* line 7684 of /lib/moodlelib.php: call to mod_quiz_output_fragment_quiz_question_bank()

* line 415 of /lib/external/externallib.php: call to component_callback()

* line 228 of /lib/externallib.php: call to core_external::get_fragment()

* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()

Average of ratings: -
In reply to Paul Preikschas

Re: Coding error detected, it must be fixed by a programmer when trying to add a question from a test bank

by Elyse Crichton -

One of our instructors had a similar "codingerror" when doing some quizzes. We're on Moodle 3.7. 

He said he got the error after he duplicated from another quiz and hit "preview quiz." I think it was a quiz with a lot of randomized questions from lots of categories. I'm wondering if it had something to do with that?

This error showed up in different courses, but not consistently in his various quizzes. He said he deleted the quiz that gave him the error message and recreated it successfully.