Beispiel #1
0
    $cidReset = true;
}
// Including the global initialization file
//require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_SURVEY;
api_protect_course_script(true);
// Including additional libraries
require_once 'survey.lib.php';
// Tracking
Event::event_access_tool(TOOL_SURVEY);
/** @todo This has to be moved to a more appropriate place (after the display_header of the code)*/
if (!api_is_allowed_to_edit(false, true)) {
    // Coach can see this
    Display::display_header(get_lang('SurveyList'));
    SurveyUtil::survey_list_user($_user['user_id']);
    Display::display_footer();
    exit;
}
$extend_rights_for_coachs = api_get_setting('extend_rights_for_coach_on_survey');
// Database table definitions
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
// Language variables
if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php', 'name' => get_lang('SurveyList'));
    $tool_name = get_lang('SearchASurvey');
} else {
    $tool_name = get_lang('SurveyList');
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
    api_get_user_id(),
    $courseInfo
);

if ($isDrhOfCourse) {
    Display::display_header(get_lang('SurveyList'));
    SurveyUtil::displaySurveyListForDrh();
    Display::display_footer();
    exit;
}

if (!api_is_allowed_to_edit(false, true)) {
    // Coach can see this
    Display::display_header(get_lang('SurveyList'));
    SurveyUtil::survey_list_user(api_get_user_id());
    Display::display_footer();
    exit;
}

$extend_rights_for_coachs = api_get_setting('extend_rights_for_coach_on_survey');

// Database table definitions
$table_survey = Database:: get_course_table(TABLE_SURVEY);
$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
$table_user = Database:: get_main_table(TABLE_MAIN_USER);

// Language variables
if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php', 'name' => get_lang('SurveyList'));