0){echo str_repeat(' ',0).'Entered exercise_result.php'."
\n";var_dump($_POST);}
// general parameters passed via POST/GET
if ( empty ( $origin ) ) {
$origin = Security::remove_XSS($_REQUEST['origin']);
}
if ( empty ( $learnpath_id ) ) {
$learnpath_id = Security::remove_XSS($_REQUEST['learnpath_id']);
}
if ( empty ( $learnpath_item_id ) ) {
$learnpath_item_id = Security::remove_XSS($_REQUEST['learnpath_item_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'];
}
$_configuration['live_exercise_tracking'] = false;
if($_configuration['live_exercise_tracking']) define('ENABLED_LIVE_EXERCISE_TRACKING',1);
if($_configuration['live_exercise_tracking'] == true && $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)
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$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)) {
header('Location: exercice.php');
exit();
}
$sql_fb_type='SELECT feedback_type FROM '.$TBL_EXERCICES.' WHERE id ="'.Database::escape_string($objExercise->selectId()).'"';
$res_fb_type=Database::query($sql_fb_type);
$row_fb_type=Database::fetch_row($res_fb_type);
$feedback_type = $row_fb_type[0];
// define basic exercise info to print on screen
$exerciseTitle=$objExercise->selectTitle();
$exerciseDescription=$objExercise->selectDescription();
$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[] = "
";
if ($origin != 'learnpath') {
//so we are not in learnpath tool
Display::display_header($nameTools,"Exercise");
} else {
header('Content-Type: text/html; charset='.api_get_system_encoding());
$document_language = api_get_language_isocode();
/*
* HTML HEADER
*/
?>
'.get_lang('OpenQuestionsAttempted').' :
'.get_lang('AttemptDetails').' :
'.get_lang('CourseName').' |
#course# |
|
| '.get_lang('TestAttempted').' | #exercise# | |
| '.get_lang('StudentName').' | '.(api_is_western_name_order() ? '#firstName# #lastName# | ' : '#lastName# #firstName# | ').'
| '.get_lang('StudentEmail').' | #mail# |
'.get_lang('OpenQuestionsAttemptedAre').' :
| '.get_lang('Question').' | #questionName# |
| '.get_lang('Answer').' | #answer# |
'.get_lang('ExerciseAttempted').'
'.get_lang('CourseName').' |
#course# |
|
| '.get_lang('TestAttempted').' | #exercise# | |
| '.get_lang('StudentName').' | '.(api_is_western_name_order() ? '#firstName# #lastName# | ' : '#lastName# #firstName# | ').'
| '.get_lang('StudentEmail').' | #mail# |