Пример #1
0
                $row = Database::fetch_array($result, 'ASSOC');
                $option_value = $row['value'];
                //$option_value = 0;
                $survey_question_answer = $value;
                // We save the answer after making sure that a possible previous attempt is deleted
                SurveyUtil::remove_answer(
                    $survey_invitation['user'],
                    $survey_invitation['survey_id'],
                    $survey_question_id,
                    $course_id
                );

                SurveyUtil::store_answer(
                    $survey_invitation['user'],
                    $survey_invitation['survey_id'],
                    $survey_question_id,
                    $value,
                    $option_value,
                    $survey_data
                );
            }
        }
    } else {
        // In case it's another type than 0 or 1
        die(get_lang('ErrorSurveyTypeUnknown'));
    }
}

// Displaying the survey title and subtitle (appears on every page)
echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';