177 Commits

Author SHA1 Message Date
Simey Lameze
9b1fc262d8 MDL-63185 mod_quiz: make CiBoT happy again
Part of MDL-62610
2018-09-28 11:07:21 +08:00
Simey Lameze
5c0654d7ff MDL-63185 mod_quiz: change APIs to handle attempts on behat
Thanks to Tim Hunt for all the help.

Part of MDL-62610
2018-09-28 11:07:21 +08:00
Shamim Rezaie
66aa172cbb MDL-61614 Quiz: Maintain slot tags when editing random questions 2018-04-18 13:07:08 +10: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
Shamim Rezaie
f3f21c995c MDL-61380 Quiz: Re-attempting the same "random" question by tag
Some question behaviours allow the same question to be re-attempted several times during a quiz attempt.
This commit takes care of the case where a "random" question is re-attempted during a quiz attempt.
2018-03-07 05:43:44 +11:00
Shamim Rezaie
2a1c9daccd MDL-61380 Quiz: build attempt from "random" questions by tag 2018-03-07 05:43:38 +11:00
Shamim Rezaie
82c67ac7f0 MDL-61380 Quiz: Fix url generation in notenoughrandomquestions exception 2018-03-07 05:33:11 +11:00
Tim Hunt
ff456b59ea MDL-60162 quiz reports: too many rows fetched on download
This happened if one user had multiple enrolments in a course, and was
quite inefficient.
2017-10-24 18:06:44 +01:00
Neill Magill
078484f2e2 MDL-60300 Quiz: Offline update time not set correctly 2017-10-06 13:43:42 +01:00
Juan Leyva
8a972ab377 MDL-53870 mod_quiz: New settings for quiz attempts in the mobile app 2016-09-28 09:25:18 +01:00
Andrew Nicols
df89940e5d MDL-53858 quiz accessibility: Correct aria-labelledby attribute 2016-04-29 12:17:57 +01:00
Tim Hunt
5b444ee987 MDL-53858 quiz accessibility: nav block should have role='navigation' 2016-04-18 17:37:03 +01:00
Juan Leyva
b6c538416b MDL-52767 mod_quiz: New API for retrieving the question types 2016-03-23 00:56:05 +01:00
Juan Leyva
3e5c19a0ed MDL-52888 mod_quiz: New Web Service mod_quiz_view_attempt_review 2016-03-18 09:50:06 +01:00
Juan Leyva
d9ef6ae0c2 MDL-52888 mod_quiz: New Web Service mod_quiz_view_attempt_summary 2016-03-18 09:49:29 +01:00
Juan Leyva
899983ee58 MDL-52888 mod_quiz: New Web Service mod_quiz_view_attempt 2016-03-18 09:27:43 +01:00
Juan Leyva
4911b5b254 MDL-52863 mod_quiz: Move processattempt.php code to new API 2016-03-17 16:49:39 +01:00
Juan Leyva
1d57e4fea5 MDL-52813 mod_quiz: New method for getting the type of a question 2016-03-11 10:28:17 +01:00
Tim Hunt
293f5d1b11 MDL-53065 quiz redo question: avoid PHP notice in edge case
When selecting the variant of the new question, we need to add the
new question to the usage before trying to select a variant.

Also, we need to acutally use the selected variant number!
2016-02-19 12:10:39 +00:00
Tim Hunt
1f0f413187 MDL-46091 quiz start attempt: rationalise confirmations.
1. Don't show a warning if there are a limited number of attempts, only
   if there is a time limit.
2. Merge that time-limit warning into the same form that is used for
   entering a password, etc.
3. Make that form an JavaScript dialogue when you click the start attempt
   button.

AMOS BEGIN
  MOV ['confirmstarttimelimit', 'mod_quiz'], ['confirmstart', 'quizaccess_timelimit']
AMOS END
2016-01-18 22:12:41 +00:00
Dan Poltawski
8440c780bd MDL-52471 quiz: remove broken code question_print_comment_fields() 2015-12-10 15:47:11 +00:00
Tim Hunt
857e2a6f8c MDL-50996 quiz: fix review error with unusual permissions 2015-08-24 09:53:52 +01:00
Tim Hunt
377ce9938b MDL-49814 quiz: make question dependency clear in the nav 2015-04-27 13:55:40 +01:00
M Kassaei
5d949702f8 MDL-40988 quiz: ability to break quizzes into sections
The sections are created on the edit quiz page, and then appear in the
navigation panel when the quiz is being attempted to help students find
their way around.

The 'Shuffle questions' setting has been moved from being per-quiz
to being a per-section.

This commit is actually the joint work of Mahmoud Kassaei and Tim Hunt
from The Open University. We could only use one persons name for the
commit and this time Mahmoud gets the credit/blame.
2015-04-05 14:30:53 +01: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
Tim Hunt
441d284ada MDL-40990 quiz: option to require prev Q finished before next shown
Further improvements to this code, including resolving edge cases:

* The new feature can only be used when it is possible for the
previous question in the quiz to be complete.

* Also, this new feature cannot be used in combination with shuffle
questions, because that make no sense; nor in combination with
sequential navigation, because to make that work properly would be a lot
of effort. If someone needs that to work later, it should be possible
for them to implement it.

* There were changes in the edit renderer API, to try to make things
more  consistent, and to make it less likely we will need to change
things again in the future. See mod/quiz/upgrade.txt.

* As part of this change, the styling of the Edit quiz page was tweaked
to make slighly more efficient use of the horizontal space, and to be
more symmetrical.
2015-03-17 17:16:22 +00:00
M Kassaei
f7785e42b3 MDL-40990 quiz: option to require prev Q finished before next shown 2015-03-17 17:10:13 +00:00
Tim Hunt
2e4e8d16c7 MDL-48829 quiz nav: add a data attr to buttons giving the page
This way, if you need to know which page each button goes to in
JavaScript, you can find out.
2015-01-15 10:20:55 +00:00
Tim Hunt
1c2e05c060 MDL-47691 quiz: only warn re overdue attempts if a Q has been answered
If a quiz is set to have a grace period when time has expired, we only
email studnets to warn them about their overdue attempt if they have put
in an answer to at least one question that is worth some marks.
2014-10-20 12:11:10 +01:00
Colin Chambers
e1a2d0d92d MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.

The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.

Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)

The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)

Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.

As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2014-10-02 17:22:23 +01:00
Tim Hunt
097dbfe11a MDL-46093 quiz review should default to showing everything on one page
... as long as the quiz is not too big. At the moment, that limit is
set to 50 questions.
2014-06-27 17:14:51 +01:00
Tim Hunt
6a981b45c3 MDL-31262 fix quiz review capability check.
This change is logically the same as changing
    $this->has_capability('mod/quiz:viewreports')
to
    $this->has_capability('mod/quiz:viewreports') || $this->has_capability('mod/quiz:preview')
in the original code. However, I rewrote the logic so that we test the
most common and performance-critical case first - that of a student
lookign at their own attempt.
2014-03-28 18:37:21 +00:00
Tim Hunt
ccba5b8805 MDL-43749 normalise quiz database structure.
The sequence of questions that made up a quiz used to be stored as a
comma-separated list in quiz.questions. Now the same information is
stored in the rows in the quiz_slots table. This is not just 'better' in
a database design sense, but it allows for the future changes we will
need as we enhance the quiz in the MDL-40987 epic.

Having changed the database structure, all the rest of the code needs to
be changed to account for it, and that is done here.

Note that there are not many unit tests for the changed bit. That is
because as part of MDL-40987 we will be changing the code further, and
we will add unit tests then.
2014-03-02 10:00:40 +01:00
Rajesh Taneja
fdc729ea57 MDL-43736 Events: event->contextinstanceid should be used where possible
While restoring event context might not be present (deleted)
So before using context api's check context or use event properties
2014-01-29 11:39:44 +08:00
Tim Hunt
dc4a3ea1ee MDL-43670 quiz_question_instances to match coding guidelines.
Some columns needed to be renamed:
* quiz     -> quizid
* question -> questionid
* grade    -> maxmark

Then all the places that refer to those needed to be fixed.
2014-01-17 10:56:07 +00:00
M Kassaei
0328341f97 MDL-42181 quiz nav: highight all buttons when all Qs on one page 2013-11-15 15:30:31 +00:00
Tim Hunt
e74aa0aa97 MDL-32188 question CBM: compute summary stats for CBM behaviours
We now compute the average CBM score, accuracy, CBM bonus and enhanced
accuracy, both for the entire quiz, and for just the questions answered.

Note that these calculations must work correctly in the presence of
descriptions, ungraded questions, and manually graded questions. For
example, imagine a essay added at the end of the quiz "Summarise what
you learned attempting this exercise." This might have max mark zero or
non-zero. The CBM statistics just ignores questions like that.
2013-10-04 17:56:36 +01:00
Tim Hunt
474aa125ca MDL-32188 quiz/question: behaviours can add to the review summary.
At the top of the quiz reivew page, there is a table that summarises
infomration about the quiz attempt as a whole. For some question
behaviours, we would like to be able to add additional information to
that summary.

This commit introduces a generic method for the behaviour to provide
summary information about an entire question usage.
2013-10-04 17:52:16 +01:00
Frederic Massart
0a8b091d41 MDL-41039 mod_quiz: Renaming event to attempt_becameoverdue 2013-09-26 16:43:20 +08:00
Frederic Massart
d900f1dc05 MDL-41039 mod_quiz: Replace events_trigger to new events 2013-09-26 16:43:03 +08:00
Damyon Wiese
74df2951d1 Revert "MDL-39876 Change get_record('course') calls to get_course"
This reverts commit ab7632b74c331540c90229bf03d13aa2e6bdd9be.
2013-08-21 13:42:30 +08:00
sam marshall
ab7632b74c MDL-39876 Change get_record('course') calls to get_course 2013-08-15 11:31:20 +01:00
Jamie Pratt
388f047345 MDL-40543 convert from simulated responses
to post data
2013-07-23 15:00:02 +08:00
Jamie Pratt
1cd7c92ece MDL-40074 refactoring of quiz code
to reuse code fro quiz attempt walk through
2013-07-14 16:28:39 +07:00
Jayesh Anandani
1ecd3c304d MDL-39155 Quiz: Provide 3 image-size options on the settings page 2013-05-10 08:38:13 +05:30
Tim Hunt
595708884a MDL-38538 quiz auto-save front end.
1. There is a new admin setting to control whether this feature is
enabled. The admin can set the auto-save frequency to 1, 2 or 5 minutes,
or disable it.

2. When autosave is enabled, there is code in the quiz that monitors the
main quiz form, and does an ajax save call at the given frequency when
changes are being made by the student.

3. The ajax saves go to a new script that calls the question engine to
do the work.

4. To avoid simultaneous autosave + submit and finish, the auto-save
system shuts down shortly before time expires in a timed quiz.
2013-03-28 16:57:24 +00:00
Tim Hunt
2515be0e80 MDL-38647 quiz review question issues
1. Page URL should contain 'step=0' if necessary, but not 'step='.
2. Review specific step was not using the right display options.
2013-03-22 11:16:02 +00:00
Matt Petro
8e771aed93 MDL-35717 quiz: fix overdue attempt processing 2012-11-16 21:32:09 -05:00
Tim Hunt
32953f37b6 MDL-34399 quiz cleanup: remove ugly question/page number hack
It used to be necessary to store the question number and question page
by adding them as random extra fields on the question object (but
I can no longer remember what that reason was). Now it is possible
to store this sensibly in the quiz_attempt object, which is much
cleaner, so do that.
2012-10-26 11:58:25 +08:00