Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 25... Línea 25...
25
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 */
26
 */
Línea 27... Línea 27...
27
 
27
 
Línea -... Línea 28...
-
 
28
defined('MOODLE_INTERNAL') || die();
-
 
29
 
28
defined('MOODLE_INTERNAL') || die();
30
use core_question\local\bank\random_question_loader;
29
 
31
 
30
/**
32
/**
31
 * Create the temp dir where backup/restore will happen and create temp ids table.
33
 * Create the temp dir where backup/restore will happen and create temp ids table.
Línea 117... Línea 119...
117
        $activity->set_source_array($activityarr);
119
        $activity->set_source_array($activityarr);
Línea 118... Línea 120...
118
 
120
 
119
        // Return the root element (activity)
121
        // Return the root element (activity)
120
        return $activity;
122
        return $activity;
-
 
123
    }
-
 
124
 
-
 
125
    /**
-
 
126
     * Set a delegate section itemid mapping.
-
 
127
     *
-
 
128
     * @param string $pluginname the name of the plugin that is delegating the section.
-
 
129
     * @param int $itemid the itemid of the section being delegated.
-
 
130
     */
-
 
131
    protected function set_delegated_section_mapping(string $pluginname, int $itemid) {
-
 
132
        backup_structure_dbops::insert_backup_ids_record(
-
 
133
            $this->get_backupid(),
-
 
134
            "course_section::$pluginname::$itemid",
-
 
135
            $this->task->get_moduleid()
-
 
136
        );
121
    }
137
    }
Línea 122... Línea 138...
122
}
138
}
123
 
139
 
124
/**
140
/**
Línea 222... Línea 238...
222
            'usingcontextid' => backup::VAR_CONTEXTID,
238
            'usingcontextid' => backup::VAR_CONTEXTID,
223
            'component' => backup_helper::is_sqlparam($component),
239
            'component' => backup_helper::is_sqlparam($component),
224
            'questionarea' => backup_helper::is_sqlparam($questionarea),
240
            'questionarea' => backup_helper::is_sqlparam($questionarea),
225
            'itemid' => backup::VAR_PARENTID
241
            'itemid' => backup::VAR_PARENTID
226
        ]);
242
        ]);
-
 
243
 
-
 
244
        $reference->annotate_ids('question_bank_entry', 'questionbankentryid');
227
    }
245
    }
228
}
246
}
Línea 229... Línea 247...
229
 
247
 
230
/**
248
/**
Línea 255... Línea 273...
255
            'component' => backup_helper::is_sqlparam($component),
273
            'component' => backup_helper::is_sqlparam($component),
256
            'questionarea' => backup_helper::is_sqlparam($questionarea),
274
            'questionarea' => backup_helper::is_sqlparam($questionarea),
257
            'itemid' => backup::VAR_PARENTID
275
            'itemid' => backup::VAR_PARENTID
258
        ]);
276
        ]);
259
    }
277
    }
-
 
278
 
-
 
279
    /**
-
 
280
     * Find all questions that match set reference conditions used by the activity, and record the question bank entry IDs.
-
 
281
     *
-
 
282
     * @param int $contextid The context ID of the activity being backed up
-
 
283
     * @param string $component The component of the activity
-
 
284
     * @param string $questionarea The question area for finding set references
-
 
285
     * @param string $backupid The backup ID to annotate question bank entries against
-
 
286
     */
-
 
287
    protected function annotate_set_reference_bank_entries(
-
 
288
        int $contextid,
-
 
289
        string $component,
-
 
290
        string $questionarea,
-
 
291
        string $backupid,
-
 
292
    ): void {
-
 
293
        global $DB;
-
 
294
        $setreferenceconditions = $DB->get_fieldset(
-
 
295
            'question_set_references',
-
 
296
            'filtercondition',
-
 
297
            [
-
 
298
                'usingcontextid' => $contextid,
-
 
299
                'component' => $component,
-
 
300
                'questionarea' => $questionarea,
-
 
301
            ],
-
 
302
        );
-
 
303
        if (empty($setreferenceconditions)) {
-
 
304
            return;
-
 
305
        }
-
 
306
        $setreferencequestionids = [];
-
 
307
        $randomloader = new random_question_loader(new qubaid_list([]), []);
-
 
308
 
-
 
309
        foreach ($setreferenceconditions as $setreferencecondition) {
-
 
310
            $conditions = json_decode($setreferencecondition, true);
-
 
311
            $setreferencequestionids += array_keys($randomloader->get_filtered_questions($conditions['filter'], 0));
-
 
312
        }
-
 
313
        if (empty($setreferencequestionids)) {
-
 
314
            return;
-
 
315
        }
-
 
316
        [$insql, $inparams] = $DB->get_in_or_equal($setreferencequestionids);
-
 
317
        $qbeids = $DB->get_fieldset_select(
-
 
318
            'question_versions',
-
 
319
            'questionbankentryid',
-
 
320
            "questionid {$insql}",
-
 
321
            $inparams,
-
 
322
        );
-
 
323
 
-
 
324
        foreach ($qbeids as $qbeid) {
-
 
325
            backup_structure_dbops::insert_backup_ids_record($backupid, 'question_bank_entry', $qbeid);
-
 
326
        }
-
 
327
    }
260
}
328
}
Línea 261... Línea 329...
261
 
329
 
262
 
330
 
Línea 555... Línea 623...
555
        // We only need to deal with course level (sectionid = 0) here.
623
        // We only need to deal with course level (sectionid = 0) here.
556
        $courseformatoption->set_source_sql('SELECT id, format, sectionid, name, value
624
        $courseformatoption->set_source_sql('SELECT id, format, sectionid, name, value
557
                                 FROM {course_format_options}
625
                                 FROM {course_format_options}
558
                                 WHERE courseid = ? AND sectionid = 0', [ backup::VAR_PARENTID ]);
626
                                 WHERE courseid = ? AND sectionid = 0', [ backup::VAR_PARENTID ]);
Línea -... Línea 627...
-
 
627
 
-
 
628
        // Custom fields.
559
 
629
        if ($this->get_setting_value('customfield')) {
560
        $handler = core_course\customfield\course_handler::create();
630
            $handler = core_course\customfield\course_handler::create();
561
        $fieldsforbackup = $handler->get_instance_data_for_backup($this->task->get_courseid());
631
            $fieldsforbackup = $handler->get_instance_data_for_backup($this->task->get_courseid());
562
        $handler->backup_define_structure($this->task->get_courseid(), $customfield);
632
            $handler->backup_define_structure($this->task->get_courseid(), $customfield);
-
 
633
            $customfield->set_source_array($fieldsforbackup);
Línea 563... Línea 634...
563
        $customfield->set_source_array($fieldsforbackup);
634
        }
Línea 564... Línea 635...
564
 
635
 
Línea 898... Línea 969...
898
 * structure step in charge of constructing the badges.xml file for all the badges found
969
 * structure step in charge of constructing the badges.xml file for all the badges found
899
 * in a given context
970
 * in a given context
900
 */
971
 */
901
class backup_badges_structure_step extends backup_structure_step {
972
class backup_badges_structure_step extends backup_structure_step {
Línea 902... Línea -...
902
 
-
 
903
    protected function execute_condition() {
-
 
904
        // Check that all activities have been included.
-
 
905
        if ($this->task->is_excluding_activities()) {
-
 
906
            return false;
-
 
907
        }
-
 
908
        return true;
-
 
909
    }
-
 
910
 
973
 
911
    protected function define_structure() {
974
    protected function define_structure() {
Línea 912... Línea 975...
912
        global $CFG;
975
        global $CFG;
913
 
976
 
Línea 917... Línea 980...
917
        $badges = new backup_nested_element('badges');
980
        $badges = new backup_nested_element('badges');
918
        $badge = new backup_nested_element('badge', array('id'), array('name', 'description',
981
        $badge = new backup_nested_element('badge', array('id'), array('name', 'description',
919
                'timecreated', 'timemodified', 'usercreated', 'usermodified', 'issuername',
982
                'timecreated', 'timemodified', 'usercreated', 'usermodified', 'issuername',
920
                'issuerurl', 'issuercontact', 'expiredate', 'expireperiod', 'type', 'courseid',
983
                'issuerurl', 'issuercontact', 'expiredate', 'expireperiod', 'type', 'courseid',
921
                'message', 'messagesubject', 'attachment', 'notification', 'status', 'nextcron',
984
                'message', 'messagesubject', 'attachment', 'notification', 'status', 'nextcron',
922
                'version', 'language', 'imageauthorname', 'imageauthoremail', 'imageauthorurl',
-
 
923
                'imagecaption'));
985
                'version', 'language', 'imagecaption'));
Línea 924... Línea 986...
924
 
986
 
925
        $criteria = new backup_nested_element('criteria');
987
        $criteria = new backup_nested_element('criteria');
926
        $criterion = new backup_nested_element('criterion', array('id'), array('badgeid',
988
        $criterion = new backup_nested_element('criterion', array('id'), array('badgeid',
Línea 949... Línea 1011...
949
        $tag = new backup_nested_element('tag', ['id'], ['name', 'rawname']);
1011
        $tag = new backup_nested_element('tag', ['id'], ['name', 'rawname']);
Línea 950... Línea 1012...
950
 
1012
 
Línea 951... Línea 1013...
951
        // Build the tree.
1013
        // Build the tree.
-
 
1014
 
-
 
1015
        $badges->add_child($badge);
-
 
1016
 
-
 
1017
        // Have the activities been included? Only if that's the case, the criteria will be included too.
952
 
1018
        $activitiesincluded = !$this->task->is_excluding_activities();
953
        $badges->add_child($badge);
1019
        if ($activitiesincluded) {
954
        $badge->add_child($criteria);
1020
            $badge->add_child($criteria);
955
        $criteria->add_child($criterion);
1021
            $criteria->add_child($criterion);
-
 
1022
            $criterion->add_child($parameters);
-
 
1023
            $parameters->add_child($parameter);
956
        $criterion->add_child($parameters);
1024
        }
957
        $parameters->add_child($parameter);
1025
 
958
        $badge->add_child($endorsement);
1026
        $badge->add_child($endorsement);
959
        $badge->add_child($alignments);
1027
        $badge->add_child($alignments);
960
        $alignments->add_child($alignment);
1028
        $alignments->add_child($alignment);
Línea 974... Línea 1042...
974
                AND status != ' . BADGE_STATUS_ARCHIVED;
1042
                AND status != ' . BADGE_STATUS_ARCHIVED;
975
        $parameterparams = [
1043
        $parameterparams = [
976
            'courseid' => backup::VAR_COURSEID
1044
            'courseid' => backup::VAR_COURSEID
977
        ];
1045
        ];
978
        $badge->set_source_sql($parametersql, $parameterparams);
1046
        $badge->set_source_sql($parametersql, $parameterparams);
-
 
1047
        if ($activitiesincluded) {
979
        $criterion->set_source_table('badge_criteria', array('badgeid' => backup::VAR_PARENTID));
1048
            $criterion->set_source_table('badge_criteria', ['badgeid' => backup::VAR_PARENTID]);
-
 
1049
            $parametersql = 'SELECT cp.*, c.criteriatype
-
 
1050
                               FROM {badge_criteria_param} cp JOIN {badge_criteria} c
-
 
1051
                                 ON cp.critid = c.id
-
 
1052
                              WHERE critid = :critid';
-
 
1053
            $parameterparams = ['critid' => backup::VAR_PARENTID];
-
 
1054
            $parameter->set_source_sql($parametersql, $parameterparams);
-
 
1055
        }
980
        $endorsement->set_source_table('badge_endorsement', array('badgeid' => backup::VAR_PARENTID));
1056
        $endorsement->set_source_table('badge_endorsement', array('badgeid' => backup::VAR_PARENTID));
Línea 981... Línea 1057...
981
 
1057
 
982
        $alignment->set_source_table('badge_alignment', array('badgeid' => backup::VAR_PARENTID));
1058
        $alignment->set_source_table('badge_alignment', array('badgeid' => backup::VAR_PARENTID));
Línea 983... Línea -...
983
        $relatedbadge->set_source_table('badge_related', array('badgeid' => backup::VAR_PARENTID));
-
 
984
 
-
 
985
        $parametersql = 'SELECT cp.*, c.criteriatype
-
 
986
                             FROM {badge_criteria_param} cp JOIN {badge_criteria} c
-
 
987
                                 ON cp.critid = c.id
-
 
988
                             WHERE critid = :critid';
-
 
989
        $parameterparams = array('critid' => backup::VAR_PARENTID);
-
 
990
        $parameter->set_source_sql($parametersql, $parameterparams);
1059
        $relatedbadge->set_source_table('badge_related', array('badgeid' => backup::VAR_PARENTID));
Línea 991... Línea 1060...
991
 
1060
 
992
        $manual_award->set_source_table('badge_manual_award', array('badgeid' => backup::VAR_PARENTID));
1061
        $manual_award->set_source_table('badge_manual_award', array('badgeid' => backup::VAR_PARENTID));
993
 
1062
 
Línea 999... Línea 1068...
999
 
1068
 
Línea 1000... Línea 1069...
1000
        // Define id annotations.
1069
        // Define id annotations.
1001
 
1070
 
-
 
1071
        $badge->annotate_ids('user', 'usercreated');
1002
        $badge->annotate_ids('user', 'usercreated');
1072
        $badge->annotate_ids('user', 'usermodified');
1003
        $badge->annotate_ids('user', 'usermodified');
1073
        if ($activitiesincluded) {
-
 
1074
            $criterion->annotate_ids('badge', 'badgeid');
1004
        $criterion->annotate_ids('badge', 'badgeid');
1075
            $parameter->annotate_ids('criterion', 'critid');
1005
        $parameter->annotate_ids('criterion', 'critid');
1076
        }
1006
        $endorsement->annotate_ids('badge', 'badgeid');
1077
        $endorsement->annotate_ids('badge', 'badgeid');
1007
        $alignment->annotate_ids('badge', 'badgeid');
1078
        $alignment->annotate_ids('badge', 'badgeid');
1008
        $relatedbadge->annotate_ids('badge', 'badgeid');
1079
        $relatedbadge->annotate_ids('badge', 'badgeid');
Línea 1407... Línea 1478...
1407
            $group->set_source_sql("
1478
            $group->set_source_sql("
1408
                SELECT g.*
1479
                SELECT g.*
1409
                  FROM {groups} g
1480
                  FROM {groups} g
1410
                  JOIN {backup_ids_temp} bi ON g.id = bi.itemid
1481
                  JOIN {backup_ids_temp} bi ON g.id = bi.itemid
1411
                 WHERE bi.backupid = ?
1482
                 WHERE bi.backupid = ?
1412
                   AND bi.itemname = 'groupfinal'", array(backup::VAR_BACKUPID));
1483
                   AND bi.itemname = 'groupfinal'",
-
 
1484
                [backup_helper::is_sqlparam($this->get_backupid())]
-
 
1485
            );
Línea 1413... Línea 1486...
1413
 
1486
 
1414
            $grouping->set_source_sql("
1487
            $grouping->set_source_sql("
1415
                SELECT g.*
1488
                SELECT g.*
1416
                  FROM {groupings} g
1489
                  FROM {groupings} g
1417
                  JOIN {backup_ids_temp} bi ON g.id = bi.itemid
1490
                  JOIN {backup_ids_temp} bi ON g.id = bi.itemid
1418
                 WHERE bi.backupid = ?
1491
                 WHERE bi.backupid = ?
-
 
1492
                   AND bi.itemname = 'groupingfinal'",
-
 
1493
                [backup_helper::is_sqlparam($this->get_backupid())]
-
 
1494
            );
1419
                   AND bi.itemname = 'groupingfinal'", array(backup::VAR_BACKUPID));
1495
 
Línea 1420... Línea 1496...
1420
            $groupinggroup->set_source_table('groupings_groups', array('groupingid' => backup::VAR_PARENTID));
1496
            $groupinggroup->set_source_table('groupings_groups', array('groupingid' => backup::VAR_PARENTID));
1421
 
1497
 
1422
            // This only happens if we are including users.
1498
            // This only happens if we are including users.
1423
            if ($userinfo) {
1499
            if ($userinfo) {
Línea -... Línea 1500...
-
 
1500
                $member->set_source_table('groups_members', array('groupid' => backup::VAR_PARENTID));
-
 
1501
            }
-
 
1502
 
-
 
1503
            // Custom fields.
1424
                $member->set_source_table('groups_members', array('groupid' => backup::VAR_PARENTID));
1504
            if ($this->get_setting_value('customfield')) {
-
 
1505
                $groupcustomfieldarray = $this->get_group_custom_fields_for_backup(
1425
            }
1506
                    $group->get_source_sql(),
-
 
1507
                    [$this->get_backupid()]
1426
 
1508
                );
-
 
1509
                $groupcustomfield->set_source_array($groupcustomfieldarray);
-
 
1510
 
-
 
1511
                $groupingcustomfieldarray = $this->get_grouping_custom_fields_for_backup(
-
 
1512
                    $grouping->get_source_sql(),
-
 
1513
                    [$this->get_backupid()]
1427
            $courseid = $this->task->get_courseid();
1514
                );
Línea 1428... Línea 1515...
1428
            $groupcustomfield->set_source_array($this->get_group_custom_fields_for_backup($courseid));
1515
                $groupingcustomfield->set_source_array($groupingcustomfieldarray);
Línea 1429... Línea 1516...
1429
            $groupingcustomfield->set_source_array($this->get_grouping_custom_fields_for_backup($courseid));
1516
            }
Línea 1443... Línea 1530...
1443
        return $groups;
1530
        return $groups;
1444
    }
1531
    }
Línea 1445... Línea 1532...
1445
 
1532
 
1446
    /**
1533
    /**
-
 
1534
     * Get custom fields array for group
1447
     * Get custom fields array for group
1535
     *
-
 
1536
     * @param string $groupsourcesql
1448
     * @param int $courseid
1537
     * @param array $groupsourceparams
1449
     * @return array
1538
     * @return array
1450
     */
1539
     */
1451
    protected function get_group_custom_fields_for_backup(int $courseid): array {
1540
    protected function get_group_custom_fields_for_backup(string $groupsourcesql, array $groupsourceparams): array {
1452
        global $DB;
1541
        global $DB;
1453
        $handler = \core_group\customfield\group_handler::create();
1542
        $handler = \core_group\customfield\group_handler::create();
1454
        $fieldsforbackup = [];
1543
        $fieldsforbackup = [];
1455
        if ($groups = $DB->get_records('groups', ['courseid' => $courseid], '', 'id')) {
1544
        if ($groups = $DB->get_records_sql($groupsourcesql, $groupsourceparams)) {
1456
            foreach ($groups as $group) {
1545
            foreach ($groups as $group) {
1457
                $fieldsforbackup = array_merge($fieldsforbackup, $handler->get_instance_data_for_backup($group->id));
1546
                $fieldsforbackup = array_merge($fieldsforbackup, $handler->get_instance_data_for_backup($group->id));
1458
            }
1547
            }
1459
        }
1548
        }
1460
        return $fieldsforbackup;
1549
        return $fieldsforbackup;
Línea 1461... Línea 1550...
1461
    }
1550
    }
1462
 
1551
 
-
 
1552
    /**
1463
    /**
1553
     * Get custom fields array for grouping
-
 
1554
     *
1464
     * Get custom fields array for grouping
1555
     * @param string $groupingsourcesql
1465
     * @param int $courseid
1556
     * @param array $groupingsourceparams
1466
     * @return array
1557
     * @return array
1467
     */
1558
     */
1468
    protected function get_grouping_custom_fields_for_backup(int $courseid): array {
1559
    protected function get_grouping_custom_fields_for_backup(string $groupingsourcesql, array $groupingsourceparams): array {
1469
        global $DB;
1560
        global $DB;
1470
        $handler = \core_group\customfield\grouping_handler::create();
1561
        $handler = \core_group\customfield\grouping_handler::create();
1471
        $fieldsforbackup = [];
1562
        $fieldsforbackup = [];
1472
        if ($groupings = $DB->get_records('groupings', ['courseid' => $courseid], '', 'id')) {
1563
        if ($groupings = $DB->get_records_sql($groupingsourcesql, $groupingsourceparams)) {
1473
            foreach ($groupings as $grouping) {
1564
            foreach ($groupings as $grouping) {
1474
                $fieldsforbackup = array_merge($fieldsforbackup, $handler->get_instance_data_for_backup($grouping->id));
1565
                $fieldsforbackup = array_merge($fieldsforbackup, $handler->get_instance_data_for_backup($grouping->id));
1475
            }
1566
            }
Línea 2120... Línea 2211...
2120
 
2211
 
Línea 2121... Línea 2212...
2121
        $contents = new backup_nested_element('contents');
2212
        $contents = new backup_nested_element('contents');
Línea 2122... Línea 2213...
2122
 
2213
 
-
 
2214
        $activities = new backup_nested_element('activities');
-
 
2215
 
2123
        $activities = new backup_nested_element('activities');
2216
        $activity = new backup_nested_element(
2124
 
2217
            'activity',
Línea 2125... Línea 2218...
2125
        $activity = new backup_nested_element('activity', null, array(
2218
            null,
Línea 2126... Línea 2219...
2126
            'moduleid', 'sectionid', 'modulename', 'title',
2219
            ['moduleid', 'sectionid', 'modulename', 'title', 'directory', 'insubsection']
-
 
2220
        );
-
 
2221
 
2127
            'directory'));
2222
        $sections = new backup_nested_element('sections');
-
 
2223
 
Línea 2128... Línea 2224...
2128
 
2224
        $section = new backup_nested_element(
2129
        $sections = new backup_nested_element('sections');
2225
            'section',
Línea 2130... Línea 2226...
2130
 
2226
            null,
Línea 2499... Línea 2595...
2499
 * question categories and questions required by the backup
2595
 * question categories and questions required by the backup
2500
 * and letters related to one activity.
2596
 * and letters related to one activity.
2501
 */
2597
 */
2502
class backup_questions_structure_step extends backup_structure_step {
2598
class backup_questions_structure_step extends backup_structure_step {
Línea -... Línea 2599...
-
 
2599
 
-
 
2600
    #[\Override]
-
 
2601
    public function execute() {
-
 
2602
        global $DB;
-
 
2603
        backup_controller_dbops::create_question_category_temp_tables();
-
 
2604
        $DB->execute("INSERT INTO {question_category_complete_temp} (backupid, itemid)
-
 
2605
            SELECT backupid, itemid
-
 
2606
             FROM {backup_ids_temp}
-
 
2607
            WHERE itemname = 'question_category_complete'");
-
 
2608
        $DB->execute("INSERT INTO {question_category_partial_temp} (backupid, itemid)
-
 
2609
            SELECT backupid, itemid
-
 
2610
             FROM {backup_ids_temp}
-
 
2611
            WHERE itemname = 'question_category_partial'");
-
 
2612
        $results = parent::execute();
-
 
2613
        backup_controller_dbops::drop_question_category_temp_tables();
-
 
2614
        return $results;
-
 
2615
    }
2503
 
2616
 
Línea 2504... Línea 2617...
2504
    protected function define_structure() {
2617
    protected function define_structure() {
2505
 
2618
 
Línea 2601... Línea 2714...
2601
              JOIN {backup_ids_temp} bi ON bi.itemid = gc.id
2714
              JOIN {backup_ids_temp} bi ON bi.itemid = gc.id
2602
              JOIN {context} co ON co.id = gc.contextid
2715
              JOIN {context} co ON co.id = gc.contextid
2603
             WHERE bi.backupid = ?
2716
             WHERE bi.backupid = ?
2604
               AND bi.itemname = 'question_categoryfinal'", [backup::VAR_BACKUPID]);
2717
               AND bi.itemname = 'question_categoryfinal'", [backup::VAR_BACKUPID]);
Línea 2605... Línea 2718...
2605
 
2718
 
-
 
2719
        // Add all question bank entries from "complete" categories, plus annotated question bank entires
-
 
2720
        // from "partial" categories.
-
 
2721
        $questionbankentry->set_source_sql(
-
 
2722
            "
-
 
2723
                SELECT qbe.*
-
 
2724
                 FROM {question_bank_entries} qbe
-
 
2725
                 JOIN {question_category_complete_temp} qcc ON qcc.itemid = qbe.questioncategoryid
-
 
2726
                WHERE qcc.itemid = ?
-
 
2727
                      AND qcc.backupid = ?
-
 
2728
                UNION
-
 
2729
                SELECT qbe.*
-
 
2730
                 FROM {question_bank_entries} qbe
-
 
2731
                 JOIN {question_category_partial_temp} qcp ON qcp.itemid = qbe.questioncategoryid
-
 
2732
                 JOIN {backup_ids_temp} biq ON biq.itemid = qbe.id
-
 
2733
                WHERE qcp.itemid = ?
-
 
2734
                      AND qcp.backupid = ?
-
 
2735
                      AND biq.backupid = ?
-
 
2736
                      AND biq.itemname = 'question_bank_entry'
-
 
2737
            ",
-
 
2738
            [
-
 
2739
                backup::VAR_PARENTID,
-
 
2740
                backup::VAR_BACKUPID,
-
 
2741
                backup::VAR_PARENTID,
-
 
2742
                backup::VAR_BACKUPID,
-
 
2743
                backup::VAR_BACKUPID,
-
 
2744
            ],
Línea 2606... Línea 2745...
2606
        $questionbankentry->set_source_table('question_bank_entries', ['questioncategoryid' => backup::VAR_PARENTID]);
2745
        );
Línea 2607... Línea 2746...
2607
 
2746
 
2608
        $questionverion->set_source_table('question_versions', ['questionbankentryid' => backup::VAR_PARENTID]);
2747
        $questionverion->set_source_table('question_versions', ['questionbankentryid' => backup::VAR_PARENTID]);