Exemplo n.º 1
0
    if (in_array($_GET['message'], array('SurveyUpdatedSuccesfully', 'SurveyCreatedSuccesfully'))) {
        Display::display_confirmation_message(get_lang($message_information) . ', ' . PHP_EOL . api_strtolower(get_lang('YouCanNowAddQuestionToYourSurvey')));
    }
    // We have added a question
    if (in_array($_GET['message'], array('QuestionAdded', 'QuestionUpdated'))) {
        Display::display_confirmation_message(get_lang($message_information));
    }
    if (in_array($_GET['message'], array('YouNeedToCreateGroups'))) {
        Display::display_warning_message(get_lang($message_information), false);
    }
}
if (!empty($survey_data['survey_version'])) {
    echo '<b>' . get_lang('Version') . ': ' . $survey_data['survey_version'] . '</b>';
}
// We exit here is the first or last question is a pagebreak (which causes errors)
SurveyUtil::check_first_last_question($_GET['survey_id']);
// Action links
$survey_actions = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/create_new_survey.php?' . api_get_cidreq() . '&amp;action=edit&amp;survey_id=' . $survey_id . '">' . Display::return_icon('edit.png', get_lang('EditSurvey'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq() . '&amp;action=delete&amp;survey_id=' . $survey_id . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('DeleteSurvey') . '?', ENT_QUOTES)) . '\')) return false;">' . Display::return_icon('delete.png', get_lang('DeleteSurvey'), '', ICON_SIZE_MEDIUM) . '</a>';
//$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_survey_in_another_language.php?id_survey='.$survey_id.'">'.Display::return_icon('copy.gif', get_lang('Copy')).'</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/preview.php?' . api_get_cidreq() . '&amp;survey_id=' . $survey_id . '">' . Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_invite.php?' . api_get_cidreq() . '&amp;survey_id=' . $survey_id . '">' . Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?' . api_get_cidreq() . '&amp;survey_id=' . $survey_id . '">' . Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<div class="actions">' . $survey_actions . '</div>';
if ($survey_data['survey_type'] == 0) {
    echo '<div class="actionsbig">';
    echo '<a style="padding-left:0px;" href="' . api_get_path(WEB_CODE_PATH) . 'survey/question.php?' . api_get_cidreq() . '&amp;action=add&type=yesno&amp;survey_id=' . $survey_id . '">' . Display::return_icon('yesno.gif', get_lang('YesNo')) . '</a>';
    echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/question.php?' . api_get_cidreq() . '&amp;action=add&type=multiplechoice&amp;survey_id=' . $survey_id . '">' . Display::return_icon('mcua.gif', get_lang('UniqueSelect')) . '<br /></a>';
    echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/question.php?' . api_get_cidreq() . '&amp;action=add&type=multipleresponse&amp;survey_id=' . $survey_id . '">' . Display::return_icon('mcma.gif', get_lang('MultipleResponse')) . '</a>';
    echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/question.php?' . api_get_cidreq() . '&amp;action=add&type=open&amp;survey_id=' . $survey_id . '">' . Display::return_icon('open_answer.gif', get_lang('Open')) . '<br /></a>';
    echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/question.php?' . api_get_cidreq() . '&amp;action=add&type=dropdown&amp;survey_id=' . $survey_id . '">' . Display::return_icon('dropdown.gif', get_lang('Dropdown')) . '<br /></a>';
Exemplo n.º 2
0
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'survey/survey.php?survey_id=' . $survey_id, 'name' => $urlname);
}
$courseCode = isset($_GET['cidReq']) ? $_GET['cidReq'] : null;
$surveyAnonymous = SurveyManager::get_survey($survey_id, 0, $courseCode);
$surveyAnonymous = $surveyAnonymous['anonymous'];
if ($surveyAnonymous == 0 && api_is_anonymous()) {
    api_not_allowed(true);
} elseif ($surveyAnonymous == 0 && $userInvited == 0) {
    if (!api_is_allowed_to_edit()) {
        api_not_allowed(true);
    }
}
// Header
Display::display_header(get_lang('SurveyPreview'));
// We exit here is the first or last question is a pagebreak (which causes errors)
SurveyUtil::check_first_last_question($survey_id, false);
// Only a course admin is allowed to preview a survey: you are NOT a course admin => error message
/*
if (!api_is_allowed_to_edit(false, true)) {
	Display :: display_error_message(get_lang('NotAllowed'), false);
}*/
$counter_question = 0;
// Only a course admin is allowed to preview a survey: you are a course admin
if (api_is_course_admin() || api_is_course_admin() && $_GET['isStudentView'] == 'true' || api_is_allowed_to_session_edit(false, true)) {
    // Survey information
    echo '<div id="survey_title">' . $survey_data['survey_title'] . '</div>';
    echo '<div id="survey_subtitle">' . $survey_data['survey_subtitle'] . '</div>';
    // Displaying the survey introduction
    if (!isset($_GET['show'])) {
        if (!empty($survey_data['survey_introduction'])) {
            echo '<div id="survey_content" class="survey_content">' . $survey_data['survey_introduction'] . '</div>';