337 Commits

Author SHA1 Message Date
Tim Hunt
1aacbb72d3 MDL-67832 quiz: fix lots of PHPdoc in attemptlib.php 2020-01-31 19:09:03 +00:00
Tim Hunt
76a49e4a1e MDL-67653 questions: prevent the flag flickering as the page loads 2020-01-10 14:27:42 +00:00
Eloy Lafuente (stronk7)
4621917c62 MDL-67114 core: php74 fix. Fix use of scalar as array in core
There are various places where it's not guaranteed that the
variable being used is array, and instead, can be null, bool, int...

We need to check that because php74 warns about it.

Where possible we have used the coalesce operator as
replacement for isset() ternary operations.
2020-01-03 11:33:15 +01:00
Bas Brands
aa100b767f MDL-66999 theme_boost: @extend remove extends for questions 2019-12-12 11:27:58 +01:00
Eloy Lafuente (stronk7)
88d29a1bb8 MDL-66965 core: php74 curly 2 square braces changes
Note this only modified core files, still there are a lot
of curly brace uses but all them are within 3rd part
libraries and will be handled apart.
2019-10-25 17:41:10 +02:00
Tim Hunt
471c39b361 MDL-66980 question bank: fix load_many_for_cache missing record check 2019-10-21 11:18:12 +01:00
Eloy Lafuente (stronk7)
9c5796a3f0 Merge branch 'MDL-66754' of https://github.com/timhunt/moodle 2019-10-07 22:33:02 +02:00
Tim Hunt
824d1f8f52 MDL-66754 question engine: fix lots of PHPdoc errors
This fixes essentially all the things PHPstorm was warning about in
question/engine/datalib.php and question/engine/questionusage.php.
2019-09-24 10:25:29 +01:00
Tim Hunt
7b1b478761 MDL-66754 question engine: make $slots argument optional
Sometimes there is not a fixed list of slots, and you just want all data.
2019-09-23 18:03:23 +01:00
Tim Hunt
a3624fdf0f MDL-66685 questions: should able to save an empty question usage 2019-09-16 14:35:18 +01:00
Martin Gauk
09fd8aec27 MDL-58026 question: fix regrading in progress attempt
Do not convert autosave steps to true steps when regrading.

Thanks Eric Merrill for providing the unit test code.
2019-07-08 09:35:34 +00:00
Tim Hunt
e900b2f34f MDL-65864 question engine: fix re-saving a new usage
Before this fix, test_repeated_usage_saving_new_usage was failing but
test_repeated_usage_saving_existing_usage was passing. Now the
behaviour is consistent and they both pass.
2019-06-13 18:04:02 +01:00
Andrew Nicols
dd457c4fa6 Merge branch 'MDL-65245' of https://github.com/timhunt/moodle 2019-05-03 10:50:32 +08:00
David Monllaó
03876f0b89 Merge branch 'MDL-65207-master' of git://github.com/lameze/moodle 2019-04-24 17:52:10 +02:00
David Monllaó
3d15deff15 Merge branch 'MDL-65222' of git://github.com/timhunt/moodle 2019-04-22 09:08:37 +02:00
Tim Hunt
be492e2a8f MDL-65245 question engine: response vars should always be PHP strings 2019-04-02 16:32:40 +01:00
Tim Hunt
6c91e515b0 MDL-65245 question_attempt: fix PHPdoc and other PHPstorm warnings 2019-04-02 16:32:36 +01:00
Simey Lameze
9bec0e7e74 MDL-65207 core: replace typos by actually 2019-04-01 08:49:18 +08:00
Tim Hunt
05ea7ab19e MDL-65222 questions: explain question walkthrough tests 2019-03-29 14:49:39 +00:00
Eloy Lafuente (stronk7)
01cdf16c0e Merge branch 'MDL-65029-master' of git://github.com/timhunt/moodle 2019-04-05 00:39:10 +02:00
Eloy Lafuente (stronk7)
87f196af93 MDL-65204 phpunit: more isEqual() strict string fixes
This is a followup of 85f47ba, where we were relaxing
the (new since phpunit 7.x) strict (===) isEqual()
comparison for strings. Copying the explanations for
easier understanding.

Link: https://github.com/sebastianbergmann/phpunit/issues/3185
Solution here is one of:
  a) Return to the previous situation, making the comparison
     softer. That can achieved by forcing different types, so
     float == string works.
  b) Changing APIs (both forms and database return strings) to
     perform some conversion to floats. That would make float
     comparison (with floats or strings) to work too.
The patch here follows the a) approach. Changing all the internals
for proper float handling sounds excesive when it has been working
perfectly since ever. So we went the easier route, just getting
rid of the new === comparisons when needed by changing expectation
types to float.
2019-04-03 22:08:16 +02:00
Simey Lameze
d499cb3593 MDL-65050 core: delete orphaned files and functions 2019-04-01 12:57:05 +08:00
Simey Lameze
9c164d26fc MDL-65050 core: add question_stats_cleanup_task scheduled task
This commit also removes orphaned question/engine/statisticslib.php
2019-04-01 12:57:05 +08:00
Tim Hunt
f1ffd134d3 MDL-65029 questions: change question div id to acutally be unique
This is largely based on Simey Lameze's work.
2019-03-29 13:37:44 +00:00
Eloy Lafuente (stronk7)
752e2f85e7 Merge branch 'MDL-64420-2' of https://github.com/timhunt/moodle 2019-02-12 12:56:18 +01:00
John Beedell
0d3be6d648 MDL-64420 qtype: gapselect unit tests unsafe 2019-02-11 13:53:24 +00:00
M Kassaei
5179a01ab6 MDL-64646 drag-drop questions: improve editing forms
Users were getting confused between choice numbers and
group numbers. So choice numbers now show as [[1]] to
match what appears in the question text. Groups are now
letters A, B, ...
2019-02-01 10:20:08 +00:00
Shamim Rezaie
305d2716f6 MDL-52132 qbehaviour_manualgraded: unit test for changing comment format 2019-01-15 18:56:03 +11:00
Shamim Rezaie
8e93e515ed MDL-63809 question: handling bad questions in question_has_capability_on 2018-12-18 15:05:37 +11:00
John Beedell
6189fda47f MDL-62708 question: Add idnumbers to question and question category 2018-09-21 12:26:24 +01:00
Tim Hunt
802ff4c933 MDL-63371 question: USE_RAW_DATA case in check_qt_var_name_restrictions 2018-09-14 16:43:41 +01:00
Huong Nguyen
628b4c86af MDL-62358 Question: Improve number function
Support all 'question numbers' that might be needed
2018-06-14 19:43:55 +07:00
Simey Lameze
2cf7bde8e9 MDL-61364 question: adjust code and fix phpunit errors 2018-03-27 16:14:46 +08:00
Shamim Rezaie
2adefc21ac MDL-61380 Questions: Support selecting "random" by tag in question bank 2018-03-07 05:33:11 +11:00
Luca Bösch
eeb8e895da MDL-61250 questions: Omit leading space in question preview link 2018-01-25 14:24:09 +01:00
Andrew Hancox
f3d9872aa3 MDL-41090 questions: Allow embedding files in response comments 2018-01-15 11:19:06 +00:00
Andrew Hancox
fd2ce923cf MDL-41090 questions: Move editor and filepicker options into engine 2018-01-15 11:19:01 +00:00
Andrew Hancox
18e1450b4b MDL-41090 questions: Support for files in behaviour response 2018-01-09 21:12:58 +00:00
Andrew Nicols
3e4de62607 Merge branch 'MDL-60139' of git://github.com/timhunt/moodle 2017-10-31 09:14:32 +08:00
Tim Hunt
808b68835b MDL-60139 question manual grading: redisplay mark as typed if editing
When the teacher is upgrading a previously entered grade, we re-display
exactly what they typed before if possible, rather than displaying with
a set number of decimal places.
2017-10-30 12:52:02 +00:00
Tim Hunt
dae0ccfc45 MDL-59606 quiz responses: fix edge cases in the report
This patch conbines valuable contributions from Kashmira Nagwekar and
Luca Bösch. Many thanks to them. However, the final form of the fix,
and hence the blame, falls to me -- Tim.

There were several issues here:

* The load_questions_usages_by_activity method in
  question/engine/datalib.php was incorrectly treating the case
  when no data was returned. (Looks like a historic copy-pase from
  other methods that fetch one item by unique id, which therefore
  must exist.)

* The report was not correctly handling the display when the 'Which
  tries' was set to 'with, and without, attempts'.

* It was possible to select the 'All tries' option when also saying
  'Users without attempts'. This combination makes not sense, so
  a disabledIf rule was added to the form.
2017-10-27 16:57:01 +01:00
Adrian Greeve
e3909e5853 MDL-59881 question bank: Use supplied function parameters.
question_usage_by_activity::start_all_questions now uses all
three of the parameters that are defined.
2017-08-22 09:30:04 +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
Tim Hunt
2d708a7365 MDL-57588 questions: regrading should not lose flags 2017-01-30 14:31:52 +00:00
Marina Glancy
e7ba25f1b1 MDL-29332 question: calculated variables may differ in case only 2016-09-19 10:37:43 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08: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
b6c538416b MDL-52767 mod_quiz: New API for retrieving the question types 2016-03-23 00:56:05 +01:00
Tim Hunt
81e47a35e8 MDL-53304 question behaviour: don't show useless Check buttons
Previously, the Check button was often shown disabled when it
could not be used (e.g. when the question was finished, or when an
interactive question was in the try-again state). Eventually we
realised it was better usability to hide it in these cases.

Note that when a teacher reviews an in-progress quiz attempt, they will
see a disabled Check button if the student doing the quiz can see the
button.
2016-03-04 14:06:19 +00:00
Eloy Lafuente (stronk7)
fa6426a069 Merge branch 'MDL-52814' of git://github.com/timhunt/moodle 2016-02-16 16:48:04 +01:00