231 Commits

Author SHA1 Message Date
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
03116995d5 MDL-76614 quiz: move quiz_review_nav_panel to classes 2023-01-06 14:35:51 +00:00
Tim Hunt
ccbb5da784 MDL-76614 quiz: move quiz_attempt_nav_panel to classes 2023-01-06 14:35:51 +00:00
Tim Hunt
74c6823bac MDL-76614 quiz: move quiz_nav_panel_base to classes folder 2023-01-06 14:35:50 +00:00
Tim Hunt
600b17db21 MDL-76614 quiz: move quiz_nav_section_heading to classes folder 2023-01-06 14:35:50 +00:00
Tim Hunt
6833a902df MDL-76614 quiz: move quiz_nav_question_button to classes folder 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
aceae3a4fa MDL-76614 quiz: move mod_quiz_links_to_other_attempts => classes\output 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
fed4a7fbd4 MDL-76614 quiz: move quiz_access_manager -> mod_quiz\access_manager 2023-01-06 14:35:47 +00:00
Mahmoud Kassaei
2074448b34 MDL-74609 Quiz: allow the displayed question numbers to be customised 2022-12-21 12:04:30 +00:00
Tim Hunt
cefbf74d02 MDL-74923 quiz: move mod_quiz_display_options to classes folder 2022-12-13 16:24:57 +00:00
Huong Nguyen
c55d8aca6a MDL-74996 Quiz: Unanswered question warning for submission confirmations
Including in this commit:
 - New method called get_number_of_unanswered_questions() for getting the unanswered questions
 - PHPUnit and Behat tests for the new dialogue
2022-11-07 09:40:06 +07:00
Khoa Nguyen Dang
c093cb3263 MDL-75642 quiz: Delete multiple (random) questions from quiz 2022-10-07 11:00:32 +07:00
Tim Hunt
dc3e9e1522 MDL-27570 quiz timing: add unit test and simplify top of process_attempt 2022-09-22 11:11:37 +01:00
Philipp Imhof
58f3d8f191 MDL-27570 quiz: check if time is really up 2022-09-21 09:52:37 +01:00
Laurent David
025e0297b6 MDL-75210 mod_quiz: fix sequential quiz access
* As a student I should only be able to access the next question or the current question
* The API should not show more than the current question
* Once the quiz is previewed we can see the question in any order (existing behaviour)
* Related to ticket MDL-71728

Co-authored-by: Rajneel Totaram <rjnlfj@yahoo.com>
Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2022-08-18 08:07:38 +04:00
Juan Leyva
a3201673be MDL-75048 mod_quiz: Use new way to check if subcats are included 2022-06-22 18:14:05 +02:00
Philipp Imhof
1c9c6c4139
MDL-74495 quiz override mark: do not hide_all_feedback 2022-05-27 08:47:25 +02:00
Jun Pataleta
60fcabfa6d MDL-73386 mod_quiz: Use plain text for quiz navigation fake block title
* No need to enclose the title of the quiz navigation fake block in
a span tag. The block title also gets appended to the skip link which
means that a block title with a span tag assigned with an identifier
can cause duplicate ID errors on the DOM.
2022-05-21 00:32:38 +08:00
Tim Hunt
7d3eaf892d MDL-74543 quiz attemptlib: covert string comparison to ===
Where obviously safe.
2022-05-03 13:45:39 +01:00
Tim Hunt
52b8962dbd MDL-74543 quiz: correctly record time when overdue attempt submitted 2022-05-03 13:41:45 +01:00
Tim Hunt
a43f56836a MDL-74255 quiz: fix redo and regrade question version handling 2022-04-08 12:19:53 +01:00
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
37e8faf0ed MDL-74255 quiz: Remove un-needed method question_array_sort 2022-04-08 12:19:52 +01:00
Odei Alba
9446af726d MDL-74329 mod_quiz: scroll to top and to question container
When reviewing the answers:
1- When there are all the questions in one page and you click in the first question,
it will scroll to the first question.
2- When there is one question per page and you click in the question number,
it will go to that question page and scroll to the top.
If you click again the question number, it will scroll to the question container.
2022-04-07 12:49:42 +02:00
Sujith Haridasan
3458d159e1 MDL-73335 mod_quiz: Add tertiary nav for the quiz module
The tertiary navigation added for quiz module.

- Added tertiary nav buttons for the edit, attempt and view page
- urlselector is added to the overrides page to access user/groups
- The secondary tabs are highlighted when user navigates to
  each page in quiz.
- Updated the behat tests for the changes made.

This commit is mostly Sujith's work, with further changes by
Tim Hunt <T.J.Hunt@open.ac.uk> so we share the blame/credit.
2022-02-24 09:26:00 +02:00
Safat Shahin
3008edd366 MDL-71696 core_question: Implement question status change
This commit implements the status change pop up for a question
in the base view. This feature update will allow the change of
status of a question without creating a new version.
This commit also implements the status as a char rather than
an int value.
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
Ilya Tregubov
282c4a124a Merge branch 'MDL-52456-master' of https://github.com/NashTechOpenUniversity/moodle 2021-10-20 11:33:14 +02: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
Andrew Nicols
da98ed6ea2 Merge branch 'MDL-71785_master' of https://github.com/StudiUM/moodle 2021-10-19 11:19:06 +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
Marie-Eve Lévesque
689c9961e5 MDL-71785 core_quiz: Empty quiz section name behaves like new page 2021-09-14 15:22:48 -04: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
Tien Nguyen
ac59c8b8e0 MDL-71984 Quiz: Add new attempt's events
Add attempt_updated, attempt_autosaved and attempt_question_restarted
events.
Update attempt_viewed to add page number.
2021-07-08 15:13:06 +07:00
Thong Bui
a8c868822f MDL-71030 Quiz: Add 'who' made changes in question response history 2021-04-20 09:06:15 +07:00
Tim Hunt
fc9d2e0843 MDL-54907 quiz: better timefinish for attempts finished asynchronously
There are serveral ways a quiz attempt can be submitted:

1. The student click the Submit and finish button. In this case,
   no problem. We record the current time as the finish time
   for the quiz attempt.

2. The student is activly working away at the quiz, and the
   count-down timer reachers zero. In this case, we also record
   the current time. Note that, if the server is under high load,
   then this could well end up being a few seconds after the
   theoretical end time, so you could have a quiz with a 30 minute
   time limit, with an attempt that lasted 30:07. However, this
   is just an accurate reflection of what happened, so should
   be recorded like this.

3. If the student is offline when the time expires, then
   (depending on the quiz settings) the attempt may be
   automatically submitted by cron, but this will happen with
   at least some delay (to prevent race conditions between cron
   and a student working online) and if cron is running slow
   on the server, it could be a lot later. Previously, this led
   to, say, a 30 minute quiz where an attempt seemed to have
   lasted 67 minutes, which confused people.

   Now, in this situation, the finsh time for the quiz attempt is
   recorded as the time when the time limit ran out. This is not
   just less confusing for teachers looking at the quiz report,
   it is also more accurate. That is the latest time at which
   students could have made any changes to their responses.
2020-11-27 17:51:55 +00:00
Bas Brands
d910726704 MDL-66587 mod_quiz: visible quiz timer 2020-09-16 15:21:27 +02:00
Bas Brands
91de0ed823 MDL-67874 theme_boost: make focus outline accessible 2020-05-26 09:54:12 +02:00
Andrew Nicols
4e9641c2d1 Merge branch 'MDL-57240' of https://github.com/timhunt/moodle 2020-05-22 11:37:38 +08:00
Tim Hunt
64207dab65 MDL-67183 questions: get_question & get_behaviour only init if required
This reviews all the code code, and sets $requirequestioninitialised
whenever possible in these calls, which should improve performance.
2020-05-19 20:52:07 +01:00
Tim Hunt
07d90238c6 MDL-57240 quiz: don't show useless links on overdue attempt summary page 2020-04-22 21:38:19 +01:00
Eloy Lafuente (stronk7)
986c5283cf Merge branch 'MDL-67832' of https://github.com/timhunt/moodle
(fixed a couple of typos in the merge commit)
2020-02-06 00:01:07 +01:00
Tim Hunt
1aacbb72d3 MDL-67832 quiz: fix lots of PHPdoc in attemptlib.php 2020-01-31 19:09:03 +00:00
Tim Hunt
a33e0b4d84 MDL-67830 quiz: notice in grade details redirect script 2020-01-29 18:34:39 +00:00
Tim Hunt
b04b6ae1ab MDL-66764 quiz: redo question should not repeat random questions
Before this fix, it was only considering questions seen in previous attempts.

It should avoid the questions in the current attmept too.
2019-09-25 11:04:38 +01:00
Shamim Rezaie
5641b98133 MDL-35939 mod_quiz: phpdoc fix 2019-08-15 12:07:38 +10:00