-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.4, 5.0
The unit test test_restore_course_with_same_stamp_questions was introduced with MDL-83541. It tests all available question types that support automatic testing and checks whether the question has $questiondata->options->answers set. If this is the case, it assumes that the question will automatically have its answer data in the question_answers table, as that is what all classic question types included in core and many third party qtype plugins do.
However, some question types have custom tables, e. g. qtype_formulas_answers for the Formulas question type. It is, of course, debatable whether that was a good choice. But the consequence is that the test will fail for third party questions of that kind.
I suggest doing an additional check in the unit test in order to skip testing question types that mimic core question behaviour but use custom tables.