mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
MDL-79863 qtype_ordering: Moodle.2x qtype/ordering use standard message to report DB insert/update errors
This commit is contained in:
parent
3a109f946a
commit
cd7f80ef5c
1 changed files with 2 additions and 4 deletions
|
@ -86,8 +86,7 @@ class qtype_ordering extends question_type {
|
||||||
|
|
||||||
if ($answer->id = array_shift($answerids)) {
|
if ($answer->id = array_shift($answerids)) {
|
||||||
if (! $DB->update_record('question_answers', $answer)) {
|
if (! $DB->update_record('question_answers', $answer)) {
|
||||||
$a = 'question_answers (id='.$answer->id.')';
|
$result->error = get_string('cannotupdaterecord', 'error', 'question_answers (id='.$answer->id.')');
|
||||||
$result->error = get_string('cannotupdaterecord', 'error', $a);
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,8 +110,7 @@ class qtype_ordering extends question_type {
|
||||||
// add/update $options for this ordering question
|
// add/update $options for this ordering question
|
||||||
if ($options->id = $DB->get_field('question_ordering', 'id', array('question' => $question->id))) {
|
if ($options->id = $DB->get_field('question_ordering', 'id', array('question' => $question->id))) {
|
||||||
if (! $DB->update_record('question_ordering', $options)) {
|
if (! $DB->update_record('question_ordering', $options)) {
|
||||||
$a = 'question_ordering (id='.$options->id.')';
|
$result->error = get_string('cannotupdaterecord', 'error', 'question_ordering (id='.$options->id.')');
|
||||||
$result->error = get_string('cannotupdaterecord', 'error', $a);
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue