98 Commits

Author SHA1 Message Date
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
Damyon Wiese
65c52e05d1 MDL-58699 mod_quiz: Require javascript for popup
If any of the access rules require the attempt to open in a new window, assume we
require javascript to attempt the quiz. This makes it harder to bypass the javascript
pseudo security restrictions.
2017-11-07 12:48:21 +08:00
Damyon Wiese
663640f5b3 MDL-40759 icons: convert uses of pix_url to pix_icon
Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
2017-03-17 15:52:17 +08:00
Damyon Wiese
12d6dfc1ce MDL-56826 questions: Add styling for boost theme
Changes include:
* question: Add bootstrap classes to buttons and selects so they look consistent.

* mod_quiz: Add bootstrap styles to report form elements

* question: Add bootstrap classes to question form elements

* And remove the success/fail styles from boost because they conflict badly
with the quiz plugin styles (making unreadable text).

* quiz: nav block buttons had black background

* quiz: Add bootstrap styles to quiz navigation buttons

* qtype_ddmarker: Remove bullets from list

Edit form coordinates preview had list bullets for each coordinate.

* boost: Prevent menu scrolling on quiz edit

* mod_quiz: Add bootstrap styles to edit quiz fields

Pagination and max grades forms.

* quiz: Undo some custom styles on review options

These checkboxes were laid out in a fake grid with no responsiveness
that conflicts with the bootstrap form-inline templates. Reset the
custom style to bootstrap default.

* quiz: Fix unit tests for boost changes

* qtype_ddwtos: Accurate positioning of drop targets

* questions: Make the review page responsive

* question: bootstrap 4 compatibility

.alert in bs4 contains no colours by default, you need to mix it with
one of the context classes to get some change in colours, borders etc.
2016-11-17 14:20:52 +08:00
John Beedell
7983265241 MDL-55930 Quiz: "Next page button" showing in sequential mode 2016-11-01 11:22:39 +00:00
Damyon Wiese
63e4df60f6 MDL-55839 behat: Behat fixes for theme_noname
This is a squash of many small fixes.
The list of changes are:

Initial set of behat selectors overrides required for new theme.

set core behat selectors if not overridden by theme

Remove pause

Fix for checkboxes not saving properly

Custom override for click in the user menu

Fix for behat guessing the field type.

Behat fix for guessing the correct field type.

Fix for missing closeElementBefore mforms mess.

Fix for textareas not displaying their contents.

Fix availability form element

Fix action menu selectors for activities in a course page

Fix textareas not retaining their values

Fix selector for blocks

I had to change the single select template to use an input instead of a button because of a
behat bug we have not tracked down yet.

Fix for frozen attribute in form elements

Use input instead of button while behat is still broken

Fix for navigation selector override

Behat selector fixes and multi-select fixes for templated select

Fix for configure blocks selector + booleans for autocomplete

Fixes for course_summary behat tests

Allow optgroups in single_select

Behat fixes for block_navigation

Fixes for url form element and activity chooser selectors

blocks_social - fix specific selector for behat

Fix export_for_template for selectgroups element.

Dont set empty id on the form

Fix direct call to behat_navigation in backup context

Checkbox empty value fix

Fix for assign grading panel popouts

file picker overrides to find a file manager in the page

Fix chat tests to use element name

Make selectors in mod_data behat less specific

MDL-55839: recent activity behat test relies on time()

SQUASH Honour mform element "class" attribute on the container

SQUASH Fixes for behat in mod_forum

SQUASH search form template showing value as text next to the button

SQUASH undo double selectgroup fix

SQUASH - The slightly different structure to action menus breaks course drag and drop

SQUASH Wrap loading icon in a span so the selector still works.

SQUASH Fix fragile javascript in report_loglive

SQUASH Fix tabtree, and selectgroups for mod_feedback

Also - do-not enhance the action menu - we are dropping support for this.

SQUASH Fix filemanager selector and pix_icon template for mod_forum tests.

SQUASH Fixes to breadcrumb and add formid to single select (fixes mod_glossary tests)

SQUASH lesson behat fixes. 95% of lesson styles were rubbish so they were disgarded.

SQUASH Fix lti behat tests - they were cheating and using a context step from quiz

SQUASH Behat fixes for quiz with new theme

SQUASH behat fixes for mod_wiki

SQUASH Workshop behat fixes

SQUASH Frozen form elements cannot use a readonly form element because it screws with the form JS "disabledIf" stuff.

SQUASH Fixes for grades behat tests

SQUASH behat fixes for groups

SQUASH blacklist action menu tests

SQUASH Fix for tag form element missing "manage standard tags" link

SQUASH Incomplete fixes for course behat tests

SQUASH behat fixes for badges

SQUASH Tags fixes for behat

SQUASH filepicker fixes for behat

SQUASH Abort guessing field type when we hit 'html'

SQUASH Fix for admin/tool/behat tests

SQUASH fix for admin tool behat tests

SQUASH fix for availabilty conditions hiding "aria-hidden" elements

SQUASH give the blocks more room. We get behat files because nav tree nodes are not in view

SQUASH Blocks fixed

Fix behaviour of unchecked checkboxes

SQUASH Remove incorrect step in user test

SQUASH behat fixes for course tests

Part of MDL-55071
2016-09-23 10:55:16 +01:00
Frederic Massart
ec882623f3 MDL-55026 quiz_overview: Convert chart to the new library
Part of MDL-54987 epic.
2016-07-25 10:43:01 +01:00
Tim Hunt
56df6f1992 MDL-53647 quiz summary: keep row class names in synch around headings 2016-04-02 13:22:55 +01:00
Tim Hunt
190fbfb60d MDL-52738 quiz: fix handling of showall by review prev link 2016-01-20 11:42:06 +00:00
Eloy Lafuente (stronk7)
cf003b48bc Merge branch 'MDL-46091' of git://github.com/timhunt/moodle 2016-01-19 07:32:09 +01: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
0f97fc6c3f Merge branch 'MDL-52750' of git://github.com/timhunt/moodle 2016-01-18 15:50:11 +00: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
a4100d4de3 MDL-52750 quiz reviewQ/comment: add page title & student name 2016-01-15 11:10:43 +00:00
Matthew Pruett
d0b10d0da1 MDL-47106 quiz 'secure' window: Finish review link did not work 2015-12-13 22:08:36 +00:00
Simey Lameze
dcee0b9447 MDL-49360 core_lib: add new method get_local_referer()
This commit also replace all usages of $_SERVER['HTTP_REFERER'] and get_referer().
2015-07-27 11:11:24 +08:00
Frederic Massart
dd0607b7bb MDL-49179 mod_forum, mod_quiz: Prevent misuse of get_referer() 2015-05-05 18:31:13 +08: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
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
fe03b762c9 MDL-48666 quiz: let JS to get a Qs slot number on the summary page 2014-12-19 14:39:15 +00: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
afbe4592ad MDL-44492 quiz: fix hilighting of graded attempt
In various places, when showing several attempts, we try to hilight the
most significant one (the one that gave the final grade if the quiz is
set to first/last/best attempt). That was not working because the table
zebra stripes were a more specific rule.

Also, the colour was inconsistent, not nice, and not very bootstrapy, so
I changed it.
2014-07-08 13:31:55 +01:00
Sam Hemelryk
01773a6d00 MDL-44180 mod_quiz: unified @package use 2014-03-03 08:37:06 +13:00
Dan Poltawski
2a0a33a6ee Merge branch 'MDL-42504' of git://github.com/timhunt/moodle 2013-11-19 10:30:16 +08: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
52b612f08b MDL-42504 quiz autosave: alert users if connection lost.
When the auto-save fails, we alert the user that they may have lost their
internet connection so that they don't do more work that they might just
lose.
2013-11-15 15:08:13 +00:00
rwijaya
c544ee92f5 MDL-41615 quiz_mod: fix heading levels for usability and accessibility 2013-11-07 12:04:00 +08:00
Frederic Massart
eb665c34ef MDL-41611 mod_quiz: Offer to return to course when supported 2013-10-04 18:21:56 +08:00
Dan Poltawski
9a6c6d1cfd Merge branch 'MDL-38765' of git://github.com/timhunt/moodle 2013-08-27 13:51:40 +08:00
Tim Hunt
ad8f011755 MDL-38765 quiz view: fix duplicate message.
The "No more attempts are allowed" message was being shown twice. I
checked back, and it has been like that since before the quiz was
converted to use a renderer. Still, it looks horrible, so changing it.
2013-08-21 10:24:25 +01:00
Tim Hunt
c9c21e1679 MDL-41162 quiz view page: invalid HTML.
We were sometimes outputting nested p tags. Change the outer one to a
div.
2013-08-15 12:38:31 +01:00
Tim Hunt
370ee378f3 MDL-40996 quiz show user pic should also show name.
This was a regression introduced by MDL-20636 two years ago!
2013-08-08 10:24:46 +01:00
Tim Hunt
726fd6db19 MDL-40318 quiz intro comprising just an impage was not shown
Also, ensure that we don't output an empty box if there are no access
messages.
2013-07-04 13:07:32 +01:00
Petr Škoda
689096bc26 MDL-38654 do not test $CFG->gdversion
GD PHP extension is now required. Add-ons need to remove $CFG->gdversion tests. The worst case regression is that add-on will think GD is not available.
2013-03-22 16:57:55 +01:00
Frederic Massart
c384744304 MDL-36638 usability: Core changes for new quiz/question icons 2012-11-29 12:41:29 +08:00
Dan Poltawski
939a43e426 Merge branch 'MDL-35717-quiz-attempt-checkstate' of git://github.com/mpetrowi/moodle
Conflicts:
	mod/quiz/tests/generator/lib.php
2012-11-26 12:07:04 +08:00
Tim Hunt
e498f21421 MDL-30884 quiz: ARIA attribute for the coutdown timer. 2012-11-20 13:18:02 +00:00
Matt Petro
8e771aed93 MDL-35717 quiz: fix overdue attempt processing 2012-11-16 21:32:09 -05:00
Tim Hunt
d869de66a6 MDL-34733 quiz 'secure' mode: finish review link broken in previews
This fix a small API change in mod_quiz_renderer::finish_review_link.
At least the required change is an improvement, since it gives the
renderer more flexibility.
2012-08-21 12:08:57 +01:00
Dan Poltawski
648c1ad194 Merge branch 'MDL-34187' of git://github.com/timhunt/moodle 2012-07-16 15:57:21 +08:00
Tim Hunt
2cdcb90553 MDL-34164 quiz reports: only try to show graphs if GD is installed.
if (empty($CFG->gdversion)) { seems to be the common idiom for this.
I refactored the graph output into the renderer, to avoid having to
duplicate that test three times.
2012-07-14 09:20:04 +01:00
Tim Hunt
ddda79ca5f MDL-34257 quiz 'secure' window: does not close automatically. 2012-07-13 18:02:20 +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
96e5168c7e MDL-32740 / MDL-3030 quiz summary: no Return to attempt for overdue. 2012-05-03 12:16:43 +01:00
Tim Hunt
b39b5d77c3 MDL-3030 quiz overdue handling: show attempt state on the review page. 2012-04-27 15:07:30 +01:00
Tim Hunt
2b2b645842 MDL-3030 quiz overdue handling: display message on the summary page.
This change also includes a clean-up of how we display and initialise the countdown timer.
2012-04-27 15:07:29 +01:00
Tim Hunt
2de9be52aa MDL-3030 quiz overdue handling: show attempt state on the view page 2012-04-27 15:07:27 +01:00
Charles Fulton
33c8d37b6f MDL-11047 quiz: enable sequential navigation 2012-03-15 10:09:27 -07:00