Old-version backups (< 3.11.7, < 4.0.1) lose their course-level format
options when restoring into newer versions after the backup structure
was changed.
Also, course-level format options were not accurately restored against
the appropriate format type. And section-level format options were
redundantly stored at course-level and restored without mapping their
sectionids, thus creating lint.
I thought about renaming the class to just plain attempt, but I
acutally think quiz_attempt makes it clearer what this is. Also
not changing the name massively reduces the pain for everyone
updating their code (including me right now!)
Previously, if a course module had already been graded, course module
completion linked to the course module would not update. This
commit adds the option to enable overriding the grade at the course
module competency level.
This ensures that if enabled and a user completes a module associated
with a competency, that competency will be graded appropriately.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
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.
Special mention to:
- Some fixtures, initially defined in the test files have been
moved to new files in fixtures subdirectory, leaving the unit
test files clearer:
- moodle2_course_format_test.php
- Rename wrong named test:
- baseoptiogroup_test = baseoptigroup_test
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.
Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
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.
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.
This implementation will introduce a qbank plugin
"comment" which will allow users with the capability
to comment in a question. It also implements a
callback for the question preview page to view
and add comments from the preview page. Comment
plugin is implemented using the existing comments
API from the core.
Co-Authored-By: Guillermo Gomez Arias <guillermogomez@catalyst-au.net>
Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Matt Porritt <mattp@catalyst-au.net>
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.
AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
Backup the table user_lastaccess which holds data for when a user last accessed a course.
And also restore to the table user_lastaccess from the .xml file created in the backup.
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.
Since the class has only just been added to Moodle, now is a good
time to move it.
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.
Basically the now deprecated method has been split into:
- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
artifact.
In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.
Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.
Link: https://github.com/sebastianbergmann/phpunit/issues/3770
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
* Old backups might have hidepicture defined and set to 1 in which case
we must make sure to exclude the group picture for these groups from
being restored.