|
|
|
@ -39,7 +39,9 @@ switch ($action) { |
|
|
|
} |
|
|
|
} |
|
|
|
// get index row - i.e. user click to sort $sord = $_GET['sord']; |
|
|
|
// get index row - i.e. user click to sort $sord = $_GET['sord']; |
|
|
|
// get the direction |
|
|
|
// get the direction |
|
|
|
if (!$sidx) $sidx = 1; |
|
|
|
if (!$sidx) { |
|
|
|
|
|
|
|
$sidx = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$track_exercise = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); |
|
|
|
$track_exercise = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); |
|
|
|
$user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
|
|
$user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
|
|
@ -178,19 +180,19 @@ switch ($action) { |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'add_question_to_reminder': |
|
|
|
case 'add_question_to_reminder': |
|
|
|
$objExercise = $_SESSION['objExercise']; |
|
|
|
$objExercise = $_SESSION['objExercise']; |
|
|
|
if (empty($objExercise)) { |
|
|
|
if (empty($objExercise)) { |
|
|
|
echo 0; |
|
|
|
echo 0; |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$objExercise->edit_question_to_remind($_REQUEST['exe_id'], $_REQUEST['question_id'], $_REQUEST['action']); |
|
|
|
$objExercise->edit_question_to_remind($_REQUEST['exe_id'], $_REQUEST['question_id'], $_REQUEST['action']); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'save_exercise_by_now': |
|
|
|
case 'save_exercise_by_now': |
|
|
|
$course_info = api_get_course_info($course_code); |
|
|
|
$course_info = api_get_course_info($course_code); |
|
|
|
$course_id = $course_info['real_id']; |
|
|
|
$course_id = $course_info['real_id']; |
|
|
|
|
|
|
|
|
|
|
|
//Use have permissions? |
|
|
|
// Use have permissions? |
|
|
|
if (api_is_allowed_to_session_edit()) { |
|
|
|
if (api_is_allowed_to_session_edit()) { |
|
|
|
|
|
|
|
|
|
|
|
//"all" or "simple" strings means that there's one or all questions exercise type |
|
|
|
//"all" or "simple" strings means that there's one or all questions exercise type |
|
|
|
@ -212,20 +214,22 @@ switch ($action) { |
|
|
|
//Attempt id |
|
|
|
//Attempt id |
|
|
|
$exe_id = $_REQUEST['exe_id']; |
|
|
|
$exe_id = $_REQUEST['exe_id']; |
|
|
|
|
|
|
|
|
|
|
|
if ($debug) error_log("exe_id = $exe_id "); |
|
|
|
if ($debug) { |
|
|
|
if ($debug) error_log("type = $type "); |
|
|
|
error_log("exe_id = $exe_id "); |
|
|
|
if ($debug) error_log("choice = ".print_r($choice, 1)." "); |
|
|
|
error_log("type = $type "); |
|
|
|
if ($debug) error_log("hot_spot_coordinates = ".print_r($hot_spot_coordinates,1)); |
|
|
|
error_log("choice = ".print_r($choice, 1)." "); |
|
|
|
if ($debug) error_log("remind_list = ".print_r($remind_list, 1)); |
|
|
|
error_log("hot_spot_coordinates = ".print_r($hot_spot_coordinates, 1)); |
|
|
|
|
|
|
|
error_log("remind_list = ".print_r($remind_list, 1)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Exercise information |
|
|
|
// Exercise information. |
|
|
|
$objExercise = isset($_SESSION['objExercise']) ? $_SESSION['objExercise'] : null; |
|
|
|
$objExercise = isset($_SESSION['objExercise']) ? $_SESSION['objExercise'] : null; |
|
|
|
|
|
|
|
|
|
|
|
//Question info |
|
|
|
// Question info. |
|
|
|
$question_id = intval($_REQUEST['question_id']); |
|
|
|
$question_id = intval($_REQUEST['question_id']); |
|
|
|
$question_list = $_SESSION['questionList']; |
|
|
|
$question_list = $_SESSION['questionList']; |
|
|
|
|
|
|
|
|
|
|
|
//If exercise or question is not set then exit |
|
|
|
// If exercise or question is not set then exit. |
|
|
|
if (empty($question_list) || empty($objExercise)) { |
|
|
|
if (empty($question_list) || empty($objExercise)) { |
|
|
|
echo 'error'; |
|
|
|
echo 'error'; |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
@ -274,7 +278,6 @@ switch ($action) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//No exe id? Can't save answer. |
|
|
|
//No exe id? Can't save answer. |
|
|
|
if (empty($exe_id)) { |
|
|
|
if (empty($exe_id)) { |
|
|
|
//Fires an error |
|
|
|
//Fires an error |
|
|
|
@ -296,7 +299,7 @@ switch ($action) { |
|
|
|
|
|
|
|
|
|
|
|
unset($objQuestionTmp); |
|
|
|
unset($objQuestionTmp); |
|
|
|
|
|
|
|
|
|
|
|
//Looping the question list |
|
|
|
// Looping the question list |
|
|
|
|
|
|
|
|
|
|
|
foreach ($question_list as $my_question_id) { |
|
|
|
foreach ($question_list as $my_question_id) { |
|
|
|
if ($debug) error_log("Saving question_id = $my_question_id "); |
|
|
|
if ($debug) error_log("Saving question_id = $my_question_id "); |
|
|
|
|