Affects Version/s: 2.4, 3.2.4, 3.3.1
Component/s: Database activity module
Create a database activity with approval, add two fields Add some entries as a student Approve them as a teacher Export database activity and check additional checkboxes (include timemodified, user meta data, time approved), save the file Delete all entries from the database and import the file, make sure everything is imported Completely delete one field from the database Import the file again, the error should be displayed and entries not imported
- Create a database activity with approval, add two fields
- Add some entries as a student
- Approve them as a teacher
- Export database activity and check additional checkboxes (include timemodified, user meta data, time approved), save the file
- Delete all entries from the database and import the file, make sure everything is imported
- Completely delete one field from the database
- Import the file again, the error should be displayed and entries not imported
Affected Branches:MOODLE_24_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
Fixed Branches:MOODLE_32_STABLE, MOODLE_33_STABLE
Pull from Repository:
Pull Master Branch:wip-
Pull Master Diff URL:
I initially tried to capture information about practical tasks students attempt using Feedback - but each time they submit a new form it overwrites. I switched to a database activity and that works fine - but I wanted to import the original entries rather than have all students resubmit attempts.
I exported a sample of the database to get the correct fields, with the optional 'include user details' tickbox, then added the records exported from the Feedback activity with the same fields.
When I tried to upload I got the error:
The following fields in your file are not known in this database: 'User' 'Username' 'Email address' 'Time added' 'Time modified'
More information about this error
Error code: fieldnotmatched
line 476 of /lib/setuplib.php: moodle_exception thrown
line 122 of /mod/data/import.php: call to print_error()
The field names all came from the Moodle database export, but it's only recognising fields I added manually. The user metadata fields that come with the tickbox 'include user data' are not being recognised as part of the csv import even although content already exists with those field names.