This commit addresses compatibility issues in the qtype_multianswer
question type. The following changes were made:
- The usage of the undeclared property $maxmark on subquestions in
qtype_multianswer was identified as problematic. To resolve this,
the existing declared property $defaultmark is now being used for
the same purpose.
By switching to the declared property $defaultmark, compatibility with
PHP 8.2 is ensured and the issue with the undeclared property is
resolved.
This commit addresses compatibility issues in the qtype_calculated
question type. The following problems were identified and resolved:
- qtype_calculated was reusing the qtype_numerical_answer class and
setting two additional properties ($correctanswerlength and
$correctanswerformat) that were not declared. To resolve this, a new
class, qtype_calculated_answer, was defined and utilised.
- During grading in qtype_numerical, there were references to an
undeclared property ($unitisright) used to track calculation details.
This issue was fixed using a 'replace temp with query' refactoring.
These changes ensure the qtype_calculated question type is compatible
with PHP 8.2 and addresses the identified issues.
This commit addresses the following issues and improvements in the
qtype_truefalse class:
- Added missing class properties:
- public $truefeedbackformat
- public $falsefeedbackformat
- public $showstandardinstruction
- Updated qtype_truefalse_question to include type hinting for better
IDE support.
Replaced custom loading of data and then question object
creation using internal question_bank functionality with
question_bank::load_question.
Removed the call $quizobj->load_questions as it is
redundant.
@const is not a valid phpdoc tag and @var should be used to
document both classes properties and constants (no matter how
weird that may sound, heh).
Link to (draft right now) PHP-FIG:
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#518-var
So, with this commit we are just replacing all uses by the correct
@var one. Note that the type is entirely optional, in fact I think
that there isn't much need of it for constants because it's obvious
for both humans and machines which the type is. But, as far as it's
also correct to specify it, we haven't modified that detail.
The only detail modified are the cases where the constant name was
specified in the phpdoc, that's not needed, hence, the names have
been removed from there when present (a couple of cases).
It turns out that there are plugins which don't (currently)
clean up their question attempts when a context is deleted.
Therefore, we need to make Moodle core robust to that.
Changes done to fix the warnings thrown in the history view when the
last version of a question is deleted and improved UI to display the
message and a Continue button, to navigate back to the Question bank.
This commit will implement question bank actions as a feature.
Previously, it used to implement columns and actions together in one
feature.
With this change it will have actions a different feature which will
allow
developers to implement actions in an easier way.
The existing "action column" API will be deprecated in a separate
commit.
Co-authored-by: Mark Johnson <mark.johnson@catalyst-eu.net>
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.