Commit Graph

52 Commits

Author SHA1 Message Date
2e1fde188e MDL-75017 questions: fix weird setup in qformat_xml_import_export_test 2023-03-24 12:56:14 +00:00
839c2e5c18 MDL-75777 phpunit: Move tests to use correct names and ns (take#6)
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
2022-09-19 11:01:21 +02:00
032468d269 MDL-74211 behat: convert few more steps to use new data generators 2022-08-04 09:21:33 +08:00
2f9032a198 MDL-73335 quiz/questions: fix Behat fails from nav changes
The Classic quiz behat override is no longer needed.
The way it is implemented is Boost/core works in all cases.
2022-02-24 09:26:29 +02:00
b610055bbd MDL-73335 question: Add the tertiary nav for question bank
The tertiary navigation has been added to the question bank.
- Url selector has been added for the pages:
  Questions, Categories, Import and Export
- A separate page to "Add category" has been added.
  The "Add category" is available as a tertiary nav button.
- Updated the tests for the changes made.

This commit is mostly Sujith's work, with further changes by
Tim Hunt <T.J.Hunt@open.ac.uk> so we share the blame/credit.

AMOS BEGIN
 CPY [questioncats,mod_quiz],[questioncategories,core_question]
AMOS END
2022-02-24 09:26:29 +02:00
c4e411e48b Revert "MDL-71915 question: Update the behat tests"
This reverts commit f000755ba1.
2022-02-15 15:54:00 +00:00
3008edd366 MDL-71696 core_question: Implement question status change
This commit implements the status change pop up for a question
in the base view. This feature update will allow the change of
status of a question without creating a new version.
This commit also implements the status as a char rather than
an int value.
2022-02-03 22:22:50 +11:00
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
c6cfca2a08 MDL-71696 core_question: Changes for versioning
This commit adds the changes in questiontype base
to work with new question tables and the new structure in the
databse. Also needed for versioning.
This implementation will also introduct the question status
which allows a question to be in draft and ready status.
I also introduces changes to the base view where it shows
the latest version of the questions. The view of versions
for a question is not implemented in this commit.
This implementation will also introduce changes in the core
qtype plugins to support versioning and the changed
db schema.
2022-02-03 22:22:44 +11:00
f000755ba1 MDL-71915 question: Update the behat tests
Update the behat tests to accommodate the
changes made for the tertiary navigation.
2021-12-06 10:26:40 +05:30
ba5b6089d5 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 19:22:24 +01:00
187801ccf5 Merge branch 'MDL-70966-master' of git://github.com/marinaglancy/moodle 2021-03-03 09:30:41 +01:00
612c230709 MDL-70966 various: Under PHP8 empty string is no longer equals to 0 2021-02-28 19:16:09 +01:00
1d552eca6c MDL-70916 Essay/Moodle XML: min and max word limits not imported 2021-02-17 11:32:05 +00:00
99778a61a3 MDL-69101 Essay/Moodle XML: recent new settings not imported/exported 2021-02-03 08:09:27 +00:00
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
3c1416dcf3 MDL-69798 XML question export: excape special chars in idnumbers 2020-10-01 17:01:50 +01:00
00055ef6ab MDL-68367 Question: Multi-choice Option to hide systemtext 2020-05-21 09:47:15 +01:00
e247068d72 MDL-66801 questions: XML import/export should include category idnumbers 2019-09-30 18:59:23 +01:00
48aad79a63 MDL-63905 qtype_multianswer: validate imported questions 2019-03-06 08:35:04 +01:00
2d696f8f2b MDL-63752 question import: duplicate key error when idnumbers blank
And extra checks to head off possible idnumber='' issues in two other places.
2018-10-24 11:38:31 +01:00
dfa85ad002 MDL-62708 qformat_xml: phpunit test correction. 2018-09-24 09:37:12 +01:00
6189fda47f MDL-62708 question: Add idnumbers to question and question category 2018-09-21 12:26:24 +01:00
f19c6f60cd MDL-23545 qformat_xml: don't allow irrelevant DB differences to break tests
Also slightly improve formatting of the exported file.
2018-09-18 13:52:51 +01:00
1dab8faafd MDL-23545 question: XML import/export add category description 2018-09-14 16:54:25 +01:00
12ef47cd99 MDL-63165 question: Bump expected size of question exports (take II) 2018-08-29 14:38:40 +02:00
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
1796eb181b MDL-61410 question: fix unit tests failures 2018-03-19 11:45:55 +08:00
fdeeaff954 MDL-58265 core_test: replace I turn editing on steps
Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
c987d1b2ef MDL-58265 core_test: replace all uses of I follow course steps
Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
e5287f9b3b MDL-56614 behat: navigate without navigation and admin blocks 2016-12-06 11:49:14 +08:00
b355a1c97c MDL-50851 core_question: use new tag API 2016-01-10 15:25:47 +08:00
bd15685352 MDL-38214 Questions: Add MCS, MCVS, MCHS Cloze subquestion types
Daniel Seemuth add MCO,MCVS,MCHS new multianswer subquestion types
qtype_multianswer_initialise_multichoice_subquestion.
Pierre Pichet MCO to MCS, add shuffling display in decode and verify edit_multianswer_form.php
add test_questiontext_extraction.

Signed-off-by: Pierre Pichet <pichet.pierre@uqam.ca>
2015-10-08 10:02:25 -05:00
dcd4464ea3 MDL-50642 qformat_xml: fix import of tags in Cloze questions 2015-08-05 19:11:11 +01:00
c3b72e586a MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-30 08:54:12 +08:00
1cb5f61213 Revert "Merge branch 'wip-mdl-48624-m' of https://github.com/rajeshtaneja/moodle"
This reverts commit e08f58288a, reversing
changes made to 782ea98c59.
2015-01-22 12:13:35 +08:00
e41aa29bca MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-19 10:15:47 +08:00
46e4c35aa9 MDL-42519 qformat_xml: Correctly export questions containing ]]> 2014-12-22 19:46:23 +00:00
a296ebffed MDL-48290 behat: Add log out after checking exported file
If the download step is the last in the scenario then we
can sometimes run into the situation where the download page
causes a http redirect but behat has already conducted its
reset (generating an error). By putting a logout step we avoid
behat doing the reset until we are off that page.
2014-12-02 09:38:26 +08:00
d7a2a11e67 MDL-47497 qformats gift and xml: basic test of export.
Really, this is just to test the new behat setps, as much as anything.

Note that the details of what is written to the export files is tested in
the unit tests.
2014-10-08 19:43:10 +08:00
02643dafe7 MDL-47381 qformat: Behat tests have wrong plugin type. 2014-09-26 11:46:06 +01:00
21ed2330cf MDL-47167 XML question format: behat tests 2014-09-09 22:57:34 +01:00
624ff5ba57 MDL-42033 Files in subdirs not exported correctly by question XML format 2014-02-16 19:37:09 +01:00
5c0b5ba575 MDL-43809 qformat_xml messes up $s in multianswer questions. 2014-01-23 15:26:38 +00:00
a4f765eb1d MDL-39756 add advanced attachment options to essay question type
Adds a set of options to the essay question type which implement
the following new features:

-Adds an input format which accepts only file uploads, and no
 inline text.
-Adds an option to make the inline text response optional when
 attachments are enabled, so students can choose to upload
 an essay file.
-Adds an option to make attachments required, so essays without
 attachments will be marked incomplete.
2014-01-15 12:43:04 -05:00
d2fd7262af MDL-39404 Update question/format files to match codechecker standards 2013-07-26 21:32:34 +02:00
c80fb6d95e MDL-38880 Imported Cloze questions lose embedded images or other media 2013-04-11 16:22:20 +02:00
60527d0c34 MDL-10516 Pre-populated answer (template) in essay questions 2013-04-03 11:30:42 +08:00
7bae3a12fd MDL-38051 Annihilate all the CRLFs present in some questions/fixtures... 2013-02-15 18:26:38 +01:00
52158a41e4 MDL-37313 Sample files with images for XML import 2013-01-11 19:54:06 +01:00