Exemplo n.º 1
0
/** @todo
 * This has to be moved to a more appropriate place (after the display_header
 * of the code)
 */
$courseInfo = api_get_course_info();
$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::getSurveyList(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'));
    $tool_name = get_lang('SearchASurvey');
} else {
    $tool_name = get_lang('SurveyList');