Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
614ab91
Phase 1: Add persistent data layer and rename underscore DB columns.
mchurchward Mar 7, 2026
b96627d
Phase 1: Add persistent classes for remaining 13 DB tables.
mchurchward Mar 7, 2026
b7cbe2f
Phase 2: Move question/feedback/responsetype to local namespace; add …
mchurchward Mar 7, 2026
765281c
Phase 2: Add unit tests for mod_questionnaire\questionnaire class.
mchurchward Mar 8, 2026
03a3d75
Phase 2: Fix all DB column name references broken by Phase 1 renames.
mchurchward Mar 9, 2026
979b32c
Phase 2: Rename underscore PHP property names to comply with Moodle c…
mchurchward Mar 9, 2026
62883f6
Fix require_once paths broken by Phase 2 namespace move.
mchurchward Mar 9, 2026
6d60de0
Fix class namespace in question_builder() and test assertions.
mchurchward Mar 9, 2026
4c3f32b
Fix responsetype class namespaces missed by Phase 2 namespace move.
mchurchward Mar 9, 2026
922d17d
Phase 2: Fix leftover underscores.
mchurchward Mar 12, 2026
25ec68f
Phase 2: Fixing underscore errors.
mchurchward Mar 12, 2026
c1f2a00
Phase 3: Extract response handling into classes/local/response/manage…
mchurchward Mar 12, 2026
f8bdaea
Fix all Moodle PHPCS code style violations
mchurchward Mar 13, 2026
e50c368
Fix broken namespace splits in responsetype files
mchurchward Mar 13, 2026
43adf91
Phase 4: Refactor question/choice classes to use persistent records
mchurchward Mar 13, 2026
dae71b8
Phase 5: Clean up output/rendering layer
mchurchward Mar 16, 2026
f1b9e95
Remove #[AllowDynamicProperties] and declare all properties explicitly
mchurchward Mar 16, 2026
6971ca3
Fix pagebreak::questionstart_survey_display() signature mismatch
mchurchward Mar 17, 2026
dbee516
Declare dynamic properties set by locallib on question objects
mchurchward Mar 17, 2026
5cb855d
Fixing docblocks.
mchurchward Mar 17, 2026
8045142
Phase 6a: Remove questionnaire_delete_response/responses/get_user_res…
mchurchward Mar 17, 2026
34028a0
Phase 6b: Move capabilities, survey list/select to questionnaire class
mchurchward Mar 17, 2026
d010027
Phase 6c: Move questionnaire_check_page_breaks to questionnaire class
mchurchward Mar 17, 2026
c9e85c4
Phase 6d: Move questionnaire_set_events and questionnaire_delete_surv…
mchurchward Mar 17, 2026
1528def
Fix pagebreak return type and daily test midnight edge case
mchurchward Mar 17, 2026
ba5ce6d
Fix PHPCS MultipleArguments errors in lib.php
mchurchward Mar 17, 2026
04f387d
Fix pagebreak stdClass namespace — use \stdClass not stdClass
mchurchward Mar 17, 2026
080da8f
Declare dynamic properties set by page scripts
mchurchward Mar 17, 2026
36d964f
Guard constructor property loop to only set declared properties
mchurchward Mar 17, 2026
d030a81
Declare \$canviewallgroups property on questionnaire class
mchurchward Mar 18, 2026
975f281
Declare dynamic map properties on behat_mod_questionnaire
mchurchward Mar 18, 2026
80c86b2
Add missing questionnaire.class.php require_once in lib.php callbacks
mchurchward Mar 18, 2026
d303b3a
Declare \$cmid, \$cmidnumber, \$courseid on questionnaire class
mchurchward Mar 18, 2026
d5d388b
Phase 7: Move survey_update() and survey_copy() to classes/questionna…
mchurchward Mar 18, 2026
108e28e
Phase 7: Rewrite update_survey/copy_survey to use persistent records
mchurchward Mar 18, 2026
c960f01
Phase 7b: Consolidate add_instance/update_instance into questionnaire…
mchurchward Mar 20, 2026
504ae7d
Fix property/method access errors after new questionnaire class intro…
mchurchward Mar 20, 2026
67a4aa8
Phase 7c: persistent record factories, questionnaire.php getters, tes…
mchurchward Mar 20, 2026
74346a5
Phase 7c: Add back temnporary fix.
mchurchward Mar 20, 2026
7b54cff
Fix PHPCS multi-line formatting errors in generator/lib.php and quest…
mchurchward Mar 21, 2026
b991bd8
Remove unused questionnaire_get_instance() from lib.php
mchurchward Mar 21, 2026
c7a1650
Phase 8a: Remove deprecated questionnaire_print_overview() and questi…
mchurchward Mar 21, 2026
dbf0ee5
Phase 8b: Extract gradebook methods to mod_questionnaire\questionnair…
mchurchward Mar 21, 2026
047ac03
Phase 8c: Extract delete_instance and reset_userdata to mod_questionn…
mchurchward Mar 21, 2026
f91fe2c
Phase 8d: Extract navigation/display/hook methods to mod_questionnair…
mchurchward Mar 21, 2026
5f3b136
Fix bad require_once path in coursemodule_edit_post_actions
mchurchward Mar 21, 2026
3dd2df0
Fix custom_completion: inline deleted questionnaire_get_completion_st…
mchurchward Mar 21, 2026
f1a1b5b
Phase 8 follow-up: delegate completion check through persistent layer
mchurchward Mar 23, 2026
b9f4fa7
Add TODO note to user_has_submitted re Phase 9 manager migration
mchurchward Mar 23, 2026
47ccc21
Phase 9: Migrate response handler to mod_questionnaire\questionnaire
mchurchward Mar 24, 2026
eef0916
Fix PHPCS style violations from Phase 9
mchurchward Mar 24, 2026
bf28988
Phase 10: Add dependency-checking and navigation methods to new quest…
mchurchward Mar 24, 2026
02e4029
Phase 11: Add response-flow and utility methods to classes/questionna…
mchurchward Mar 25, 2026
b701c54
Phase 12: Extract survey domain object; questionnaire delegates to it
mchurchward Mar 25, 2026
2070fff
Fix PHPCS violations in Phase 12 files
mchurchward Mar 25, 2026
3201a3f
Phase 13: Add response domain object
mchurchward Mar 26, 2026
45624b1
Fix PHPCS violations in response_test.php
mchurchward Mar 26, 2026
7cf931a
Phase 14: Migrate view.php to classes/questionnaire.php
mchurchward Mar 26, 2026
aa93d10
Fix is_active() and make_questionnaire() test consistency
mchurchward Mar 27, 2026
0775450
Phase 15: Migrate complete.php to classes/questionnaire.php
mchurchward Mar 28, 2026
ed92188
Phase 16: Migrate qsettings.php/tabs.php/grade.php to new questionnai…
mchurchward Apr 1, 2026
cbb482d
Fix PHPCS errors in Phase 16 forwarding methods and control structure
mchurchward Apr 1, 2026
4498195
Improve complete.php: move PAGE setup out of view(), clean up globals
mchurchward Apr 1, 2026
99681cf
Phase 17: Migrate feedback.php, fbsections.php, print.php to new ques…
mchurchward Apr 2, 2026
404a151
Fix PHPCS line length warnings in feedback.php and fbsections.php
mchurchward Apr 2, 2026
d583cd6
Phase 18: Migrate myreport.php to new questionnaire class
mchurchward Apr 2, 2026
d011228
Phase 19: Migrate report.php to new questionnaire class
mchurchward Apr 2, 2026
6f8120d
Phase 20: Migrate show_nonrespondents.php to new questionnaire class
mchurchward Apr 2, 2026
d8fcd25
Phase 21: Migrate questions.php to new questionnaire class
mchurchward Apr 2, 2026
66faf80
Fix PHPCS PSR-12 multi-line function call formatting in feedback.php
mchurchward Apr 6, 2026
9228ffd
Fix questions_form.php to use accessor API on new questionnaire class
mchurchward Apr 6, 2026
c841efd
Fix questionnaire class compatibility issues exposed by sync
mchurchward Apr 6, 2026
22e972d
Fix Behat failures in report/survey_results shims
mchurchward Apr 7, 2026
266131f
Simplifying multi line if.
mchurchward Apr 7, 2026
26c56e6
Phase 22: Introduce question_type class and record-backed question pr…
mchurchward Apr 8, 2026
3ddf16e
Fix PHPCS style violations and __set set_id() compat issue
mchurchward Apr 8, 2026
010605d
Phase 23: Replace raw DB writes in insert_response() with persistent …
mchurchward Apr 8, 2026
e90d91f
Fix Phase 22 regressions: magic props incompatible with set_data() an…
mchurchward Apr 8, 2026
2d98e19
Fix PHPCS style violations in question.php
mchurchward Apr 8, 2026
a070e4b
Phase 24: Merge two response classes into unified persistent-backed d…
mchurchward Apr 9, 2026
67d16e6
Replace raw DB call in response::latest_incomplete() with persistent …
mchurchward Apr 9, 2026
207fc1a
Phase 25: Merge \local\responsetype into \local\response namespace
mchurchward Apr 9, 2026
0388841
Replace raw DB calls in questionnaire_responses with response domain …
mchurchward Apr 9, 2026
a89ddae
Phase 26: Remove TEMPORARY magic from response class; migrate all cal…
mchurchward Apr 9, 2026
25d7abd
Phase 27a: Add named accessor methods to question base class; update …
mchurchward Apr 10, 2026
4c20db4
Phase 27b: Update external callsites to use named question accessor m…
mchurchward Apr 10, 2026
200dd09
Phase 27c: Update internal $this-> reads in question classes to use n…
mchurchward Apr 13, 2026
63a5b97
Fix PHPCS: add missing @param for $responseid in build_response_from_…
mchurchward Apr 13, 2026
ba6d482
Phase 27d: Remove TEMPORARY __get/__set/__isset magic from question c…
mchurchward Apr 13, 2026
17f1ede
Phase 28: Migrate preview.php to use new questionnaire domain class
mchurchward Apr 13, 2026
e7120c2
Phase 29: Audit and slim questionnaire.class.php
mchurchward Apr 14, 2026
de5be7b
Fix PHPCS: remove blank line before class closing brace in questionna…
mchurchward Apr 14, 2026
bee35e8
Phase 30a: Add question_type::display_name(); remove questionnaire_ge…
mchurchward Apr 14, 2026
45a5ab8
Phase 30b: Move locallib constants to private const on questionnaire …
mchurchward Apr 14, 2026
6c3dd77
Phase 30c: Move questionnaire_choice_values() to question::parse_choi…
mchurchward Apr 14, 2026
030a4e5
Phase 30d: Move survey-content functions from locallib to survey class
mchurchward Apr 14, 2026
5500f57
Phase 30e: Move response-query functions from locallib to questionnai…
mchurchward Apr 14, 2026
5bd6933
Phase 30f: Move question-lifecycle functions from locallib to questio…
mchurchward Apr 14, 2026
42c08e7
Phase 30g: Move remaining migratable locallib functions to questionna…
mchurchward Apr 14, 2026
de54fb6
Late version change for refactor.
mchurchward Apr 14, 2026
4b74e14
Fix PHPCS violations in Phase 30 additions
mchurchward Apr 14, 2026
d3385d3
Add unit tests for survey, question_type, and Phase 30 questionnaire …
mchurchward Apr 14, 2026
c5c0af8
Add unit tests for capability methods and questionnaire_responses sta…
mchurchward Apr 15, 2026
e0f609c
Start removing legacy code.
mchurchward Apr 15, 2026
83ccf68
Phase 31: Convert extend_settings_navigation to instance method
mchurchward Apr 16, 2026
eeea17b
Phase 32: Migrate externallib.php to new questionnaire domain class
mchurchward Apr 16, 2026
25d7a76
Add PHPUnit tests for questionnaire::save_mobile_data()
mchurchward Apr 17, 2026
3d00f9a
Phase 33: Migrate mod_form.php to new questionnaire domain class
mchurchward Apr 17, 2026
71a9436
Refactor survey select: three named methods, persistents for data access
mchurchward Apr 17, 2026
955a856
Rename get_*_surveys to get_*_questionnaires
mchurchward Apr 17, 2026
d8a3515
Refactor survey select list to use survey domain class and questionna…
mchurchward Apr 20, 2026
912416a
Phase 34: Remove legacy class from privacy/provider.php and simplify …
mchurchward Apr 20, 2026
64af7ef
Phase 35: Migrate mobile.php off legacy questionnaire class
mchurchward Apr 22, 2026
400b3a9
Remove questionnaire_get_standard_page_items() from locallib.php
mchurchward Apr 22, 2026
ee5e9d2
Move last two locallib functions to domain classes
mchurchward Apr 22, 2026
12c06e9
Remove unused get_survey_select() from legacy questionnaire class
mchurchward Apr 22, 2026
37af79d
Reorganize legacy class: group all public methods before private methods
mchurchward Apr 22, 2026
7843bc0
Remove legacy context() — all callers now use new questionnaire class
mchurchward Apr 22, 2026
5040e5a
Fix PHPCS violations in locallib, provider, slider, and renderer
mchurchward Apr 22, 2026
d692052
Make 15 legacy class methods private — no external callers on legacy …
mchurchward Apr 22, 2026
faddb4c
Reorder legacy class: group 17 public methods before 86 private methods
mchurchward Apr 22, 2026
26e912f
Remove legacy add_user_responses delegation; make legacy method private
mchurchward Apr 23, 2026
d59aff1
Remove legacy get_survey_list from reset_userdata; make method private
mchurchward Apr 23, 2026
ab6370b
Remove legacy get_survey_list — no callers remain
mchurchward Apr 23, 2026
427bbd6
Remove legacy delete_survey and 23 dead private methods
mchurchward Apr 23, 2026
e434f52
Restore questions_autonumbered to public on legacy class
mchurchward Apr 23, 2026
7beb27d
Restore load_parents to public on legacy class
mchurchward Apr 23, 2026
5b14c41
Extract question_navigator: move page/dependency logic out of survey …
mchurchward Apr 23, 2026
cc497cf
Apply coding style fixes to slider.php and renderer.php
mchurchward Apr 23, 2026
bed91d5
Phase 31a: Migrate generate_csv() into new reporter class
mchurchward Apr 23, 2026
250ed30
Phase 31b: Migrate response_analysis() into reporter class
mchurchward Apr 23, 2026
c6f29c1
Phase 31c: Migrate view_response() into reporter class
mchurchward Apr 24, 2026
1449fc0
Phase 31d: Migrate view_all_responses() and add_user_responses() into…
mchurchward Apr 24, 2026
a82c7c9
Phase 31e: Migrate survey_results() into reporter class
mchurchward Apr 24, 2026
e1bb53d
Phase 31f: Migrate survey_results_navbar_alpha/student into reporter …
mchurchward Apr 24, 2026
cba8899
Refactor: coursemodule property is always \cm_info
mchurchward Apr 24, 2026
3bcd859
Refactor: rework constructor; fix PHPCS violations in reporter
mchurchward Apr 24, 2026
9c76b47
Phase 32: Move survey listing methods from questionnaire to survey class
mchurchward Apr 24, 2026
d628403
Phase 33: Migrate mod_form.php; remove global arrays from locallib.php
mchurchward Apr 28, 2026
a9be2a5
Phase 34: Add add_user_responses() to new class; remove locallib from…
mchurchward Apr 28, 2026
a047ba8
Phase 35: Remove vestigial require_once locallib.php from migrated pa…
mchurchward Apr 28, 2026
84a9033
Phase 36: Eliminate legacy_instance() for non-rendering methods
mchurchward Apr 28, 2026
e7c3619
Phase 37: Implement check_page_breaks() and response_goto_thankyou() …
mchurchward Apr 29, 2026
5026b75
Phase 38: Implement print_survey() and survey_print_render() directly…
mchurchward Apr 29, 2026
23afa6d
Phase 39: Remove legacy_instance() — replace with stdClass shim in re…
mchurchward Apr 29, 2026
992310f
Phase 40: Remove global $questionnaire from response/text and respons…
mchurchward Apr 30, 2026
77aaee9
Phase 41: preview.php — use new class when $sid+$qid resolves to real CM
mchurchward Apr 30, 2026
9b76d7e
Phase 42: Make QTYPE/RESPVIEW/CONFIRM/RESTORE constants public; remov…
mchurchward Apr 30, 2026
a1efa66
Phase 43: Delete locallib.php; remove require_once from all callers
mchurchward May 1, 2026
93bb33b
Phase 44: Slash questionnaire.class.php from 3894 to 763 lines
mchurchward May 1, 2026
654449d
Fix PHP 8.2 dynamic property deprecations on response class
mchurchward May 4, 2026
1b18f16
Phase 45a: Add survey-only construction path to questionnaire class
mchurchward May 5, 2026
e85fb6a
Phase 45b: Switch preview.php to new class; delete legacy questionnai…
mchurchward May 5, 2026
f17dd43
Phase 46: Extract gradebook, submission_notifier, form_options classes
mchurchward May 5, 2026
4daf379
Phase 46c: Extract capabilities class
mchurchward May 7, 2026
6674763
Phase 46d: Move question administration onto survey class
mchurchward May 7, 2026
f93f85b
Phase 46e: Extract instance_admin class
mchurchward May 7, 2026
dc89acd
Replace mod_questionnaire\manager with the existing domain classes
mchurchward May 8, 2026
2ca968b
Tier A: Push three DB calls out of questionnaire.php into records
mchurchward May 8, 2026
54011ed
Tier B: Move count_submissions and original-public lookup onto records
mchurchward May 8, 2026
05f1229
Survey Phase A: Reuse existing record finders for 3 DB calls
mchurchward May 8, 2026
3ac314e
Survey Phase B: Push cascade-delete DB calls onto record classes
mchurchward May 8, 2026
d38cfdd
Survey Phase C: Move orphan finder onto survey_record
mchurchward May 8, 2026
0cb08b5
Survey Phase D: Soft-deleted question CRUD onto question_record
mchurchward May 8, 2026
4078500
Survey Phase E: Rewrite check_page_breaks to use record statics
mchurchward May 8, 2026
569b97e
Tier 1: Push DB calls in question/sectiontext onto records
mchurchward May 8, 2026
7993872
Use already-loaded survey persistent for update_survey
mchurchward May 8, 2026
3e5be98
Tier 4: Push DB calls in local/feedback onto record classes
mchurchward May 9, 2026
2189863
Tier 2: Push rate.php DB calls onto records
mchurchward May 11, 2026
afe2868
Add unit tests for seven persistent record classes
mchurchward May 12, 2026
4166836
Add unit tests for response_record, question_record, and count_distin…
mchurchward May 12, 2026
a25786c
Add unit tests for response_X and question_type record classes
mchurchward May 12, 2026
159bc64
Clean up code-checker findings on the new record-class tests
mchurchward May 12, 2026
2a18df0
Reword test section-header comments to silence false-positive checker
mchurchward May 12, 2026
1ac31b7
Add unit tests for gradebook and the feedback section classes
mchurchward May 12, 2026
3d3b82f
Add unit tests for submission_notifier and instance_admin
mchurchward May 12, 2026
b35241a
Add unit tests for the responsetype hierarchy
mchurchward May 12, 2026
0f1d8d3
Phase 47a: Extract student-facing survey rendering into survey_view_r…
mchurchward May 12, 2026
6bbc0f9
Phase 47b: Extract print/preview rendering into report_view_renderer
mchurchward May 12, 2026
b969c39
Fix capitalisation on submission_notifier inline comment
mchurchward May 12, 2026
c8ab19f
Phase 47d-1: Drop the questionnaire response-flow shims
mchurchward May 12, 2026
d6205d7
Phase 47d-2: Navigator code move
mchurchward May 13, 2026
6167407
Phase 47d-3: Extract submission_controller for page-flow actions
mchurchward May 14, 2026
c6ce4b1
Phase 47d-4: Move response_goto_* into survey_view_renderer
mchurchward May 14, 2026
d52b129
Phase 47d-5: Note save_mobile_data() as the mobile-API contract surface
mchurchward May 15, 2026
8565a40
Fix two phpcs style issues flagged by CI
mchurchward May 15, 2026
ef49969
Phase 47e pre-batch: reporter takes renderer and page as constructor …
mchurchward May 15, 2026
cca9246
Phase 47e pre-batch: forms and question take their own renderer
mchurchward May 15, 2026
30205e6
Phase 47e batch 1: 4 non-tabs pages stop using questionnaire->rendere…
mchurchward May 15, 2026
9ec737a
Phase 47e batch 2: 4 tabs.php-including pages migrate off questionnai…
mchurchward May 15, 2026
08ac5fd
Phase 47e batch 3: the three heavy pages migrate off questionnaire->r…
mchurchward May 15, 2026
2cf09c2
Phase 47e batch 4: drop renderer/page state and shims from questionnaire
mchurchward May 16, 2026
e86c5ad
Wrap long reporter() chains to satisfy phpcs line length
mchurchward May 21, 2026
6197f32
Drop remaining raw $DB calls in report.php and fix navbar N+1
mchurchward May 21, 2026
246181f
Drop unused forwarders and downgrade survey finder visibility
mchurchward May 21, 2026
ca6cca9
Drop raw $DB calls from print_survey_start
mchurchward May 21, 2026
9c855a5
Push capabilities::user_time_for_new_attempt onto response_record
mchurchward May 21, 2026
2cf9755
Extract pdf_factory from the report.php top-level function
mchurchward May 22, 2026
d4e93b5
Extract delete arms from report.php into report_actions controller
mchurchward May 22, 2026
651e16f
Extract download arms from report.php into report_downloader controller
mchurchward Jun 8, 2026
f37abd2
Extract action handlers from build_survey_form
mchurchward Jun 9, 2026
3f0cb7e
Cover error-path branches in build_survey_form action handlers
mchurchward Jun 10, 2026
07167b2
Fix string $from arg to email_to_user under stricter core typing
mchurchward Jun 10, 2026
1dcdce6
Extract vall/vresp arms from report.php into report_viewer controller
mchurchward Jun 11, 2026
84ca320
Move RGraph JS init out of report.php and into report_viewer
mchurchward Jun 11, 2026
5bb11c2
Add direct tests for boolean / text insert_response + display_results
mchurchward Jun 11, 2026
390d0d5
Add direct tests for date and single responsetype methods
mchurchward Jun 14, 2026
4720f86
Add missing $choicedata param to build_data_fixture docblock
mchurchward Jun 14, 2026
0aa5b45
Fix property access on question $name (broke after feedback save star…
mchurchward Jun 17, 2026
ee6947e
Replace survey::update_survey(stdClass) with update_settings(array) a…
mchurchward Jun 17, 2026
cd35a1a
Replace procedural tabs.php with mod_questionnaire\output\tabs class
mchurchward Jun 18, 2026
38e9092
Require explicit instance= on report.php; drop SESSION URL fallback
mchurchward Jun 18, 2026
8482c5f
Fix phpcs violations flagged by CI after Phase A/B
mchurchward Jun 18, 2026
d0abafb
Add missing $individualresponse phpdoc param on question::question_ou…
mchurchward Jun 18, 2026
49a3658
Drop dead/redundant SESSION report-context fields
mchurchward Jun 19, 2026
17ae12c
Carry submission end flag in hidden form field, not SESSION
mchurchward Jun 19, 2026
4439b40
Fixing Codechecker for Moodle 5.0.
lucaboesch Jun 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

services:
postgres:
image: postgres:15
image: postgres:16
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
Expand All @@ -16,7 +16,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

mariadb:
image: mariadb:10
image: mariadb:10.11
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
Expand All @@ -34,7 +34,7 @@ jobs:
moodle-branch: 'main'
database: 'mariadb'
- php: '8.4'
moodle-branch: 'MOODLE_501_STABLE'
moodle-branch: 'MOODLE_502_STABLE'
database: 'pgsql'
- php: '8.3'
moodle-branch: 'MOODLE_501_STABLE'
Expand Down
68 changes: 34 additions & 34 deletions backup/moodle2/backup_questionnaire_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ protected function define_structure() {
'introformat',
'qtype',
'respondenttype',
'resp_eligible',
'resp_view',
'respeligible',
'respview',
'notifications',
'opendate',
'closedate',
Expand All @@ -69,22 +69,22 @@ protected function define_structure() {
'subtitle',
'info',
'theme',
'thanks_page',
'thank_head',
'thank_body',
'thankspage',
'thankhead',
'thankbody',
'feedbacksections',
'feedbacknotes',
'feedbackscores',
'chart_type',
'charttype',
]);

$questions = new backup_nested_element('questions');

$question = new backup_nested_element('question', ['id'], [
'surveyid',
'name',
'type_id',
'result_id',
'typeid',
'resultid',
'length',
'precise',
'position',
Expand All @@ -96,7 +96,7 @@ protected function define_structure() {

$questchoices = new backup_nested_element('quest_choices');

$questchoice = new backup_nested_element('quest_choice', ['id'], ['question_id', 'content', 'value']);
$questchoice = new backup_nested_element('quest_choice', ['id'], ['questionid', 'content', 'value']);

$questdependencies = new backup_nested_element('quest_dependencies');

Expand Down Expand Up @@ -143,53 +143,53 @@ protected function define_structure() {

$responsebools = new backup_nested_element('response_bools');

$responsebool = new backup_nested_element('response_bool', ['id'], ['response_id', 'question_id', 'choice_id']);
$responsebool = new backup_nested_element('response_bool', ['id'], ['responseid', 'questionid', 'choiceid']);

$responsedates = new backup_nested_element('response_dates');

$responsedate = new backup_nested_element('response_date', ['id'], ['response_id', 'question_id', 'response']);
$responsedate = new backup_nested_element('response_date', ['id'], ['responseid', 'questionid', 'response']);

$responsefiles = new backup_nested_element('response_files');

$responsefile = new backup_nested_element('response_file', ['id'], ['response_id', 'question_id', 'fileid']);
$responsefile = new backup_nested_element('response_file', ['id'], ['responseid', 'questionid', 'fileid']);

$responsemultiples = new backup_nested_element('response_multiples');

$responsemultiple = new backup_nested_element('response_multiple', ['id'], [
'response_id',
'question_id',
'choice_id',
'responseid',
'questionid',
'choiceid',
]);

$responseothers = new backup_nested_element('response_others');

$responseother = new backup_nested_element('response_other', ['id'], [
'response_id',
'question_id',
'choice_id',
'responseid',
'questionid',
'choiceid',
'response',
]);

$responseranks = new backup_nested_element('response_ranks');

$responserank = new backup_nested_element('response_rank', ['id'], [
'response_id',
'question_id',
'choice_id',
'responseid',
'questionid',
'choiceid',
'rankvalue',
]);

$responsesingles = new backup_nested_element('response_singles');

$responsesingle = new backup_nested_element('response_single', ['id'], [
'response_id',
'question_id',
'choice_id',
'responseid',
'questionid',
'choiceid',
]);

$responsetexts = new backup_nested_element('response_texts');

$responsetext = new backup_nested_element('response_text', ['id'], ['response_id', 'question_id', 'response']);
$responsetext = new backup_nested_element('response_text', ['id'], ['responseid', 'questionid', 'response']);

// Build the tree.
$questionnaire->add_child($surveys);
Expand Down Expand Up @@ -255,21 +255,21 @@ protected function define_structure() {
$question->set_source_table('questionnaire_question', ['surveyid' => backup::VAR_PARENTID]);
$fbsection->set_source_table('questionnaire_fb_sections', ['surveyid' => backup::VAR_PARENTID]);
$feedback->set_source_table('questionnaire_feedback', ['sectionid' => backup::VAR_PARENTID]);
$questchoice->set_source_table('questionnaire_quest_choice', ['question_id' => backup::VAR_PARENTID], 'id ASC');
$questchoice->set_source_table('questionnaire_quest_choice', ['questionid' => backup::VAR_PARENTID], 'id ASC');
$questdependency->set_source_table('questionnaire_dependency', ['questionid' => backup::VAR_PARENTID]);

// All the rest of elements only happen if we are including user info.
if ($userinfo) {
$response->set_source_table('questionnaire_response', ['questionnaireid' => backup::VAR_PARENTID]);
$responsebool->set_source_table('questionnaire_response_bool', ['response_id' => backup::VAR_PARENTID]);
$responsedate->set_source_table('questionnaire_response_date', ['response_id' => backup::VAR_PARENTID]);
$responsefile->set_source_table('questionnaire_response_file', ['response_id' => backup::VAR_PARENTID]);
$responsebool->set_source_table('questionnaire_response_bool', ['responseid' => backup::VAR_PARENTID]);
$responsedate->set_source_table('questionnaire_response_date', ['responseid' => backup::VAR_PARENTID]);
$responsefile->set_source_table('questionnaire_response_file', ['responseid' => backup::VAR_PARENTID]);
$responsefile->annotate_files('mod_questionnaire', 'response_file', null);
$responsemultiple->set_source_table('questionnaire_resp_multiple', ['response_id' => backup::VAR_PARENTID]);
$responseother->set_source_table('questionnaire_response_other', ['response_id' => backup::VAR_PARENTID]);
$responserank->set_source_table('questionnaire_response_rank', ['response_id' => backup::VAR_PARENTID]);
$responsesingle->set_source_table('questionnaire_resp_single', ['response_id' => backup::VAR_PARENTID]);
$responsetext->set_source_table('questionnaire_response_text', ['response_id' => backup::VAR_PARENTID]);
$responsemultiple->set_source_table('questionnaire_resp_multiple', ['responseid' => backup::VAR_PARENTID]);
$responseother->set_source_table('questionnaire_response_other', ['responseid' => backup::VAR_PARENTID]);
$responserank->set_source_table('questionnaire_response_rank', ['responseid' => backup::VAR_PARENTID]);
$responsesingle->set_source_table('questionnaire_resp_single', ['responseid' => backup::VAR_PARENTID]);
$responsetext->set_source_table('questionnaire_response_text', ['responseid' => backup::VAR_PARENTID]);
}

// Define id annotations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function define_decode_contents() {
$contents[] = new restore_decode_content('questionnaire', ['intro'], 'questionnaire');
$contents[] = new restore_decode_content(
'questionnaire_survey',
['info', 'thank_head', 'thank_body', 'thanks_page', 'feedbacknotes'],
['info', 'thankhead', 'thankbody', 'thankspage', 'feedbacknotes'],
'questionnaire_survey'
);
$contents[] = new restore_decode_content('questionnaire_question', ['content'], 'questionnaire_question');
Expand Down
Loading
Loading