mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
fix for MDL-11692. There were notices about subquestions not being defined. This seems to indicate that there is a problem elsewhere that somehow matching questions without subquestions are in the site db. But suppressed the notice by testing to see if subquestions is set before looping through the questions.
This commit is contained in:
parent
ba4418ad4e
commit
6f9ce92696
@ -650,15 +650,18 @@ class question_match_qtype extends default_questiontype {
|
||||
function find_file_links($question, $courseid){
|
||||
// find links in the question_match_sub table.
|
||||
$urls = array();
|
||||
foreach ($question->options->subquestions as $subquestion) {
|
||||
$urls += question_find_file_links_from_html($subquestion->questiontext, $courseid);
|
||||
}
|
||||
if (isset($question->options->subquestions)){
|
||||
foreach ($question->options->subquestions as $subquestion) {
|
||||
$urls += question_find_file_links_from_html($subquestion->questiontext, $courseid);
|
||||
}
|
||||
|
||||
//set all the values of the array to the question object
|
||||
if ($urls){
|
||||
$urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id)));
|
||||
//set all the values of the array to the question object
|
||||
if ($urls){
|
||||
$urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id)));
|
||||
}
|
||||
}
|
||||
$urls = array_merge_recursive($urls, parent::find_file_links($question, $courseid));
|
||||
|
||||
return $urls;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user