|
33 | 33 | $qid = optional_param('qid', 0, PARAM_INT); // Question id. |
34 | 34 | $moveq = optional_param('moveq', 0, PARAM_INT); // Question id to move. |
35 | 35 | $delq = optional_param('delq', 0, PARAM_INT); // Question id to delete. |
36 | | -$qtype = optional_param('type_id', 0, PARAM_INT); // Question type. |
| 36 | +$qtype = optional_param('typeid', 0, PARAM_INT); // Question type. |
37 | 37 | $currentgroupid = optional_param('group', 0, PARAM_INT); // Group id. |
38 | 38 | $delpermanentlyq = optional_param('delpermanentlyq', 0, PARAM_INT); // Question id to delete. |
39 | 39 | $restoreq = optional_param(QUESTIONNAIRE_RESTORE_PARAM, 0, PARAM_INT); // Question id to restore question. |
|
96 | 96 | ['sid' => $sid], |
97 | 97 | 'id' |
98 | 98 | ); |
99 | | - if (isset($questions[$qid]) && $questions[$qid]->type_id == question::QUESPAGEBREAK) { |
| 99 | + if (isset($questions[$qid]) && $questions[$qid]->typeid == question::QUESPAGEBREAK) { |
100 | 100 | $DB->delete_records('questionnaire_question', ['id' => $qid]); |
101 | 101 | } else { |
102 | 102 | $updatesql = "UPDATE {questionnaire_question} |
|
144 | 144 | } |
145 | 145 |
|
146 | 146 | // Log question deleted event. |
147 | | - $questiontype = \mod_questionnaire\local\question\question::qtypename($questionnaire->questions[$qid]->type_id); |
| 147 | + $questiontype = \mod_questionnaire\local\question\question::qtypename($questionnaire->questions[$qid]->typeid); |
148 | 148 | questionnaire_observe_event_delete($questionnaire->cm->id, $questiontype, $questionnaire->course->id); |
149 | 149 |
|
150 | 150 | if ($questionnairehasdependencies) { |
|
160 | 160 | questionnaire_delete_permanently_questions($qid, $sid); |
161 | 161 | $deletedquestion = $questionnaire->deletequestions[$qid] ?? null; |
162 | 162 | if ($deletedquestion !== null) { |
163 | | - $questiontype = \mod_questionnaire\local\question\question::qtypename($deletedquestion->type_id); |
| 163 | + $questiontype = \mod_questionnaire\local\question\question::qtypename($deletedquestion->typeid); |
164 | 164 | questionnaire_observe_event_delete($questionnaire->cm->id, $questiontype, $questionnaire->course->id); |
165 | 165 | $url = new moodle_url('/mod/questionnaire/questions.php', ['id' => $questionnaire->cm->id]); |
166 | 166 | $PAGE->set_url($url->out(false)); |
|
225 | 225 | // Need to use the key, since IE returns the image position as the value rather than the specified |
226 | 226 | // value in the <input> tag. |
227 | 227 | $qid = key($qformdata->removebutton); |
228 | | - $qtype = $questionnaire->questions[$qid]->type_id; |
| 228 | + $qtype = $questionnaire->questions[$qid]->typeid; |
229 | 229 |
|
230 | 230 | // Delete section breaks without asking for confirmation. |
231 | 231 | if ($qtype == question::QUESPAGEBREAK) { |
|
261 | 261 |
|
262 | 262 | $reload = true; |
263 | 263 | } else if (isset($qformdata->addqbutton)) { |
264 | | - if ($qformdata->type_id == question::QUESPAGEBREAK) { // Adding section break is handled right away.... |
| 264 | + if ($qformdata->typeid == question::QUESPAGEBREAK) { // Adding section break is handled right away.... |
265 | 265 | $questionrec = new stdClass(); |
266 | 266 | $questionrec->surveyid = $qformdata->sid; |
267 | | - $questionrec->type_id = question::QUESPAGEBREAK; |
| 267 | + $questionrec->typeid = question::QUESPAGEBREAK; |
268 | 268 | $questionrec->content = 'break'; |
269 | 269 | $question = question::question_builder(question::QUESPAGEBREAK); |
270 | 270 | $question->add($questionrec); |
271 | 271 | $reload = true; |
272 | 272 | } else { |
273 | 273 | // Switch to edit question screen. |
274 | 274 | $action = 'question'; |
275 | | - $qtype = $qformdata->type_id; |
| 275 | + $qtype = $qformdata->typeid; |
276 | 276 | $qid = 0; |
277 | 277 | $reload = true; |
278 | 278 | } |
|
335 | 335 |
|
336 | 336 | questionnaire_check_page_breaks($questionnaire); |
337 | 337 | $SESSION->questionnaire->required = $qformdata->required; |
338 | | - $SESSION->questionnaire->type_id = $qformdata->type_id; |
| 338 | + $SESSION->questionnaire->typeid = $qformdata->typeid; |
339 | 339 | // Switch to main screen. |
340 | 340 | $action = 'main'; |
341 | 341 | $reload = true; |
|
344 | 344 | // Log question created event. |
345 | 345 | if (isset($qformdata)) { |
346 | 346 | $context = context_module::instance($questionnaire->cm->id); |
347 | | - $questiontype = \mod_questionnaire\local\question\question::qtypename($qformdata->type_id); |
| 347 | + $questiontype = \mod_questionnaire\local\question\question::qtypename($qformdata->typeid); |
348 | 348 | $params = [ |
349 | 349 | 'context' => $context, |
350 | 350 | 'courseid' => $questionnaire->course->id, |
|
388 | 388 | // Print the page header. |
389 | 389 | if ($action == 'question') { |
390 | 390 | if (isset($question->qid)) { |
391 | | - $streditquestion = get_string('editquestion', 'questionnaire', questionnaire_get_type($question->type_id)); |
| 391 | + $streditquestion = get_string('editquestion', 'questionnaire', questionnaire_get_type($question->typeid)); |
392 | 392 | } else { |
393 | | - $streditquestion = get_string('addnewquestion', 'questionnaire', questionnaire_get_type($question->type_id)); |
| 393 | + $streditquestion = get_string('addnewquestion', 'questionnaire', questionnaire_get_type($question->typeid)); |
394 | 394 | } |
395 | 395 | } else { |
396 | 396 | $streditquestion = get_string('managequestions', 'questionnaire'); |
|
405 | 405 | if ($action == "confirmdelquestion" || $action == "confirmdelquestionparent") { |
406 | 406 | $qid = key($qformdata->removebutton); |
407 | 407 | $question = $questionnaire->questions[$qid]; |
408 | | - $qtype = $question->type_id; |
| 408 | + $qtype = $question->typeid; |
409 | 409 |
|
410 | 410 | $countresps = count_reponses_question($qid, $qtype); |
411 | 411 |
|
|
452 | 452 | $questionnaire->page->add_to_page('formarea', $questionnaire->renderer->confirm($msg, $buttonyes, $buttonno)); |
453 | 453 | } else if ($action === QUESTIONNAIRE_CONFIRM_DELETE_PERMANENTLY) { |
454 | 454 | $qid = key($qformdata->deletebutton); |
455 | | - $qtype = $questionnaire->deletequestions[$qid]->type_id; |
| 455 | + $qtype = $questionnaire->deletequestions[$qid]->typeid; |
456 | 456 | $questiondelete = $questionnaire->deletequestions[$qid]; |
457 | 457 | $countresps = count_reponses_question($qid, $qtype); |
458 | 458 |
|
|
0 commit comments