Do not enter question loop if there are no questions
This commit is contained in:
parent
ed728833da
commit
f717449bef
1 changed files with 10 additions and 8 deletions
|
@ -143,15 +143,17 @@ if (file_exists($questionfile)) {
|
||||||
|
|
||||||
$questionsection = $questions->documentElement->getElementsByTagName("questions")->item(0);
|
$questionsection = $questions->documentElement->getElementsByTagName("questions")->item(0);
|
||||||
|
|
||||||
foreach ($questionsection->getElementsByTagName("question") as $question) {
|
if ($questionsection) {
|
||||||
$questiontext = $question->getElementsByTagName("questiontext")->item(0);
|
foreach ($questionsection->getElementsByTagName("question") as $question) {
|
||||||
$newquestiontext = strip_tags(html_entity_decode($questiontext->textContent));
|
$questiontext = $question->getElementsByTagName("questiontext")->item(0);
|
||||||
$questiontext->nodeValue = htmlentities($newquestiontext, ENT_XML1);
|
$newquestiontext = strip_tags(html_entity_decode($questiontext->textContent));
|
||||||
|
$questiontext->nodeValue = htmlentities($newquestiontext, ENT_XML1);
|
||||||
|
|
||||||
foreach ($question->getElementsByTagName("answer") as $answer) {
|
foreach ($question->getElementsByTagName("answer") as $answer) {
|
||||||
$answertext = $answer->getElementsByTagName("answertext")->item(0);
|
$answertext = $answer->getElementsByTagName("answertext")->item(0);
|
||||||
$newanswertext = strip_tags(html_entity_decode($answertext->textContent));
|
$newanswertext = strip_tags(html_entity_decode($answertext->textContent));
|
||||||
$answertext->nodeValue = htmlentities($newanswertext, ENT_XML1);
|
$answertext->nodeValue = htmlentities($newanswertext, ENT_XML1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue