43 Commits

Author SHA1 Message Date
Tien Nguyen
5863659d79 MDL-69164 Question: Convert question/qengine.js to AMD modules 2023-01-18 11:24:38 +07: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
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
dinhloc
f4695ec722 MDL-61033 quiz: Editing a quiz while a preview is open
Editing a quiz while a preview is open in another browser tab can leads to a cryptic error that is hard to recover from
2018-03-27 10:47:32 +07:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Juan Leyva
4911b5b254 MDL-52863 mod_quiz: Move processattempt.php code to new API 2016-03-17 16:49:39 +01:00
Tim Hunt
c67ab86fa9 MDL-52738 quiz: Previous button during attempt review.
This is to be consistent with places like forum and book, where if we
have a next link, we also have a previous link.

At the same time I have amended the links/buttons from 'Previous'/'Next'
to 'Previous page'/'Next page' because I think that is clearer.

Also, on the last page of the quiz, I have changed 'Next' to 'Finish
attempt ...' for consistency with the link in the navigation block.

AMOS BEGIN
 CPY [navigatenext,mod_assignment],[navigatenext,mod_quiz]
 CPY [navigateprevious,mod_assignment],[navigateprevious,mod_quiz]
AMOS END
2016-01-15 14:25:25 +00:00
Tim Hunt
5e63b335fe MDL-40992 quiz: option to let students redo questions within an attempt
This feature is designed for use on pracice or formative quizzes.
It is available for quizzes that use Interactive or Immediate feedback
behaviour.

If the teacher turns this on in the quiz settings, then once a student
has finished a question, they get a 'Redo question' button beside the
question. If they click it, then the question they finished is replaced
by a new one so they can try again to practise that particul skill or
bit of knowledge a bit more.

When randomisation is involved, the studnets will be given a question or
variant that they have not seen before if possible.
2015-03-31 14:12:48 +01:00
M Kassaei
1700bd4dea MDL-40992 quiz: let students to redo questions within an attempt 2015-03-26 17:46:47 +00:00
Mark Nelson
68758eff12 MDL-40063 mod_quiz: removed 'close attempt' add_to_log call 2014-04-10 20:40:27 -07:00
Sam Hemelryk
01773a6d00 MDL-44180 mod_quiz: unified @package use 2014-03-03 08:37:06 +13:00
Matt Petro
8e771aed93 MDL-35717 quiz: fix overdue attempt processing 2012-11-16 21:32:09 -05:00
Dan Poltawski
a8b8f472bd MDL-34599 mod_quiz: optional $thispage & $nextpage
The previous change making the params required was a regression.
2012-08-01 09:05:32 +08:00
Tim Hunt
ff2ec2cb95 MDL-34599 quiz attempts: more robust if page number out of range.
Rather than throwing an exception, we should just show the first/last
page of the quiz if the page number is out-of-range.
2012-07-27 11:42:03 +01:00
Dan Poltawski
e13388c1c0 MDL-32783 quiz overdue handling: improve lang string
And remove a stray #
2012-06-08 10:47:31 +08:00
Tim Hunt
a6866c7e9f MDL-32783 quiz overdue handling: enforce end of grace period
The summary page was not enforcing the end of the grace period. If the
user had the summary page open, then they coudl still stubmit after the
end of the grace period.

Also, the editing form was not validating that the quiz grace period was
greater than quiz|graceperiodmin in the quiz configuration, and that
should be checked, so I added it.

I fear that processattempt.php is becoming very spaghetti-like with all
the timing rules, it really needs to be refactored, but not 2 weeks
before the 2.3 release. (When refactoring, we really need unit tests for
this.)
2012-06-07 19:17:07 +01:00
Tim Hunt
9e83f3d11d MDL-32788 quiz: clean up codechecker issues before the 2.3 release. 2012-05-04 15:12:23 +01:00
Tim Hunt
3e77b60f36 MDL-3030 quiz overdue handling: ignore responses received much too late. 2012-04-27 15:07:38 +01:00
Tim Hunt
34b7d8383d MDL-3030 quiz overdue handling: trigger automatic state transitions.
Here, we catch all the places where a student might be accessing their
own attempts, and make sure any automatic state transitions that
should happen, do happen, before the student sees the attempt.

The places where we need to check this are view.php, startattempt.php
and processattempt.php.

We do not really need to check attempt.php or summary.php, because if
the student is on one of those pages, the JavaScript timer will
auto-submit when time expires, taking them to processattempt.php,
which will do the acutal work.

We intentionally do not trigger state transition when a teacher is
looking at a student's quiz attemp. We will trigger state transitions
on cron, but that is still to do.

Also, the body of the process_... methods still needs to be written.
2012-04-27 15:07:35 +01:00
Tim Hunt
bed495578f MDL-29854 questions: display better message and more useful continue
when an error occurs in the middle of processing responeses.
2011-10-25 14:49:57 +01:00
Tim Hunt
45e5fbe11e MDL-28976 quiz was passing 0 to ->attempt_url when it should have been null.
There was also one other incorrect call that is fixed in this commit.
2011-08-18 14:00:30 +01:00
Tim Hunt
cbb8b55c33 MDL-28166 send quiz event notifications asynchronously.
This avoids the problem that you cannot send messages in transactions.

It also means that the quiz submission will not be prevented, and the
message will still be sent eventually, if any part of the messaging
system is giving intermittent errors when the student wants to submit
their quiz.
2011-07-06 14:16:30 +01:00
Tim Hunt
25a03faaca MDL-20636 fix many code-checker issues in mod/quiz. 2011-05-12 00:30:25 +01:00
Tim Hunt
55ca80edde MDL-20636 Fix lots of problems found by the new improved codechecker. 2011-04-04 20:11:29 +01:00
Tim Hunt
404da23812 MDL-20636 Fix question flag javascript. 2011-02-25 15:36:07 +00:00
Tim Hunt
ba6438471b MDL-20636 Fix top of file boilerplate in mod/quiz. 2011-02-21 16:13:25 +00:00
Tim Hunt
56e82d993d MDL-20636 Images in questions now work in quiz attempts. 2011-02-09 20:33:51 +00:00
Tim Hunt
8f37f7fb7a MDL-20636 It is now possible to submit a page of the quiz, and view the summary page. 2011-02-09 20:18:18 +00:00
Petr Skoda
39790bd805 MDL-24321 switching to stdClass in /mod/ 2010-09-21 08:37:36 +00:00
Petr Skoda
eab8ed9fb7 fixed a few spelling errors in /admin/ 2010-09-17 10:27:26 +00:00
Martin Dougiamas
204f394e27 Converted some quiz events to use frankenstyle component names (spit) 2010-07-08 04:07:23 +00:00
Dan Marsden
9df209c122 Quiz Events MDL-22539 add events to start and process attempts 2010-05-20 23:01:22 +00:00
Tim Hunt
990650f94c quiz: MDL-16478 Allow different open/close dates, etc. for individual students or groups.
This was implemented by Matt Petro of the University of Wisconsin - Madison Engineering
School and Math Department. Many thanks. Reviewed by and committed by Tim Hunt.

This adds a new Overrides tab to the UI, with sub-tabs Group overrides and User overrides.
Each of those lists all the overrides that currently exist, and lets you manage them and
create more.

When a quiz is being attempted, the override that applies to the current user is combined
with the current quiz settings loaded from the quiz table (normally called $quiz).
If there are both user and group overrides, then just the specific user override is used (more specific).
If the user is in several groups, then the overrides are combined to give the most permissive set of options.

There is one new database table quiz_overrides, to store the overrides.
2010-03-08 16:01:38 +00:00
Petr Skoda
8319260833 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-04 11:58:30 +00:00
Tim Hunt
82165a0cf0 quiz: MDL-20706 prevent XSRF.
Uses new require_sesskey function from MDL-20702.
2009-11-02 17:10:31 +00:00
tjhunt
d18675a8d7 quiz: MDL-19891 fix that quiz navigation block that was broken by the blocks changes.
Sadly it now requries JavaScript again, at least for best operation.
2009-07-23 09:20:33 +00:00
skodak
a8c31db2a3 MDL-18293 removed obsoleted checking of return values from insert and update_record + unused strings cleanup 2009-06-13 17:47:18 +00:00
tjhunt
8f95b06aab MDL-16263 Flagging questions during a quiz attempt. Submit all and finish was nuking flag states. Fix that. 2008-09-03 09:37:20 +00:00
tjhunt
954b73ae0d Clean up whitespace. 2008-09-03 07:10:00 +00:00
tjhunt
af707a64b7 MDL-15542 - followup bug fixes thanks to sam. 2008-07-28 14:41:15 +00:00
tjhunt
5bbf20b48d Error with submitting quizzes - regression caused by MDL-15542. 2008-07-22 11:01:56 +00:00
tjhunt
5c98fcd402 Error with submitting quizzes - regression caused by MDL-15542. 2008-07-22 09:03:51 +00:00
tjhunt
9f9eec1ef0 MDL-15542 - Refactor quiz response processing into a separate processresponses.php. 2008-07-15 16:46:24 +00:00