mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 22:50:19 +01:00
Removed warning when deleting questions with no states
This commit is contained in:
parent
d7bc70247c
commit
5cb9076a58
@ -364,12 +364,13 @@ function delete_question($questionid) {
|
||||
echo "Question with id $questionid does not exist.<br />";
|
||||
}
|
||||
|
||||
$states = get_records('question_states', 'question', $questionid);
|
||||
$stateslist = implode(',', array_keys($states));
|
||||
|
||||
// delete questiontype-specific data
|
||||
foreach ($QTYPES as $qtype) {
|
||||
$qtype->delete_states($stateslist);
|
||||
if ($states = get_records('question_states', 'question', $questionid)) {
|
||||
$stateslist = implode(',', array_keys($states));
|
||||
|
||||
// delete questiontype-specific data
|
||||
foreach ($QTYPES as $qtype) {
|
||||
$qtype->delete_states($stateslist);
|
||||
}
|
||||
}
|
||||
|
||||
// delete entries from all other question tables
|
||||
|
Loading…
x
Reference in New Issue
Block a user