0){error_log('Entered exercise_result.php: '.print_r($_POST,1));} // general parameters passed via POST/GET if ( empty ( $origin ) ) { $origin = Security::remove_XSS($_REQUEST['origin']);} if ( empty ( $learnpath_id ) ) { $learnpath_id = intval($_REQUEST['learnpath_id']);} if ( empty ( $learnpath_item_id ) ) { $learnpath_item_id = intval($_REQUEST['learnpath_item_id']);} if ( empty ( $learnpath_item_view_id ) ) { $learnpath_item_view_id = intval($_REQUEST['learnpath_item_view_id']);} if ( empty ( $formSent ) ) { $formSent = $_REQUEST['formSent'];} if ( empty ( $exerciseResult ) ) { $exerciseResult = $_SESSION['exerciseResult'];} if ( empty ( $exerciseResultCoordinates)){ $exerciseResultCoordinates = $_SESSION['exerciseResultCoordinates'];} if ( empty ( $questionId ) ) { $questionId = $_REQUEST['questionId'];} if ( empty ( $choice ) ) { $choice = $_REQUEST['choice'];} if ( empty ( $questionNum ) ) { $questionNum = $_REQUEST['questionNum'];} if ( empty ( $nbrQuestions ) ) { $nbrQuestions = $_REQUEST['nbrQuestions'];} if ( empty ( $questionList ) ) { $questionList = $_SESSION['questionList'];} if ( empty ( $objExercise ) ) { $objExercise = $_SESSION['objExercise'];} if ( empty ( $exerciseType ) ) { $exerciseType = $_REQUEST['exerciseType'];} //@todo There should be some doc about this settings $_configuration['live_exercise_tracking'] = false; if ($_configuration['live_exercise_tracking']) define('ENABLED_LIVE_EXERCISE_TRACKING',1); if ($_configuration['live_exercise_tracking'] && $exerciseType == 1){ $_configuration['live_exercise_tracking'] = false; } $arrques = array(); $arrans = array(); // set admin name as person who sends the results e-mail (lacks policy about whom should really send the results) $query = "SELECT user_id FROM $main_admin_table LIMIT 1"; //get all admins from admin table $admin_id = Database::result(Database::query($query),0,"user_id"); $uinfo = api_get_user_info($admin_id); $from = $uinfo['mail']; $from_name = api_get_person_name($uinfo['firstname'], $uinfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS); $str = $_SERVER['REQUEST_URI']; $url = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq().'&show=result'; // if the above variables are empty or incorrect, we don't have any result to show, so stop the script if(!is_array($exerciseResult) || !is_array($questionList) || !is_object($objExercise)) { if ($debug) {error_log('Exit exercise result'); error_log('$exerciseResult: '.print_r($exerciseResult,1)); error_log('$questionList:'.print_r($questionList,1));error_log('$objExercise:'.print_r($objExercise,1));} header('Location: exercice.php'); exit(); } $gradebook = ''; if (isset($_SESSION['gradebook'])) { $gradebook= $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook=='view') { $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); } $nameTools=get_lang('Exercice'); $interbreadcrumb[]=array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices')); //$htmlHeadXtra[] = $objExercise->show_lp_javascript(); if ($origin != 'learnpath') { //so we are not in learnpath tool Display::display_header($nameTools,get_lang('Exercise')); } else { header('Content-Type: text/html; charset='.api_get_system_encoding()); $document_language = api_get_language_isocode(); /* HTML HEADER */ ?>
results_disabled == 0) { $show_results = true; } if ($objExercise->results_disabled == 2) { $show_only_score = true; } /* 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 ''; } $exerciseTitle=text_filter($objExercise->selectTitle()); $feedback_type = $objExercise->feedbacktype; //show exercise title if($origin == 'learnpath') { ?>