Skip to content

File type question (#681)#6

Merged
golenkovm merged 1 commit into
MOODLE_404_STABLEfrom
MOODLE_404_STABLE_file_type
Feb 9, 2026
Merged

File type question (#681)#6
golenkovm merged 1 commit into
MOODLE_404_STABLEfrom
MOODLE_404_STABLE_file_type

Conversation

@djarran
Copy link
Copy Markdown

@djarran djarran commented Feb 2, 2026

Description: Cherry-pick the changes made in PoetOS#681. This change was only made on the MOODLE_500_STABLE branch and the maintainer did not want this backported to the upstream `MOODLE_404_STABLE branch.

Change has been manually tested. Behat tests also pass in CI

Testing instructions:

  1. Install plugin
  2. Create questionnaire module
  3. Create new question of type File
  4. Start questionnaire response
  5. Upload file
  6. Check questionnaire report

Commit message:

Fix upload when several file upload questions are used.

  • Adjust siganture of methods to their parent
  • Limit the files to upload to one for each question
  • Use questionaire id for file draft area instead of question id in the questionaire.

Fix handling of file uploads

  • allow upload of one file only.
  • new submit does not load previously existing files.

Change refence of file.itemid to questionnaire_response_file.id

update existing files.itemid to questionnaire_response_file.id

Improvements to satisfy code checker.

Make the file upload work with required setting, fix delete of records

  • Make sid public, because its already used via #[\AllowDynamicProperties] Fix cleanup of old file responses.
    Add backup/restore handling for file response type.

  • Fix restore of files in backup. ---------

@djarran djarran self-assigned this Feb 2, 2026
* Circumvent number on string error, resolves PoetOS#538. (PoetOS#563)

* Add file question type

Fix upload when several file upload questions are used.
- Adjust siganture of methods to their parent
- Limit the files to upload to one for each question
- Use questionaire id for file draft area instead of question id in
  the questionaire.

Fix handling of file uploads
- allow upload of one file only.
- new submit does not load previously existing files.

Change refence of file.itemid to questionnaire_response_file.id

update existing files.itemid to questionnaire_response_file.id

Improvements to satisfy code checker.

Make the file upload work with required setting, fix delete of records

* Make sid public, because its already used via #[\AllowDynamicProperties]
Fix cleanup of old file responses.
Add backup/restore handling for file response type.

* Fix restore of files in backup.
---------

Co-authored-by: Luca Bösch <luca.boesch@bfh.ch>
Co-authored-by: Laurent David <lmedavid@gmail.com>
@djarran djarran force-pushed the MOODLE_404_STABLE_file_type branch from 8270d12 to dee1255 Compare February 2, 2026 05:58
@djarran djarran changed the title Draft: File type question (#681) File type question (#681) Feb 2, 2026
@golenkovm
Copy link
Copy Markdown

Thanks @djarran looks good to me. Merging.

@golenkovm golenkovm merged commit b164857 into MOODLE_404_STABLE Feb 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants