29 Commits

Author SHA1 Message Date
Tim Hunt
d755b0f577 MDL-29627 quiz_access_manager move all output code to the renderer.
This achieves a massive clean-up. It simplifies comples code in a number
of places. It allows some methods and functions to be moved to a more
appropriate home (for example cannot_review_message to the quiz class).
It moves more logic out of the renderer.
2011-10-13 11:13:12 +01:00
Tim Hunt
ea38245cfb MDL-29627 quiz access: move the unit tests into the relevant plugins. 2011-10-13 11:13:04 +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
a056778d8a MDL-20636 Fix unit test that the recent code change broke. #382 2011-04-08 17:46:15 +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
c7df5006b9 MDL-20636 Add lots of missing public/protected/private. 2011-03-23 16:22:25 +00:00
Tim Hunt
f7970e3ca7 MDL-20636 Eliminate integer and boolean in PHPdoc comments. should be int and bool. 2011-02-23 16:25:25 +00:00
Tim Hunt
a17b297d60 MDL-20636 Add missing defined('MOODLE_INTERNAL') || die(); 2011-02-23 16:00:20 +00:00
Tim Hunt
0ff4bd0877 MDL-20636 Fix new stdClass -> stdClass(), and trailing whitespace. 2011-02-21 18:10:19 +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
b04a4319d6 MDL-20636 Remove © from all PHPdoc comments, and tidy them up a bit. 2011-02-21 14:51:02 +00:00
Tim Hunt
167f1562f8 MDL-20636 Merge and fix quiz unit tests. 2011-02-09 20:18:21 +00:00
Tim Hunt
207d145dda quiz delays MDL-20956 don't let overdue attempts + delays block students.
Suppose a quiz has a 60 min time limit, and an enforced delay of 60 mins between attempts.

Suppose a sudent starts an attempt, and then closes their browser, and then comes back 2 hours later. When they try to restart the quiz, it is submitted immediately by the timer.

Now they are blocked out for the next hour.

After this change, they would no longer be blocked, becuse if their attemtp had been submitted at the end of the first hour, then they would already have waited an hour.

That is, we compare the current time with both $lastattempt->timefinish + $delay and $lastattempt->timestart + $timelimit + $delay.
2010-08-06 11:41:50 +00:00
Martin Dougiamas
765a1d4ba8 MDL-19628 getremoteaddr() now normally returns 0.0.0.0, which is good for logs and so on. It can be made to return null when that is required, by a new parameter. 2010-05-20 02:36:20 +00:00
Tim Hunt
78634f1e06 quiz editing: MDL-17284 Add question here garbled layout when adding to an empty quiz.
That then lead to an incorrect display of the number of questions in the quiz.
2010-05-01 08:11:25 +00:00
Petr Skoda
aeb15530b8 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-04 11:57:52 +00:00
stronk7
ce40c8ff2b MDL-19579 code coverage - add more initial $includecoverage attributes 2009-06-26 18:12:05 +00:00
tjhunt
2f2ade1609 quiz unit tests: remove dubious and failing test. 2009-04-24 10:00:09 +00:00
tjhunt
84e628a027 quiz settings: MDL-18485 Improve quiz settings form
* Reorder form fields to group things more logically.
** and on the corresponding admin page too.

* Set some options to be 'Advanced' by default:
** Apply penalties.
** Each attempt builds on the last.
** Decimal places for question grades.
** The five 'Extra restrictions on attempts' settings. (password, etc.)
* Admins can still change this to suit their institiution at Administration > Plugins > Activity modules > Quiz.
* These new defaults are applied if the admin had not previously set any fields to be advanced.

* Disable some filds when they are not applicable:
** Grading method, if num attempts = 1
** Penaly scheme, if adaptive mode = no
** Each attempt builds of last, if num attempts = 1
** Review after quiz closed options, if no close date.
** Delay between 1st and 2nd attempts, if num attempts = 1
** Delay between later attempts, if num attempts < 3

* Convert quiz.timelimit to be in seconds, for consistency, and ready for the new duration field type (MDL 18500).
** Including ensuring that backup and restore is backwards compatible.

* MDL-5537 New setting, questiondecimalpoints, so, for example, you can show the quiz grade as an integer, but have fractional question grades.
** There is a 'Same as overall decimal points' option, which is the default.

* Improve some field labels.

* Make corresponding changes in the help files.
2009-03-10 08:39:51 +00:00
tjhunt
4299df1daf quiz editing: Refactor the editing actions to make functions in editlib.php for most of them.
In the process, do MDL-17456, move/delete questions by question id rather than position, for greater robustness.
2009-02-27 08:45:05 +00:00
tjhunt
1fd211a770 quiz: Fix unit tests. 2009-02-27 08:43:28 +00:00
skodak
58fa5d6f75 MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
tjhunt
edd5246bdd quiz editing: MDL-17416 Clean layout when starting a new attempt. 2009-01-07 09:26:47 +00:00
tjhunt
1332ce5397 quiz unittests: MDL-17295 start writing unit tests for some of mod/quiz/locallib.php - and fix the bugs they revealed! 2008-11-23 12:46:51 +00:00
tjhunt
1499ce3185 unit test reliability: For some reason this does not work on my laptop. because the standard function getrempteadr returns '', so just skip this test. 2008-11-23 11:53:21 +00:00
tjhunt
739b07112e MDL-16625 Detection of whether a quiz has grades was broken in HEAD.
1. Fix this by factoring out a quiz_has_grades function.
2. Fix the quiz unit tests.
3. Fix quiz_has_feedback to return false for ungraded quizzes.
4. Fix use of get_records to do record_exists in quiz reports.
2008-09-23 07:18:15 +00:00
nicolasconnault
b9c639d6c2 MDL-16483 Refactored install/upgrade code into lib/adminlib. Created an intermediate MoodleUnitTestCase class that overrides simpletest's constructor, destructor and setup/teardown methods. All moodle unit tests must extend this class. 2008-09-16 12:19:43 +00:00
tjhunt
c52c62d1b1 MDL-13806 - Refactor all the code that implements the rules for whether students can attempt the quiz now into some classes.
Resource page now done as well. That should be everything.
2008-03-07 12:33:07 +00:00
tjhunt
05866d85d4 MDL-13806 - Refactor all the code that implements the rules for whether students can attempt the quiz now into some classes.
Here are unit tests for all the access rule classes, and the associated bug fixes.
2008-03-06 15:11:50 +00:00