NOBUG Fixed error happening when restoring missingtype questions if answers weren't present (cast error)

This commit is contained in:
stronk7
2009-07-29 18:59:27 +00:00
parent 4431b5bb02
commit 21ae339623
@@ -27,7 +27,8 @@ class question_edit_missingtype_form extends question_edit_form {
function set_data($question) {
if (isset($question->options)){
$answers = $question->options->answers;
if (count($answers)) {
$default_values = array();
if (is_array($answers) && count($answers)) {
$key = 0;
foreach ($answers as $answer){
$default_values['answer['.$key.']'] = $answer->answer;
@@ -84,4 +85,4 @@ class question_edit_missingtype_form extends question_edit_form {
return $errors;
}
}
?>
?>