4633 Commits

Author SHA1 Message Date
Tim Hunt
4bc3782c4c MDL-77626 quiz statistics: Divide by zero if a random Q has max mark 0 2023-03-14 16:34:30 +00:00
Andrew Nicols
23e2b0358c Merge branch 'MDL-76849-401-5' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-03-10 09:29:40 +08:00
Sara Arjona
69a91b30cc Merge branch 'MDL-77323-401' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_401_STABLE 2023-03-09 16:48:39 +01:00
Jun Pataleta
bb61d8392b Merge branch 'MDL-77559-401-2' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-03-09 15:57:44 +08:00
Jun Pataleta
ed6b43b4f2 Merge branch 'MDL-77225_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-03-09 10:43:06 +08:00
Andrew Nicols
cd48ae56c7 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Jun Pataleta
d5cf25faf5 MDL-76849 qtype_essay: Allow question number inclusion in answer fields
* Have the following classes extend qtype_essay_format_renderer_base
  as they have been meant to:
  - qtype_essay_format_editor_renderer
  - qtype_essay_format_noinline_renderer
  - qtype_essay_format_plain_renderer
* Add a question_display_options instance variable for
qtype_essay_format_renderer_base so its subclasses can use it to
generate the label for their respective answer fields.
2023-03-09 08:57:47 +08:00
Jun Pataleta
787278601c MDL-76849 qtype_shortanswer: Include question number in answer fields 2023-03-09 08:57:47 +08:00
Jun Pataleta
880532c71a MDL-76849 qtype_numerical: Include question number in answer fields
* Also covers its qtype_calculated and qtype_calculatedsimple
which extend its renderer class
2023-03-09 08:57:47 +08:00
Jun Pataleta
03b549f225 MDL-76849 qtype_multianswer: Include question number in answer fields
* Add the question number to the answer fields if it's available.
* Improve multiple choice question accessibility:
  - Label the multiple choice question groups appropriately by
    enclosing them in fieldset tags and applying sr-only legend tags to
    label them.
  - Apply Bootstrap form-check classes to the radio buttons, so they
    are rendered better and become responsive as well. This also helps
    avoid the use of the table element for layout purposes when
    rendering horizontal multiple choice sub-questions.
2023-03-09 08:57:47 +08:00
Jun Pataleta
7b6ff446f4 MDL-76849 qtype_match: Include question number in answer fields 2023-03-09 08:57:47 +08:00
Jun Pataleta
9ddbc2d7f0 MDL-76849 qtype_truefalse: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons
in a fieldset.
2023-03-09 08:57:47 +08:00
Jun Pataleta
fbffd9b148 MDL-76849 qtype_multichoice: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons/checkboxes
in a fieldset.
2023-03-09 08:57:47 +08:00
Jun Pataleta
2ad0871a82 MDL-76849 qtype_ddwtos: Include question number in answer fields
* Plus include the item number so users will have an idea which blank
numbers they are currently on.
2023-03-09 08:57:47 +08:00
Jun Pataleta
5847b0026e MDL-76849 qtype_gapselect: Include question number in answer fields 2023-03-09 08:57:47 +08:00
Jun Pataleta
6c3f1d55a8 MDL-76849 qtype: Add a questionidentifier instance variable
* Add an instance variable to question_display_options to store the
identifier associated with the question being rendered.
* This information can be used by question type plugins to improve the
accessibility of the answer fields being rendered by adding the
question identifier to the answer fields' labels.
* Adding the question identifier to the label can be achieved by using
question_display_options::add_question_identifier_to_label().

Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2023-03-09 08:57:47 +08:00
Tim Hunt
7db1da61ee MDL-77225 questions: fix regrade of descriptions in finished attempts
The added logic is similar to the logic in other behaviours, and the new test fails without it.
2023-03-08 19:00:43 +00:00
Tim Hunt
bdcf29ab29 MDL-77464 questions: regrading was losing question_attempt metadata
This is very similar to MDL-77090, but at the time, I missed that this
also needed to be handled. (Question metadata is, I think, only used
by the quiz 'Try another question like this one' feature.)
2023-03-07 13:45:04 +00:00
Tim Hunt
795e8ac70a MDL-77464 questions: update comments in question_attempt_step
The class comment had some inaccuracies which I fixed.
I also replaced all uses of @link with @see.
2023-03-07 13:44:59 +00:00
Jun Pataleta
a377bf30c4 Merge branch 'MDL-75012-401-5' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-03-02 12:31:09 +08:00
Andrew Nicols
288620b0b4 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Jake Dallimore
b4944cadca Merge branch 'MDL-76298_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-03-02 10:13:04 +08:00
hieuvu
d07d010288 MDL-77323 question: Prevent drag item sent into two drop zone 2023-03-01 14:47:41 +07:00
Andrew Nicols
576afc3ba6 Merge branch 'MDL-58945_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-03-01 10:55:38 +08:00
Tim Hunt
291d241981 MDL-76843 quiz: fix statistics questions for missing questions 2023-02-22 15:07:40 +00:00
Tim Hunt
d6f0ad4980 MDL-76843 questions behat: enhancements requried to test this issue
* New steps to set up certian sorts of broken test data.
* Fix qtype_essay_question::un_summarise_response().
2023-02-22 15:05:41 +00:00
Tim Hunt
40d6ba9505 MDL-76298 drag-drop questions: validate the questions are complete
Previously, it was possible to create drag-drop markers and onto image
questions without any drag items or drop zones. This was non-sensical,
and broke statistics calculations.

So, missing validation added, and random guess score calculation made
robust.
2023-02-22 12:06:34 +00:00
Tim Hunt
32bf205db3 MDL-58945 qbank: showing q text should give option of plain or full 2023-02-22 11:17:52 +00:00
Andrew Nicols
0dc15ee619 Merge branch 'MDL-76904-401' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_401_STABLE 2023-02-09 12:04:33 +08:00
Andrew Nicols
58814af9f1 Merge branch 'MDL-77018_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-02-09 10:51:48 +08:00
Tim Hunt
f93fa35ecf MDL-77090 questions: regrade of interactive attempts lose tries count
The behaviour-specific data was getting corrupted when the regrade
recreated the first step, because $oldstep->get_behaviour_data() was
stripping off the leading '-' characters from the names, and they were
not being added back.
2023-02-03 10:52:45 +00:00
hieuvu
06c3d068a6 MDL-76904 question: Keep question highlight in url 2023-01-31 16:32:36 +07:00
Tim Hunt
db861ee6d3 MDL-77018 qbank_statistics: only load stats for contexts that exist
Also, pre-load the contexts for efficiency.
2023-01-27 20:51:51 +00:00
Andrew Nicols
0a4f551fff Merge branch 'MDL-75978-401' of https://github.com/JBThong/moodle into MOODLE_401_STABLE 2023-01-27 12:34:04 +08:00
Andrew Nicols
2250ab07e6 MDL-76362 qtype_numerical: Fix bug in phpdoc 2023-01-23 09:16:07 +08:00
Andrew Nicols
71c1fa0d8e MDL-76362 qtype_calculated*: Address issues with null strings 2023-01-23 09:16:07 +08:00
Andrew Nicols
5fbd2eac32 MDL-76362 qtype: Update formatting of qtype_calculated* upgradelib 2023-01-23 09:16:07 +08:00
Andrew Nicols
12b36d2a32 MDL-76362 qtype_numerical: Support empty units for apply_units 2023-01-23 09:16:07 +08:00
Andrew Nicols
5f412b3301 MDL-76362 qtype_numeric: Refactor answer tests 2023-01-23 09:16:07 +08:00
Andrew Nicols
4ff3447c8c MDL-76362 question: Add test for number(null) 2023-01-23 09:16:07 +08:00
Andrew Nicols
745080671b MDL-76362 question: Refactor question number unit tests 2023-01-23 09:16:07 +08:00
Marina Glancy
2dd7290ccb MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:16:06 +08:00
Ilya Tregubov
e98b3fe183 Merge branch 'MDL-76870-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-01-19 11:15:14 +08:00
Simey Lameze
4b2834439e MDL-76870 question: change assertion to assertEqualsCanonicalizing
By using that assertion the arrays will be sorted before comparison
preventing any Oracle sorting related failures.

Credits for the solution go to Tim Hunt!
2023-01-13 18:13:12 +08:00
Tim Hunt
2ea89b98a7 MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:43:12 +08:00
Marina Glancy
ff5fc3820a MDL-76356 various: avoid implicit conversion to int
PHP before version 8.1 automatically converted to int if the function
parameter (or array key) is expected to be int. PHP 8.1 shows notice in
this case
2023-01-10 15:25:57 +01:00
Sara Arjona
87b3be343e Merge branch 'MDL-76308-401' of https://github.com/BruceGoodGuy/moodle into MOODLE_401_STABLE 2023-01-03 14:13:00 +01:00
Paul Holden
a25f2d0d7e Merge branch 'MDL-53137-401' of https://github.com/lucisgit/moodle into MOODLE_401_STABLE 2023-01-03 12:14:36 +00:00
Sara Arjona
e2c8f3db7c Merge branch 'MDL-76106-401' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_401_STABLE 2023-01-02 13:07:39 +01:00
Ilya Tregubov
f84d8e3c37 Merge branch 'MDL-76399-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-29 09:43:28 +07:00