if ($surveyCode != "") { // Firstly we check if this survey is ready for anonymous use: $sql = "SELECT anonymous FROM $table_survey WHERE c_id = $course_id AND code ='".$surveyCode."'"; $resultAnonymous = Database::query($sql); $rowAnonymous = Database::fetch_array($resultAnonymous, 'ASSOC'); // If is anonymous and is not allowed to take the survey to anonymous users, forbid access: if (!isset($rowAnonymous['anonymous']) || ($rowAnonymous['anonymous'] == 0 && api_is_anonymous()) || count($rowAnonymous) == 0) { api_not_allowed(true); } // If is anonymous and it is allowed to take the survey as anonymous, mark survey as anonymous. } // Header Display :: display_header(get_lang('ToolSurvey')); // First we check if the needed parameters are present if ((!isset($_GET['course']) || !isset($_GET['invitationcode'])) && !isset($_GET['user_id'])) { Display :: display_error_message(get_lang('SurveyParametersMissingUseCopyPaste'), false); Display :: display_footer(); exit; } $invitationcode = $_GET['invitationcode']; // Start auto-invitation feature FS#3403 (all-users-can-do-the-survey-URL handling) if ($invitationcode == 'auto' && isset($_GET['scode'])) { $userid = $_user['user_id']; // Survey_code of the survey $surveyCode = Database::escape_string($_GET['scode']);
if (isset($_POST['group_members']) && count($_POST['group_members']) > $max_member && $max_member != GroupManager::MEMBER_PER_GROUP_NO_LIMIT) { Display::addFlash(Display::return_message(get_lang('GroupTooMuchMembers'), 'warning')); header('Location: group.php?' . api_get_cidreq(true, false)); } else { Display::addFlash(Display::return_message(get_lang('GroupSettingsModified'), 'success')); header('Location: group.php?' . api_get_cidreq(true, false) . '&category=' . $cat['id']); } exit; } $action = isset($_GET['action']) ? $_GET['action'] : null; switch ($action) { case 'empty': if (api_is_allowed_to_edit(false, true)) { GroupManager::unsubscribe_all_users($group_id); Display::display_confirmation_message(get_lang('GroupEmptied')); } break; } $defaults = $current_group; $defaults['group_members'] = $selected_users; $action = isset($_GET['action']) ? $_GET['action'] : ''; $defaults['action'] = $action; if (!empty($_GET['keyword']) && !empty($_GET['submit'])) { $keyword_name = Security::remove_XSS($_GET['keyword']); echo '<br/>' . get_lang('SearchResultsFor') . ' <span style="font-style: italic ;"> ' . $keyword_name . ' </span><br>'; } Display::display_header($nameTools, 'Group'); $form->setDefaults($defaults); echo GroupManager::getSettingBar('member'); $form->display(); Display::display_footer();
Display::display_header($nameTools, 'Doc'); Display::display_error_message(get_lang('Impossible')); Display::display_footer(); } } else { // Interbreadcrumb for the current directory root path // Copied from document.php $dir_array = explode('/', $dir); $array_len = count($dir_array); // Interbreadcrumb for the current directory root path if (empty($document_data['parents'])) { $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); } else { foreach ($document_data['parents'] as $document_sub_data) { $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); } } $interbreadcrumb[] = array('url' => '#', 'name' => $nameTools); Display::display_header($nameTools, "Doc"); if ($is_certificate_mode) { $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id()); $str_info = ''; foreach ($all_information_by_create_certificate[0] as $info_value) { $str_info .= $info_value . '<br/>'; } $create_certificate = get_lang('CreateCertificateWithTags'); Display::display_normal_message($create_certificate . ': <br /><br/>' . $str_info, false); } echo $form->return_form(); Display::display_footer(); }
<?php /* For licensing terms, see /license.txt */ /** * Sessions reporting * @package chamilo.reporting */ ob_start(); $cidReset = true; //quire_once '../inc/global.inc.php'; api_block_anonymous_users(); $this_section = SECTION_TRACKING; api_block_anonymous_users(); $htmlHeadXtra[] = api_get_jqgrid_js(); $interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace')); Display::display_header(get_lang('Sessions')); $export_csv = false; if (isset($_GET['export']) && $_GET['export'] == 'csv') { $export_csv = true; } /* MAIN CODE */ if (isset($_GET['id_coach']) && $_GET['id_coach'] != '') { $id_coach = intval($_GET['id_coach']); } else { $id_coach = api_get_user_id(); } if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) { $a_sessions = SessionManager::get_sessions_followed_by_drh(api_get_user_id()); if (!api_is_session_admin()) { $menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"); $menu_items[] = Display::url(Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), "index.php?view=drh_students&display=yourstudents");
$form->addElement('hidden', 'action', 'add_lp_category'); $form->addElement('hidden', 'c_id', api_get_course_int_id()); $form->addElement('hidden', 'id', 0); $form->addButtonSave(get_lang('Save')); if ($form->validate()) { $values = $form->getSubmitValues(); if (!empty($values['id'])) { learnpath::updateCategory($values); $url = api_get_self() . '?action=list&' . api_get_cidreq(); header('Location: ' . $url); exit; } else { learnpath::createCategory($values); $url = api_get_self() . '?action=list&' . api_get_cidreq(); header('Location: ' . $url); exit; } } else { $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; if ($id) { $item = learnpath::getCategory($id); $defaults = array('id' => $item->getId(), 'name' => $item->getName()); $form->setDefaults($defaults); } } Display::display_header(get_lang('LearnpathAddLearnpath'), 'Path'); echo '<div class="actions">'; echo '<a href="lp_controller.php?' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; $form->display(); Display::display_footer();
if (!empty($exercise_stat_info) && isset($exercise_stat_info['exe_exo_id'])) { header("Location: overview.php?exerciseId=" . $exercise_stat_info['exe_exo_id']); exit; } api_not_allowed(); } if (api_is_in_gradebook()) { $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'gradebook/index.php?' . api_get_cidreq(), 'name' => get_lang('ToolGradebook')); } $nameTools = get_lang('Exercises'); $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>'; $htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">'; if ($origin != 'learnpath') { // So we are not in learnpath tool Display::display_header($nameTools, get_lang('Exercise')); } else { $htmlHeadXtra[] = "\n <style>\n body { background: none;}\n </style>\n "; Display::display_reduced_header(); } /* DISPLAY AND MAIN PROCESS */ // I'm in a preview mode as course admin. Display the action menu. if (api_is_course_admin() && $origin != 'learnpath') { echo '<div class="actions">'; echo '<a href="admin.php?' . api_get_cidreq() . '&exerciseId=' . $objExercise->id . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), array(), 32) . '</a>'; echo '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">' . Display::return_icon('edit.png', get_lang('ModifyExercise'), array(), 32) . '</a>'; echo '</div>'; } $feedback_type = $objExercise->feedback_type; $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); if (!empty($exercise_stat_info['data_tracking'])) {
$this_section = SECTION_COURSES; $current_course_tool = TOOL_COURSE_MAINTENANCE; api_protect_course_script(true); $_course = api_get_course_info(); $current_course_code = $_course['official_code']; $current_course_name = $_course['name']; if (!api_is_allowed_to_edit()) { api_not_allowed(true); } $tool_name = get_lang('DelCourse'); if (isset($_GET['delete']) && $_GET['delete'] == 'yes') { CourseManager::delete_course($_course['sysCode']); $obj_cat = new Category(); $obj_cat->update_category_delete($_course['sysCode']); // DELETE CONFIRMATION MESSAGE Session::erase('_cid'); Session::erase('_real_cid'); $noPHP_SELF = true; $message = '<h2>' . get_lang('Course') . ' : ' . $current_course_name . ' (' . $current_course_code . ') </h2>'; $message .= get_lang('HasDel'); $message .= '<br /><br /><a href="../../index.php">' . get_lang('BackHome') . ' ' . api_get_setting('platform.site_name') . '</a>'; } else { $message = '<h3>' . get_lang('Course') . ' : ' . $current_course_name . ' (' . $current_course_code . ') </h3>'; $message .= '<p>' . get_lang('ByDel') . '</p>'; $message .= '<p><a class="btn btn-primary" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/maintenance.php?' . api_get_cidreq() . '">' . get_lang('No') . '</a> <a class="btn" href="' . api_get_self() . '?delete=yes&' . api_get_cidreq() . '">' . get_lang('Yes') . '</a></p>'; $interbreadcrumb[] = array('url' => 'maintenance.php', 'name' => get_lang('Maintenance')); } Display::display_header($tool_name, 'Settings'); echo Display::page_header($tool_name); Display::display_warning_message($message, false); Display::display_footer();
$display_dir = $dir; if (isset($group)) { $display_dir = explode('/', $dir); unset($display_dir[0]); unset($display_dir[1]); $display_dir = implode('/', $display_dir); } // Interbreadcrumb for the current directory root path if (empty($document_data['parents'])) { $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); } else { foreach ($document_data['parents'] as $document_sub_data) { $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); } } Display::display_header($nameTools, 'Doc'); echo '<div class="actions">'; echo '<a href="document.php?id=' . $document_id . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; ///pixlr // max size 1 Mb ?? $title = urlencode(utf8_encode(get_lang('NewImage'))); //TODO:check // $image = api_get_path(WEB_IMG_PATH) . 'canvas1024x768.png'; // $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); $langpixlr = api_get_language_isocode(); $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr; $loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
$actions .= '</div>'; // Checking if it is a valid type if (!in_array($_GET['type'], $possible_types)) { Display :: display_header($tool_name,'Survey'); echo $actions; Display :: display_error_message(get_lang('TypeDoesNotExist'), false); Display :: display_footer(); } $error_message = ''; // Displaying the form for adding or editing the question if (empty($_POST['save_question']) && in_array($_GET['type'], $possible_types)) { if (!isset($_POST['save_question'])) { // Displaying the header Display::display_header($tool_name, 'Survey'); echo $actions; // Displys message if exists if (isset($_SESSION['temp_sys_message'])) { $error_message = $_SESSION['temp_sys_message']; unset($_SESSION['temp_sys_message']); if ($error_message == 'PleaseEnterAQuestion' || $error_message == 'PleasFillAllAnswer'|| $error_message == 'PleaseChooseACondition'|| $error_message == 'ChooseDifferentCategories' ) { Display::display_error_message(get_lang($error_message), true); } } } $ch_type = 'ch_'.$_GET['type'];
return false; } } </script>'; $nameTools = ""; require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; if (!api_is_allowed_to_edit()) { api_not_allowed(true); } $category = new TestCategory(); $courseId = api_get_course_int_id(); $sessionId = api_get_session_id(); // breadcrumbs $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); Display::display_header(get_lang('Category')); // Action handling: add, edit and remove if (isset($_GET['action']) && $_GET['action'] == 'addcategory') { add_category_form($_GET['action']); display_add_category(); } else { if (isset($_GET['action']) && $_GET['action'] == 'editcategory') { edit_category_form($_GET['action']); } else { if (isset($_GET['action']) && $_GET['action'] == 'deletecategory') { delete_category_form($_GET['action']); display_add_category(); } else { display_add_category(); } }
</script>'; function get_courses_list_by_user_id_based_in_exercises($user_id) { $TABLETRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); $user_id = intval($user_id); $sql = "SELECT DISTINCT exe_user_id, c_id, session_id\n FROM {$TABLETRACK_EXERCICES}\n WHERE exe_user_id = {$user_id}\n ORDER by exe_user_id, c_id ASC"; $res = Database::query($sql); $course_list = array(); while ($row = Database::fetch_array($res, 'ASSOC')) { $course_list[] = $row; } return $course_list; } Display::display_header(get_lang('MoveUserStats')); echo '<div class="actions">'; echo '<a href="../admin/index.php">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; echo Display::display_normal_message(get_lang('CompareUserResultsBetweenCoursesAndCoursesInASession'), false); // Some pagination $page = 1; if (isset($_GET['page']) && !empty($_GET['page'])) { $page = intval($_GET['page']); } $default = 20; $count = UserManager::get_number_of_users(); $nro_pages = round($count / $default) + 1; $begin = $default * ($page - 1); $end = $default * $page; $navigation = "{$begin} - {$end} / {$count}<br />";
$table->set_header($header_nr++, get_lang('Action'), false); $table->set_column_filter($header_nr - 1, 'modify_filter'); } } /* Header */ if (isset($origin) && $origin == 'learnpath') { Display::display_reduced_header(); } else { if (isset($_GET['keyword']) && !empty($_GET['keyword'])) { $interbreadcrumb[] = array("url" => "user.php?" . api_get_cidreq(), "name" => get_lang("Users")); $tool_name = get_lang('SearchResults'); } else { $tool_name = get_lang('Users'); $origin = 'users'; } Display::display_header($tool_name, "User"); } /* Setting the permissions for this page */ $is_allowed_to_track = $is_courseAdmin || $is_courseTutor; // Tool introduction Display::display_introduction_section(TOOL_USER, 'left'); $actions = ''; $type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT; $selectedTab = 1; if (api_is_allowed_to_edit(null, true)) { echo '<div class="actions">'; switch ($type) { case STUDENT: $selectedTab = 1; $url = api_get_path(WEB_CODE_PATH) . 'user/subscribe_user.php?' . api_get_cidreq() . '&type=' . STUDENT; break;
if (count($users) == 0) { header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' . Security::remove_XSS($_GET['selecteval'])); exit; } else { foreach ($users as $user_id) { $result = new Result(); $result->set_user_id($user_id); $result->set_evaluation_id($_GET['selecteval']); $result->add(); } } header('Location: gradebook_view_result.php?adduser=&selecteval=' . Security::remove_XSS($_GET['selecteval'])); exit; } elseif ($_POST['firstLetterUser']) { $firstletter = $_POST['firstLetterUser']; if (!empty($firstletter)) { header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); exit; } } $interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook')); $interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult')); Display::display_header(get_lang('AddUserToEval')); if (isset($_GET['erroroneuser'])) { Display::display_warning_message(get_lang('AtLeastOneUser'), false); } DisplayGradebook::display_header_result($evaluation[0], null, 0, 0); echo '<div class="main">'; echo $add_user_form->toHtml(); echo '</div>'; Display::display_footer();
break; case 'csv': default: $export = new GradeBookResult(); $export->exportCompleteReportCSV($printable_data); exit; break; } } else { api_not_allowed(true); } } $this_section = SECTION_COURSES; if (isset($_GET['exportpdf'])) { $export_pdf_form->display(); } else { Display::display_header(get_lang('FlatView')); } if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') { DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form); $flatviewtable->display(); } elseif (isset($_GET['selectcat']) && $_SESSION['studentview'] == 'teacherview') { DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form); // Table $flatviewtable->display(); //@todo load images with jquery echo '<div id="contentArea" style="text-align: center;" >'; $flatviewtable->display_graph_by_resource(); echo '</div>'; } Display::display_footer();
// you are not a teacher $show_work = GroupManager::user_has_access($user_id, $group_id, GroupManager::GROUP_TOOL_WORK); } if (!$show_work) { api_not_allowed(); } $interbreadcrumb[] = array('url' => '../group/group.php', 'name' => get_lang('Groups')); $interbreadcrumb[] = array('url' => '../group/group_space.php?gidReq=' . $group_id, 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']); } else { if (!api_is_allowed_to_edit(false, true)) { api_not_allowed(true); } } $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'name' => get_lang('StudentPublications')); $interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']); Display::display_header(null); echo '<div class="actions">'; echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq() . '&origin=' . $origin . '&gradebook=' . $gradebook . '">' . Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; $workPerUser = getWorkPerUser($studentId); $table = new HTML_Table(array('class' => 'data_table')); $column = 0; $row = 0; $headers = array(get_lang('Title'), get_lang('HandedOutDate'), get_lang('HandOutDateLimit'), get_lang('Score'), get_lang('Actions')); foreach ($headers as $header) { $table->setHeaderContents($row, $column, $header); $column++; } $row++; $column = 0; foreach ($workPerUser as $work) {
if (!empty($_POST['To']) and $allow_individual_calendar_status == "hide") { $_SESSION['allow_individual_calendar'] = "show"; } if (!empty($_GET['sort']) and $allow_individual_calendar_status == "show") { $_SESSION['allow_individual_calendar'] = "hide"; } $htmlHeadXtra[] = to_javascript(); // this loads the javascript that is needed for the date popup selection $htmlHeadXtra[] = "<script src=\"calendar_tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>"; // setting the name of the tool $nameTools = get_lang('GlobalAgenda'); // language variable in trad4all.inc.php // showing the header if we are not in the learning path, if we are in // the learning path, we do not include the banner so we have to explicitly // include the stylesheet, which is normally done in the header Display::display_header($nameTools, 'Agenda'); /* SETTING SOME VARIABLES */ // Variable definitions // Defining the shorts for the days. We use camelcase because these are arrays of language variables $DaysShort = api_get_week_days_short(); // Defining the days of the week to allow translation of the days. We use camelcase because these are arrays of language variables $DaysLong = api_get_week_days_long(); // Defining the months of the year to allow translation of the months. We use camelcase because these are arrays of language variables $MonthsLong = api_get_months_long(); // Database table definitions $TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); $tbl_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_courseUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); /* ACCESS RIGHTS */
// Access control api_protect_course_script(true); if (!api_is_allowed_to_edit()) { api_not_allowed(); } $objExercise = new Exercise(); $result = $objExercise->read($exercise_id); if (!$result) { api_not_allowed(true); } $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $interbreadcrumb[] = array("url" => "admin.php?exerciseId={$exercise_id}&" . api_get_cidreq(), "name" => $objExercise->name); //Add the JS needed to use the jqgrid $htmlHeadXtra[] = api_get_jqgrid_js(); // The header. Display::display_header(get_lang('StudentsWhoAreTakingTheExerciseRightNow')); //jqgrid will use this URL to do the selects $minutes = 60; $url = api_get_path(WEB_AJAX_PATH) . 'exercise.ajax.php?a=get_live_stats&exercise_id=' . $objExercise->id . '&minutes=' . $minutes; //The order is important you need to check the the $column variable in the model.ajax.php file $columns = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Time'), get_lang('QuestionsAlreadyAnswered'), get_lang('Score')); //Column config $column_model = array(array('name' => 'firstname', 'index' => 'firstname', 'width' => '100', 'align' => 'left'), array('name' => 'lastname', 'index' => 'lastname', 'width' => '100', 'align' => 'left'), array('name' => 'start_date', 'index' => 'start_date', 'width' => '100', 'align' => 'left'), array('name' => 'question', 'index' => 'count_questions', 'width' => '60', 'align' => 'left', 'sortable' => 'false'), array('name' => 'score', 'index' => 'score', 'width' => '50', 'align' => 'left', 'sortable' => 'false')); //Autowidth $extra_params['autowidth'] = 'true'; //height auto $extra_params['height'] = 'auto'; ?> <script> function refreshGrid() {
} $period = $_REQUEST['period']; if (!isset($_REQUEST['view'])) { $view = "0000000"; } else { $view = $_REQUEST['view']; } //include('../inc/global.inc.php'); $interbreadcrumb[] = array("url" => "../user/user.php", "name" => get_lang('Users')); $nameTools = get_lang('ToolName'); $htmlHeadXtra[] = "<style type='text/css'>\n/*<![CDATA[*/\n.secLine {background-color : #E6E6E6;}\n.content {padding-left : 15px;padding-right : 15px; }\n.specialLink{color : #0000FF;}\n/*]]>*/\n</style>\n<style media='print' type='text/css'>\n/*<![CDATA[*/\ntd {border-bottom: thin dashed gray;}\n/*]]>*/\n</style>"; $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); $TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER); $TABLEUSER = Database::get_main_table(TABLE_MAIN_USER); $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); Display::display_header($nameTools, "Tracking"); $courseId = api_get_course_int_id(); // the variables for the days and the months // Defining the shorts for the days $DaysShort = api_get_week_days_short(); // Defining the days of the week to allow translation of the days $DaysLong = api_get_week_days_long(); // Defining the months of the year to allow translation of the months $MonthsLong = api_get_months_long(); // Defining the months of the year to allow translation of the months $MonthsShort = api_get_months_short(); $is_allowedToTrack = $is_groupTutor; // allowed to track only user of one group $is_allowedToTrackEverybodyInCourse = $is_courseAdmin; // allowed to track all student in course ?>
// name of the language file that needs to be included $language_file = 'exercice'; include "../inc/global.inc.php"; $this_section = SECTION_COURSES; include_once api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php'; include_once api_get_path(LIBRARY_PATH) . 'document.lib.php'; include_once api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php'; $nameTools = get_lang('ExerciseManagement'); if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array('url' => '../gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); } $interbreadcrumb[] = array("url" => "exercice.php", "name" => get_lang('Exercices')); Display::display_header($nameTools, "Exercise"); ?> <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%"> <h4> <?php echo "Add Feedback"; ?> </h4> <?php $id = $_REQUEST['question']; $objQuestionTmp = Question::read($id); echo "<tr><td><b>" . get_lang('Question') . " : </b>"; echo $objQuestionTmp->selectTitle(); echo "</td></tr>"; echo " <br><tr><td><b><br>" . get_lang('Answer') . " : </b></td></tr>"; $objAnswerTmp = new Answer($id);
} } } if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array('url' => '../gradebook/' . Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook')); } // if admin of course if (!$is_allowedToEdit) { api_not_allowed(true); } $confirmYourChoice = addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)); $htmlHeadXtra[] = "\n<script>\n\tfunction submit_form(obj) {\n\t\tdocument.question_pool.submit();\n\t}\n\n\tfunction mark_course_id_changed() {\n\t\t\$('#course_id_changed').val('1');\n\t}\n\n\tfunction mark_exercice_id_changed() {\n\t\t\$('#exercice_id_changed').val('1');\n\t}\n\n\tfunction confirm_your_choice() {\n\t\treturn confirm('{$confirmYourChoice}');\n\t}\n</script>"; Display::display_header($nameTools, 'Exercise'); // Menu echo '<div class="actions">'; if (isset($type)) { $url = api_get_self() . '?type=1'; } else { $url = api_get_self(); } if (isset($fromExercise) && $fromExercise > 0) { echo '<a href="admin.php?' . api_get_cidreq() . '&exerciseId=' . $fromExercise . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>'; $titleAdd = get_lang('AddQuestionToTest'); } else { echo '<a href="exercice.php?' . api_get_cidReq() . '">' . Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM) . '</a>'; echo "<a href='admin.php?exerciseId=0'>" . Display::return_icon('add_question.gif', get_lang('NewQu'), '', ICON_SIZE_MEDIUM) . "</a>"; $titleAdd = get_lang('ManageAllQuestions'); }
<?php /* See license terms in /license.txt */ //require_once '../../main/inc/global.inc.php'; //Add the JS needed to use the jqgrid $htmlHeadXtra[] = api_get_jqgrid_js(); $allowed = api_is_platform_admin() || api_is_drh(); if (!$allowed) { api_not_allowed(true); } Display::display_header(); //jqgrid will use this URL to do the selects $url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_user_list_plugin_widescale'; //The order is important you need to check the the $column variable in the model.ajax.php file $columns = array(get_lang('Username'), get_lang('Firstname'), get_lang('Lastname'), get_lang('Password')); //Column config $column_model = array(array('name' => 'username', 'index' => 'username', 'width' => '100', 'align' => 'left'), array('name' => 'firstname', 'index' => 'firstname', 'width' => '100', 'align' => 'left'), array('name' => 'lastname', 'index' => 'lastname', 'width' => '100', 'align' => 'left'), array('name' => 'exam_password', 'index' => 'exam_password', 'width' => '100', 'align' => 'left', 'sortable' => 'false')); //Autowidth $extra_params['autowidth'] = 'true'; //height auto $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid (edit, delete, etc) /* $action_links = 'function action_formatter(cellvalue, options, rowObject) { return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'. ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. '\'; }';*/ $action_links = null; $room = UserManager::get_extra_user_data_by_field(api_get_user_id(), 'exam_room');
$interbreadcrumb[] = array('url' => "blog.php?blog_id={$blog_id}", 'name' => Blog::get_blog_title($blog_id)); Display::display_header($nameTools, 'Blogs'); break; case 'view_search_result': $nameTools = get_lang('SearchResults'); $interbreadcrumb[] = array('url' => "blog.php?blog_id={$blog_id}", 'name' => Blog::get_blog_title($blog_id)); Display::display_header($nameTools, 'Blogs'); break; case 'execute_task': $nameTools = get_lang('ExecuteThisTask'); $interbreadcrumb[] = array('url' => "blog.php?blog_id={$blog_id}", 'name' => Blog::get_blog_title($blog_id)); Display::display_header($nameTools, 'Blogs'); break; default: $nameTools = Blog::get_blog_title($blog_id); Display::display_header($nameTools, 'Blogs'); } // feedback messages if (!empty($return_message)) { if ($return_message['type'] == 'confirmation') { Display::display_confirmation_message($return_message['message']); } if ($return_message['type'] == 'error') { Display::display_error_message($return_message['message']); } } // actions echo '<div class=actions>'; ?> <a href="<?php echo api_get_self();
// including the global Dokeos file require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'pear/excelreader/reader.php'; // Security check $is_allowed_to_edit = api_is_allowed_to_edit(null, true); if (!$is_allowed_to_edit) { api_not_allowed(true); } // setting the tabs $this_section = SECTION_COURSES; $htmlHeadXtra[] = "<script>\n\$(document).ready( function(){\n \$('#user_custom_score').click(function() {\n \$('#options').toggle();\n });\n});\n</script>"; // Action handling lp_upload_quiz_action_handling(); $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); // Display the header Display::display_header(get_lang('ImportExcelQuiz'), 'Exercises'); if (isset($_GET['message'])) { if (in_array($_GET['message'], array('ExerciseEdited'))) { Display::display_confirmation_message(get_lang($_GET['message'])); } } // display the actions echo '<div class="actions">'; echo lp_upload_quiz_actions(); echo '</div>'; // the main content lp_upload_quiz_main(); function lp_upload_quiz_actions() { $return = '<a href="exercise.php?' . api_get_cidReq() . '">' . Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM) . '</a>'; return $return;
} } } if (!empty($quantity_exercises)) { $main_question_list[$question_id]->results = $question_result / $quantity_exercises; // Score % average } else { $main_question_list[$question_id]->results = 0; } $main_question_list[$question_id]->quantity = $quantity_exercises; } } } } if (!$export_to_xls) { Display::display_header(get_lang("MySpace")); echo '<div class="actions" style ="font-size:10pt;" >'; if ($global) { $menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"); $menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_path(WEB_CODE_PATH) . 'mySpace/?view=teacher'); $menu_items[] = Display::return_icon('star_na.png', get_lang('AdminInterface'), array(), 32); $menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH) . 'tracking/exams.php'); $nb_menu_items = count($menu_items); if ($nb_menu_items > 1) { foreach ($menu_items as $key => $item) { echo $item; } } } else { echo '<div style="float:left; clear:left"> <a href="courseLog.php?' . api_get_cidreq() . '&studentlist=true">' . get_lang('StudentsTracking') . '</a> |
$htmlHeadXtra[] = '<script> $(function() { ' . $extra['jquery_ready_content'] . ' }); </script>'; //Submit button $form->addElement('style_submit_button', 'Submit', get_lang('SaveLPSettings'), 'class="save"'); // Hidden fields $form->addElement('hidden', 'action', 'update_lp'); $form->addElement('hidden', 'lp_id', $_SESSION['oLP']->get_id()); $defaults['publicated_on'] = $publicated_on != '0000-00-00 00:00:00' && !empty($publicated_on) ? api_get_local_time($publicated_on) : date('Y-m-d 12:00:00'); $defaults['expired_on'] = $expired_on != '0000-00-00 00:00:00' && !empty($expired_on) ? api_get_local_time($expired_on) : date('Y-m-d 12:00:00', time() + 84600); $defaults['max_attempts'] = $_SESSION['oLP']->get_max_attempts(); $defaults['subscribe_users'] = $_SESSION['oLP']->get_subscribe_users(); $form->setDefaults($defaults); Display::display_header(get_lang('CourseSettings'), 'Path'); echo $_SESSION['oLP']->build_action_menu(); echo '<div class="row">'; if ($_SESSION['oLP']->get_hide_toc_frame() == 1) { echo '<div class="span12">'; $form->display(); echo '</div>'; } else { echo '<div class="span6">'; $form->display(); echo '</div>'; echo '<div class="span6" align="center">'; echo Display::return_icon('course_setting_layout.png'); echo '</div>'; } echo '</div>';
$TABLEQUIZ = Database::get_course_table(TABLE_QUIZ_TEST); $sessionId = api_get_session_id(); // Breadcrumbs. if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') { $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => '../admin/session_list.php','name' => get_lang('SessionList')); $interbreadcrumb[] = array('url' => '../admin/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview')); } $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : ''; $nameTools = get_lang('Tracking'); // Display the header. Display::display_header($nameTools, 'Tracking'); // getting all the students of the course if (empty($session_id)) { // Registered students in a course outside session. $a_students = CourseManager::get_student_list_from_course_code( api_get_course_id() ); } else { // Registered students in session. $a_students = CourseManager::get_student_list_from_course_code( api_get_course_id(), true, $sessionId ); }
$courses = array(); $users = array(); $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); $tbl_user = Database::get_main_table(TABLE_MAIN_USER); /* Header */ $tool_name = get_lang('AddUsersToACourse'); $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $htmlHeadXtra[] = ' <script type="text/javascript"> function validate_filter() { document.formulaire.form_sent.value=0; document.formulaire.submit(); } </script>'; // displaying the header Display::display_header($tool_name); $link_add_group = '<a href="usergroups.php">' . Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')) . get_lang('RegistrationByUsersGroups') . '</a>'; echo '<div class="actions">' . $link_add_group . '</div>'; $form = new FormValidator('subscribe_user2course'); $form->addElement('header', '', $tool_name); $form->display(); //checking for extra field with filter on $extra_field_list = UserManager::get_extra_fields(); $new_field_list = array(); if (is_array($extra_field_list)) { foreach ($extra_field_list as $extra_field) { //if is enabled to filter and is a "<select>" field type if ($extra_field[8] == 1 && $extra_field[2] == 4) { $new_field_list[] = array('name' => $extra_field[3], 'variable' => $extra_field[1], 'data' => $extra_field[9]); } }
} if ($is_allowedToEdit || $is_tutor) { $nameTools = get_lang('StudentScore'); $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $objExerciseTmp = new Exercise(); if ($objExerciseTmp->read($exercise_id)) { $interbreadcrumb[] = array("url" => "admin.php?exerciseId=" . $exercise_id . "&" . api_get_cidreq(), "name" => $objExerciseTmp->name); } } else { $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $objExerciseTmp = new Exercise(); if ($objExerciseTmp->read($exercise_id)) { $nameTools = get_lang('Results') . ': ' . $objExerciseTmp->name; } } Display::display_header($nameTools); // Clean all results for this test before the selected date if (($is_allowedToEdit || $is_tutor || api_is_coach()) && isset($_GET['delete_before_date']) && $locked == false) { // ask for the date $check = Security::check_token('get'); if ($check) { $objExerciseTmp = new Exercise(); if ($objExerciseTmp->read($exercise_id)) { $count = $objExerciseTmp->clean_results(true, $_GET['delete_before_date'] . ' 23:59:59'); Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count)); } } } // Security token to protect deletion $token = Security::get_token(); $actions = Display::div($actions, array('class' => 'actions'));
if ($_SESSION['gradebook_dest'] == 'index.php') { $gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']) . '?cidReq=' . Security::remove_XSS($_GET['course']) . '&'; } else { $gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']); } $interbreadcrumb[] = array('url' => $gradebook_dest, 'name' => get_lang('Gradebook')); if (isset($_GET['selectcat']) && $_GET['selectcat'] > 0) { if (!empty($_GET['course'])) { $interbreadcrumb[] = array('url' => $gradebook_dest . 'selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('Details')); } else { $interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'] . '?selectcat=0', 'name' => get_lang('Details')); } } Display::display_header(''); } else { Display::display_header(''); } } if (isset($_GET['categorymoved'])) { Display::display_confirmation_message(get_lang('CategoryMoved'), false); } if (isset($_GET['evaluationmoved'])) { Display::display_confirmation_message(get_lang('EvaluationMoved'), false); } if (isset($_GET['linkmoved'])) { Display::display_confirmation_message(get_lang('LinkMoved'), false); } if (isset($_GET['addcat'])) { Display::display_confirmation_message(get_lang('CategoryAdded'), false); } if (isset($_GET['linkadded'])) {
if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array('url' => '../gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); } $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths')); $interbreadcrumb[] = array('url' => api_get_self() . "?action=build&lp_id={$learnpath_id}", 'name' => $therow['name']); $interbreadcrumb[] = array('url' => api_get_self() . "?action=add_item&type=step&lp_id={$learnpath_id}", 'name' => get_lang('NewStep')); // Theme calls $show_learn_path = true; if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { $lp_theme_css = $_SESSION['oLP']->get_theme(); } if ($mode == 'fullpage') { Display::display_header(get_lang('Item'), 'Path'); } $suredel = trim(get_lang('AreYouSureToDelete')); ?> <script> /* <![CDATA[ */ function stripslashes(str) { str=str.replace(/\\'/g,'\''); str=str.replace(/\\"/g,'"'); str=str.replace(/\\\\/g,'\\'); str=str.replace(/\\0/g,'\0'); return str; } function confirmation(name) { name=stripslashes(name);