4770 Commits

Author SHA1 Message Date
Ilya Tregubov
04cdf6889d
Merge branch 'MDL-78939' of https://github.com/paulholden/moodle 2023-08-10 18:31:51 +07:00
Jun Pataleta
ec200c0e6c
Merge branch 'MDL-77378_master_v3' of https://github.com/TomoTsuyuki/moodle 2023-08-10 18:31:50 +07:00
Ilya Tregubov
58664d0b26
Merge branch 'master_MDL-78860' of https://github.com/mattporritt/moodle 2023-08-09 09:42:37 +08:00
Paul Holden
69caa83345
MDL-78939 qformat_xml: fix reference to calculated question files. 2023-08-08 08:08:33 +01:00
Matt Porritt
d84389391c MDL-78860 qtype_calculatedmulti: PHP 8.2 compatibility
PHP 8.2 has deprecated setting properties on objects dynamically.
The qtype_calculatedmulti question type had two properties being
set this way($correctanswerlength and$correctanswerformat).
This patch extends the question_answer class to add the properties
when the object is instantiated.
2023-08-04 15:44:13 +10:00
Ilya Tregubov
05655afa6b
Merge branch 'MDL-78866-master' of https://github.com/danghieu1407/moodle 2023-08-03 09:38:32 +08:00
Huong Nguyen
ddae9c4ae1
Merge branch 'MDL-78815_master' of https://github.com/marxjohnson/moodle 2023-08-02 14:58:23 +07:00
Mark Johnson
1055a2c1c2 MDL-78815 qbank_comment: Delete comments in event observer 2023-08-02 08:34:59 +01:00
Mark Johnson
a2c8eed5c8 MDL-78815 qbank_customfields: Delete custom field data in event observer 2023-08-02 08:34:59 +01:00
Mark Johnson
36ab582177 MDL-78815 qbank_tagquestion: Delete tags in event observer 2023-08-02 08:34:59 +01:00
Mark Johnson
b7b932a3c1 MDL-78823 core: Add new events when enabling and disabling qbank plugins 2023-08-02 08:34:32 +01:00
danghieu1407
a5af041c40 MDL-78866 question: question_created trigger pre-saving extra fields 2023-08-01 16:01:31 +07:00
Tomo Tsuyuki
eacffa413e MDL-77378 qtype_multianswer: Fix division by zero errors 2023-08-01 11:24:32 +10:00
Andrew Nicols
de919962ea
Merge branch 'MDL-77328-master-fix' of https://github.com/junpataleta/moodle 2023-07-21 11:58:36 +08:00
Andrew Nicols
094f5dbb5b
Merge branch 'MDL-77745_master' of https://github.com/marxjohnson/moodle 2023-07-21 11:58:34 +08:00
Jun Pataleta
26905eeb93
MDL-77328 question: Declare $qbank as a proper view_component property 2023-07-21 11:57:14 +08:00
Jun Pataleta
73259066c4
MDL-77328 qformat_xml: Avoid dynamic declaration for question_answer
Declare qformat_xml::answerfiles and qformat_xml::feedbackfiles instead
of dynamically declaring answerfiles and feedbackfiles for the
question_answer instance when exporting questions and answers to XML
format.
2023-07-21 11:57:14 +08:00
Jun Pataleta
185c14ad1a
MDL-77328 qtype_caclulatedmulti: Use qtype_calculated_answer
The question answers for question type plugins extending
\qtype_calculated now have the type
\qtype_calculated\qtype_calculated_answer. So the answers for test
helper functions make_calculatedmulti_question_singleresponse() and
make_calculatedmulti_question_multiresponse() should also be changed
accordingly.
2023-07-21 11:57:13 +08:00
Jun Pataleta
9119d4513f
MDL-77328 qtype_caclulatedsimple: Use qtype_calculated_answer
The question answers for question type plugins extending
\qtype_calculated now have the type
\qtype_calculated\qtype_calculated_answer. So the answers for
make_calculatedsimple_question_sum() should be changed accordingly.
2023-07-21 11:57:13 +08:00
Jun Pataleta
6ec75e40e0
MDL-77328 qtype_calculated: Add upgrade.txt notes
* Question type plugins that extend qtype_calculated should be made
aware of the changes about the new question_answer type
\qtype_calculated\qtype_calculated_answer.
2023-07-21 11:57:13 +08:00
Jun Pataleta
fa3395bb8b
Merge branch 'MDL-77328-master' of https://github.com/rezaies/moodle 2023-07-21 11:57:12 +08:00
Tim Hunt
3ea0bdfba6 MDL-76757 delete questions: fix message generation logic
The order was getting scrambled.
2023-07-13 17:10:13 +01:00
Huong Nguyen
256f83cc34
Merge branch 'MDL-76757-master' of https://github.com/danghieu1407/moodle 2023-07-13 16:51:04 +02:00
Andrew Nicols
3ed796bc10
Merge branch 'MDL-75125_master' of https://github.com/marxjohnson/moodle 2023-07-13 16:51:03 +02:00
Jake Dallimore
66e6111165
Merge branch 'MDL-77912' of https://github.com/timhunt/moodle 2023-07-13 16:49:59 +02:00
Andrew Nicols
6c1cabaa3c
Merge branch 'MDL-76996' of https://github.com/timhunt/moodle 2023-07-13 16:49:59 +02:00
Meirza
2eb879360c MDL-77328 qtype_multianswer: Refactor for PHP 8.2 compatibility
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.
2023-07-13 21:03:23 +10:00
Shamim Rezaie
9f00818d00 MDL-77328 qtype_calculated: Refactor for PHP 8.2 compatibility
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.
2023-07-13 21:03:23 +10:00
Meirza
2b23c8cee2 MDL-77328 qtype_truefalse: Refactor for PHP 8.2 compatibility
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.
2023-07-13 21:03:22 +10:00
Mark Johnson
ab8a4dd8cb MDL-77745 core_question: Show question version in info box 2023-07-13 11:11:43 +01:00
Tim Hunt
931a4cbd56 MDL-76996 question bank: fix errors when qbank_statistics is disabled 2023-07-12 11:46:38 +01:00
Ilya Tregubov
8219595f7e
Merge branch 'MDL-72493-master' of https://github.com/mihailges/moodle 2023-07-12 10:05:54 +08:00
Tim Hunt
744e6f836e MDL-77912 questions: make multi-choice stats calc robust to bad data 2023-07-11 16:57:11 +01:00
Darren Cocco
0f5a9e7680 MDL-72493 mod_quiz: Use question cache when starting attempt.
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.
2023-07-11 13:47:50 +08:00
danghieu1407
ab4cb28883 MDL-76757 Question bank: Can not delete the question completely 2023-07-10 14:30:01 +07:00
Andrew Nicols
14029657a7
MDL-76717 question: Coding style fixes 2023-07-09 21:59:13 +08:00
Andrew Nicols
05a8ac58db
Merge branch 'MDL-76717_master' of https://github.com/marxjohnson/moodle 2023-07-08 13:01:47 +08:00
Jun Pataleta
d3767cb9f6
Merge branch 'MDL-78488' of https://github.com/t-schroeder/moodle 2023-07-06 11:17:03 +08:00
Ilya Tregubov
39662f1e32
Merge branch 'MDL-78608' of https://github.com/timhunt/moodle 2023-07-06 09:56:37 +08:00
Andrew Nicols
cee81e21c1
Merge branch 'MDL-77599' of https://github.com/stronk7/moodle 2023-07-05 21:58:47 +08:00
Eloy Lafuente (stronk7)
d9f7fe9c3f
MDL-77599 coding-style: Replace forbidden @const tags by @var
@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).
2023-07-03 15:58:16 +02:00
Mark Johnson
f3e3bac918 MDL-78174 core_question: Build tertiary navigation using qbank plugins 2023-07-03 11:29:04 +01:00
Tim Schroeder
b42ca2cbbd
MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:39:04 +02:00
Tim Hunt
3534b31745 MDL-78608 question stats: avoid loading data for missing contexts
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.
2023-06-28 17:16:48 +01:00
mkassaei
a410223c74 MDL-77679 Drag and drop question type weird behavior 2023-06-26 16:56:56 +01:00
Mark Johnson
327c11d6a0 MDL-76717 qbank_usage: Add support for usage by version 2023-06-23 11:28:29 +01:00
Mark Johnson
c714f2b082 MDL-76717 qbank_history: Show usage column 2023-06-22 16:40:36 +01:00
Mark Johnson
e6bf0b0f9b MDL-76717 qbank_usage: Fix usage count query for random questions 2023-06-22 16:40:36 +01:00
Andrew Nicols
944129a57f Merge branch 'MDL-78477' of https://github.com/AnupamaSarjoshi/moodle 2023-06-22 14:29:38 +02:00
Andrew Nicols
5f41e5fdc7 Merge branch 'MDL-77865_Master' of https://github.com/tuanngocnguyen/moodle 2023-06-22 14:29:38 +02:00