-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_36_STABLE
-
wip-
MDL-62708-master -
Many entities in Moodle have a field called idnumber, including users, courses, course_categories, cohorts, groups, groupings, course_modules, grade_items, competencies, .... (For a full list, search for idnumber in lib/db/install.xml.)
Until now, questions and question_categories have not had idnumbers, but for a project we are working on at the Open University, it would be extremely helpful if we could add them. Hence, we are raising this issue, and the related forum thread: https://moodle.org/mod/forum/discuss.php?d=372096, to discuss doing so.
Techical details:
- Add a new column, idnumber CHAR(100) to the question and question_categories tables.
- Add unique indexes on question (category, idnumber) and question_categories (contextid, idnumber).
- Add that field (PARAM_RAW) to the edit question and edit question_categories form.
- Form validation to avoid unique index errors when editing.
- Add the new fields to backup/restore.
- Add the new fields to Moodle XML import/export in the question bank.
- Code in restore & import, so that if the idnumber would cause a unique index violation, we nullify the new items idnumber - this seems to be what is done for other idnumbers in restore.
- Code when moving a question between categories - add an integer suffix _N (like course restore does).
- Ditto when moving question categories to a new context.
- Obviously, all the unique index issues will need careful tests to verify.
- caused a regression
-
MDL-63493 Question upgrade failure in Oracle and SQL Server
- Closed
-
MDL-63752 Duplicate key constraints violation when importing multiple questions in a new category
- Closed
-
MDL-65296 Question idnumber field is set on the question definition class, but not declared
- Closed
-
MDL-65731 Quiz: Manual Grading: Change Sort to "By Student ID" -- exception thrown
- Closed
-
MDL-69798 HTML special chars in the idnumber not escaped when exporting questions as Moodle XML
- Closed
- has been marked as being related by
-
MDL-62878 Admin UI for configuring the question bank display
- Open
-
MDL-62877 A way to display idnumbers in the question bank UI
- Closed
- will be (partly) resolved by
-
MDL-63020 Work-around MS SQL and Oracle incorrect handling of unique indexes on nullable columns
- Closed