426 Commits

Author SHA1 Message Date
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
Tim Hunt
0f75a41fbf MDL-78622 quiz: add question query must include contextid
It is logically requried and necessary for the query to use the index
2023-07-03 11:50:42 +01:00
Dani Palou
a5a33b8d4a MDL-78307 quiz: Fix contexturl passed to attempt_overdue message 2023-05-24 13:10:50 +02:00
Tim Hunt
9be598a77f MDL-78260 quiz stats: fix View details for random questions 2023-05-17 09:09:13 +01:00
Mark Johnson
96bada8495 MDL-75301 quiz: Use "always latest" option for question previews
This will set the "alwayslatest" option when previewing a question from
the quiz according to the version setting used in the quiz slot.
2023-04-05 10:23:47 +01:00
Mark Johnson
72e7818467 MDL-74452 quiz: Display an error if all versions are in draft status 2023-03-28 11:42:44 +01:00
Jake Dallimore
f7134f1083 Merge branch 'MDL-76897' of https://github.com/timhunt/moodle 2023-03-01 12:43:58 +08:00
Tim Hunt
1b72db7082 MDL-76897 quiz: fix incorrect StdClass 2023-02-27 18:41:58 +00:00
Tim Hunt
20ccfc162d MDL-76897 quiz: deprecate unused quiz_calculate_best_attempt 2023-02-27 18:41:58 +00:00
Tim Hunt
728160cfbc MDL-76897 quiz: quiz_save_best_grade -> recompute_final_grade
also, the associated quiz_calculate_best_grade (only used here)
moved to a protected method.
2023-02-27 18:41:58 +00:00
Tim Hunt
ff3f4eb2e7 MDL-76897 quiz: quiz_set_grade -> update_quiz_maximum_grade 2023-02-27 18:41:57 +00:00
Tim Hunt
c212565151 MDL-76897 quiz: quiz_update_all_final_grades -> grade_calculator 2023-02-27 18:41:56 +00:00
Tim Hunt
4080962125 MDL-76897 quiz: quiz_update_all_attempt_sumgrades -> grade_calculator 2023-02-27 18:41:56 +00:00
Tim Hunt
1ee7f41762 MDL-76897 quiz: streamline initalisation of $quiz, $cm, $course 2023-02-27 18:41:55 +00:00
Tim Hunt
dbd62aa94d MDL-76897 quiz: move quiz_update_sumgrades into grade_calculator 2023-02-24 16:14:51 +00:00
Tim Hunt
086bbf3f89 MDL-76897 quiz: create new class for all the grade calculation code 2023-02-24 16:14:51 +00:00
Tim Hunt
3088bc6600 MDL-58945 qbank: showing q text should give option of plain or full 2023-02-22 11:15:02 +00:00
Tim Hunt
ec0a2dd85b MDL-76899 quiz: Fix PHPdocs issues 2023-01-18 12:14:37 +00:00
Tim Hunt
28f090d975 MDL-76899 quiz: fix whitespace around operators 2023-01-16 19:07:08 +00:00
Tim Hunt
2bb6c8b281 MDL-76899 quiz: bulk fix all array literals array() -> []
This was done with PHPStorm's automated tool. No manual editing
2023-01-16 17:12:45 +00:00
Tim Hunt
17e11dd9d5 MDL-76899 quiz: Bulk fix object -> stdClass in PHPdoc 2023-01-16 17:12:44 +00:00
Tim Hunt
6e7c63b36f MDL-76898 quiz: Move deprecated functions deprecatedlib.php
These were already deprecated, but in the wrong file.
2023-01-16 17:12:15 +00:00
Tim Hunt
03cf2ce782 MDL-76898 quiz: final deprecation of things deprecated long ago 2023-01-16 17:12:02 +00:00
Tim Hunt
58e4bc9a3e MDL-76614 quiz: clean up the quiz_settings class 2023-01-06 14:35:54 +00:00
Tim Hunt
a9f8547599 MDL-76614 quiz: rename quiz => mod_quiz\quiz_settings 2023-01-06 14:35:54 +00:00
Tim Hunt
5682c8c70e MDL-76614 quiz: move class quiz_attempt => mod_quiz\quiz_attempt
I thought about renaming the class to just plain attempt, but I
acutally think quiz_attempt makes it clearer what this is. Also
not changing the name massively reduces the pain for everyone
updating their code (including me right now!)
2023-01-06 14:35:51 +00:00
Tim Hunt
89f97a7e2a MDL-76614 quiz: code cleanup in mod_quiz\output\renderer 2023-01-06 14:35:50 +00:00
Tim Hunt
5ef8b6978e MDL-76614 quiz: mod_quiz_renderer => mod_quiz\output\renderer 2023-01-06 14:35:49 +00:00
Tim Hunt
f83181d397 MDL-76614 quiz: deprecate class moodle_quiz_exception
Code should just directly use moodle_execption.

Note, some of the existing uses (in web services) were passing a
literal message, not a language string identifier, but I decided
now was not the time to try to fix that.
2023-01-06 14:35:48 +00:00
Tim Hunt
91c913debc MDL-76614 quiz: move mod_quiz_preflight_check_form to classes & clean up 2023-01-06 14:35:47 +00:00
Tim Hunt
fed4a7fbd4 MDL-76614 quiz: move quiz_access_manager -> mod_quiz\access_manager 2023-01-06 14:35:47 +00:00
Tim Hunt
066b7f33d7 MDL-74923 quiz: move qubaids_for_quiz & ..._user to classes folder 2022-12-13 16:24:57 +00:00
Tim Hunt
cefbf74d02 MDL-74923 quiz: move mod_quiz_display_options to classes folder 2022-12-13 16:24:57 +00:00
Khoa Nguyen Dang
c093cb3263 MDL-75642 quiz: Delete multiple (random) questions from quiz 2022-10-07 11:00:32 +07:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Tim Hunt
839cccead4 MDL-74255 quiz: handle draft question status correctly
The main issue to fix is that questions vesions which should not have
been used (that is, hidden or draft versions) were getting offered
as an option and acutally being used.

As part of this I was able to substantially un-tangle
mod_quiz\question\bank\qbank_helper, which previously was
a mass of functions calling other functions in a complicated way.
Hopefully, it is now a bit easer to understand, and perhaps
less buggy.
2022-04-08 12:19:53 +01:00
Tim Hunt
5fff990e25 MDL-74255 quiz: clean up lots of stuff mainly in the tests
This fixes lots of stuff like outdated or incomplete PHPdoc comments
or test heler functions where the arguments don't have their types
declared.

A few more significant fixes, like places were a silly method
was used to get a context which was readily available.
2022-04-08 12:19:52 +01:00
Eloy Lafuente (stronk7)
1c2fd1cfb9 Merge branch 'MDL-74309' of https://github.com/timhunt/moodle 2022-03-27 16:47:08 +02:00
Tim Hunt
de8472df88 MDL-74309 quiz: removed obsolete code related to random tags 2022-03-25 09:53:46 +00:00
Marc-Alexandre Ghaly
c3ac868bf7 MDL-73763 core : Index fixes for reference tables
This commit will add the index for the question_reference
and the question_set_reference table if its not already
added. This commit will also implement the logic of adding
the question area and component in the joins of the question
reference table in order to make sure any other plugin using
the qbank api does not conflict with each other.
2022-03-24 18:04:47 +11:00
Tim Hunt
61f11f848d MDL-74007 quiz: questions should start as 'Always latest' version
Thanks to Safat Shahin <safatshahin@catalyst-au.net> for help with
the Behat scenarios.
2022-03-04 10:59:13 +00:00
Marc-Alexandre Ghaly
b1ad75aef5 MDL-71696 qbank_preview: previewquestion plugin update
This commit implements versioning and associated features
in the previewquestion plugin. There have been some major
changes in the random question and version selection for
questions. This commit made those changes as well as added
some more features in the preview for version selection
and adds more behat coverage.
2022-02-03 22:22:50 +11:00
Safat Shahin
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
Guillermo Gomez
c6cfca2a08 MDL-71696 core_question: Changes for versioning
This commit adds the changes in questiontype base
to work with new question tables and the new structure in the
databse. Also needed for versioning.
This implementation will also introduct the question status
which allows a question to be in draft and ready status.
I also introduces changes to the base view where it shows
the latest version of the questions. The view of versions
for a question is not implemented in this commit.
This implementation will also introduce changes in the core
qtype plugins to support versioning and the changed
db schema.
2022-02-03 22:22:44 +11:00
Tien Nguyen
e21a8577c6 MDL-73337 Quiz: Editing quizzes should be logged in detail 2022-01-27 22:49:54 +00:00
Thong Bui
46b88325ed MDL-52456 Quiz: notification message for students.
Notification message for students after questions have been manually graded.
2021-10-19 20:06:16 +07:00
Ilya Tregubov
b4675942ce Merge branch 'MDL-52206-master-rebased' of git://github.com/peterRd/moodle 2021-10-07 12:55:12 +07:00
Peter Dias
cd52b46e89 MDL-52206 quiz: Remove completionpass completion from quiz
AMOS BEGIN
 MOV [completionpass,mod_quiz],[completionpassgrade,core_completion]
 MOV [completionpassdesc,mod_quiz],[completionpassgrade_desc,core_completion]
 MOV [completionpass_help,mod_quiz],[completionpassgrade_help,core_completion]
AMOS END
2021-10-04 19:44:03 +08:00
Safat Shahin
f9fc355ec7 MDL-71679 mod_quiz: Updates for new qbank api
This implementation will introduct changes to
the mod_quiz to implement the new qbank api
for view. Major changes are introduced in
the custom view and also all the legacy points
to the old qbank are changed to qbank plugins
where needed. It also deprecated and deletes
classes and scripts which were kept not to
break mod_quiz for the new api implementation.
2021-10-04 15:44:25 +11:00
Tien Nguyen
dd6fd520e3 MDL-72137 Quiz: Quiz submission email notification update
Quiz submission notifications: separate out User versus System
2021-08-23 15:38:33 +07:00