diff --git a/main/exercice/admin.php b/main/exercice/admin.php index fdc2dcdf33..d6be2de610 100755 --- a/main/exercice/admin.php +++ b/main/exercice/admin.php @@ -109,6 +109,7 @@ $cancelExercise = isset($cancelExercise) ? $cancelExercise : null; $cancelAnswers = isset($cancelAnswers) ? $cancelAnswers : null; $modifyIn = isset($modifyIn) ? $modifyIn : null; $cancelQuestion = isset($cancelQuestion) ? $cancelQuestion : null; +$_course = api_get_course_info(); /* Cleaning all incomplete attempts of the admin/teacher to avoid weird problems when changing the exercise settings, number of questions, etc */ @@ -186,8 +187,6 @@ if (!is_object($objExercise)) { // Exercise can be edited in their course. if ($objExercise->sessionId != $sessionId) { api_not_allowed(true); - /*header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq()); - exit;*/ } // doesn't select the exercise ID if we come from the question pool @@ -216,7 +215,7 @@ if ($editQuestion || $newQuestion || $modifyQuestion || $modifyAnswers) { } // checks if the object exists - if(is_object($objQuestion)) { + if (is_object($objQuestion)) { // gets the question ID $questionId = $objQuestion->selectId(); } @@ -225,7 +224,7 @@ if ($editQuestion || $newQuestion || $modifyQuestion || $modifyAnswers) { // if cancelling an exercise if ($cancelExercise) { // existing exercise - if($exerciseId) { + if ($exerciseId) { unset($modifyExercise); } else { // new exercise @@ -238,14 +237,14 @@ if ($cancelExercise) { // if cancelling question creation/modification if ($cancelQuestion) { // if we are creating a new question from the question pool - if(!$exerciseId && !$questionId) { + if (!$exerciseId && !$questionId) { // goes back to the question pool header('Location: question_pool.php'); exit(); } else { // goes back to the question viewing - $editQuestion=$modifyQuestion; - unset($newQuestion,$modifyQuestion); + $editQuestion = $modifyQuestion; + unset($newQuestion, $modifyQuestion); } } @@ -275,6 +274,7 @@ if ($cancelAnswers) { $editQuestion=$modifyAnswers; unset($modifyAnswers); } + $nameTools = null; // modifies the query string that is used in the link of tool name if ($editQuestion || $modifyQuestion || $newQuestion || $modifyAnswers) { @@ -292,16 +292,16 @@ if (!empty($gradebook) && $gradebook=='view') { ); } -$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices')); +$interbreadcrumb[] = array("url" => "exercice.php?".api_get_cidreq(),"name" => get_lang('Exercices')); if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) { - $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name); + $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id.'&'.api_get_cidreq(), "name" => $objExercise->name); } else { $interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name); } // shows a link to go back to the question pool if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){ - $interbreadcrumb[]=array( + $interbreadcrumb[] = array( "url" => api_get_path(WEB_CODE_PATH)."exercice/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(), "name" => get_lang('QuestionPool') ); @@ -309,7 +309,7 @@ if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){ // if the question is duplicated, disable the link of tool name if ($modifyIn == 'thisExercise') { - if($buttonBack) { + if ($buttonBack) { $modifyIn='allExercises'; } else { $noPHP_SELF=true; @@ -332,8 +332,6 @@ function multiple_answer_true_false_onchange(variable) { } document.getElementById(weight_id).value = array_result[result]; } - - '; $htmlHeadXtra[] = " @@ -523,7 +521,6 @@ if ($newQuestion || $editQuestion) { if ($newQuestion == 'yes') { $objExercise->edit_exercise_in_lp = true; } - require 'question_admin.inc.php'; } diff --git a/main/exercice/hotspot_admin.inc.php b/main/exercice/hotspot_admin.inc.php index 379269df7e..e2fa718c29 100755 --- a/main/exercice/hotspot_admin.inc.php +++ b/main/exercice/hotspot_admin.inc.php @@ -1,14 +1,13 @@ selectTitle(); $answerType = $objQuestion->selectType(); $pictureName = $objQuestion->selectPicture(); $debug = 0; // debug variable to get where we are - $okPicture = empty($pictureName) ? false : true; -// if we come from the warning box "this question is used in serveral exercises" +// if we come from the warning box "this question is used in several exercises" + if ($modifyIn) { if ($debug > 0) { echo '$modifyIn was set' . "
\n"; } - // if the user has chosed to modify the question only in the current exercise + // if the user has chosen to modify the question only in the current exercise if ($modifyIn == 'thisExercise') { // duplicates the question $questionId = $objQuestion->duplicate(); @@ -53,7 +52,6 @@ if ($modifyIn) { $objAnswer->duplicate($questionId); // construction of the duplicated Answers - $objAnswer = new Answer($questionId); } $color = unserialize($color); @@ -69,17 +67,16 @@ if ($modifyIn) { $hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId; // the answer form has been submitted +$submitAnswers = isset($_POST['submitAnswers']) ? true : false; +$buttonBack = isset($_POST['buttonBack']) ? true : false; +$nbrAnswers = isset($_POST['nbrAnswers']) ? intval($_POST['nbrAnswers']) : 0; -$submitAnswers = isset($submitAnswers) ? $submitAnswers : false; -$buttonBack = isset($buttonBack) ? $buttonBack : false; -$nbrAnswers = isset($nbrAnswers) ? $nbrAnswers : 0; if ($submitAnswers || $buttonBack) { - if ($answerType == HOT_SPOT) { - if ($debug > 0) { echo '$submitAnswers or $buttonBack was set' . "
\n"; } + $questionWeighting = $nbrGoodAnswers = 0; for ($i = 1; $i <= $nbrAnswers; $i++) { if ($debug > 0) { @@ -88,6 +85,7 @@ if ($submitAnswers || $buttonBack) { $reponse[$i] = trim($reponse[$i]); $comment[$i] = trim($comment[$i]); $weighting[$i] = $weighting[$i]; // it can be float + // checks if field is empty if (empty($reponse[$i]) && $reponse[$i] != '0') { $msgErr = get_lang('HotspotGiveAnswers'); @@ -124,7 +122,15 @@ if ($submitAnswers || $buttonBack) { $questionWeighting+=$weighting[$i]; } // creates answer - $objAnswer->createAnswer($reponse[$i], '', $comment[$i], $weighting[$i], $i, $hotspot_coordinates[$i], $hotspot_type[$i]); + $objAnswer->createAnswer( + $reponse[$i], + '', + $comment[$i], + $weighting[$i], + $i, + $hotspot_coordinates[$i], + $hotspot_type[$i] + ); } // end for() // saves the answers into the data base $objAnswer->save(); @@ -141,7 +147,6 @@ if ($submitAnswers || $buttonBack) { echo '$modifyIn was set - end' . "
\n"; } } else { - if ($debug > 0) { echo '$submitAnswers or $buttonBack was set' . "
\n"; } @@ -164,23 +169,25 @@ if ($submitAnswers || $buttonBack) { $comment[$i] = trim($comment[$i]); $weighting[$i] = $weighting[$i]; - if (empty($threadhold1[$i])) + if (empty($threadhold1[$i])) { $threadhold1_str = 0; - else + } else { $threadhold1_str = intval($threadhold1[$i]); + } - if (empty($threadhold2[$i])) + if (empty($threadhold2[$i])) { $threadhold2_str = 0; - else + } else { $threadhold2_str = intval($threadhold2[$i]); + } - if (empty($threadhold3[$i])) + if (empty($threadhold3[$i])) { $threadhold3_str = 0; - else + } else { $threadhold3_str = intval($threadhold3[$i]); + } $threadhold_total = $threadhold1_str . ';' . $threadhold2_str . ';' . $threadhold3_str; - //echo '
';print_r($_POST);echo '
'; if ($try[$i] == 'on') { $try_str = 1; @@ -207,9 +214,6 @@ if ($submitAnswers || $buttonBack) { } $destination[$i] = $threadhold_total . '@@' . $try_str . '@@' . $lp_str . '@@' . $question_str . '@@' . $url_str; - // the last answer is the IF NO ERROR section witch has not have the reponse, weight and coordinates values - //if ($i!=$nbrAnswers && !($answerType==HOT_SPOT_DELINEATION)) - // { // checks if field is empty if (empty($reponse[$i]) && $reponse[$i] != '0') { $msgErr = get_lang('HotspotGiveAnswers'); @@ -281,11 +285,29 @@ if ($submitAnswers || $buttonBack) { $questionWeighting+=$weighting[$i]; } // creates answer - $objAnswer->createAnswer($reponse[$i], '', $comment[$i], $weighting[$i], $i, $hotspot_coordinates[$i], $hotspot_type[$i], $destination[$i]); + $objAnswer->createAnswer( + $reponse[$i], + '', + $comment[$i], + $weighting[$i], + $i, + $hotspot_coordinates[$i], + $hotspot_type[$i], + $destination[$i] + ); } // end for() // saves the answers into the data base - $objAnswer->createAnswer('noerror', '', $comment_noerror, '0', $nbrAnswers + 1, null, 'noerror', $destination_noerror); + $objAnswer->createAnswer( + 'noerror', + '', + $comment_noerror, + '0', + $nbrAnswers + 1, + null, + 'noerror', + $destination_noerror + ); $objAnswer->save(); // sets the total weighting of the question @@ -301,7 +323,6 @@ if ($submitAnswers || $buttonBack) { } if ($modifyAnswers) { - if ($debug > 0) { echo str_repeat(' ', 0) . '$modifyAnswers is set' . "
\n"; } @@ -315,7 +336,6 @@ if ($modifyAnswers) { if ($answerType == HOT_SPOT_DELINEATION) { $try = $_POST['try']; - for ($i = 1; $i <= $nbrAnswers; $i++) { if ($try[$i] == 'on') { $try[$i] = 1; @@ -347,7 +367,6 @@ if ($modifyAnswers) { $destination_items = array(); $destination = array(); - for ($i = 1; $i <= $nbrAnswers; $i++) { $reponse[$i] = $objAnswer->selectAnswer($i); if ($objExercise->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) { @@ -400,7 +419,7 @@ if ($modifyAnswers) { $_SESSION['tmp_answers']['destination'] = $destination; } - $lessAnswers = isset($lessAnswers) ? $lessAnswers : false; + $lessAnswers = isset($_POST['lessAnswers']) ? true : false; if ($lessAnswers) { if ($answerType == HOT_SPOT_DELINEATION) { $lest_answer = 1; @@ -438,7 +457,8 @@ if ($modifyAnswers) { } } - $moreAnswers = isset($moreAnswers) ? $moreAnswers : false; + $moreAnswers = isset($_POST['moreAnswers']) ? true : false; + if ($moreAnswers) { if ($nbrAnswers < 12) { $nbrAnswers++; @@ -457,7 +477,9 @@ if ($modifyAnswers) { } } - $moreOARAnswers = isset($moreOARAnswers) ? $moreOARAnswers : false; + + $moreOARAnswers = isset($_POST['moreOARAnswers']) ? true : false; + if ($moreOARAnswers) { if ($nbrAnswers < 12) { // Add a new answer @@ -481,9 +503,24 @@ if ($modifyAnswers) { echo str_repeat(' ', 4) . '$answerType is HOT_SPOT' . "
\n"; } if ($answerType == HOT_SPOT_DELINEATION) { - $hotspot_colors = array("", "#4271B5", "#FE8E16", "#45C7F0", "#BCD631", "#D63173", "#D7D7D7", "#90AFDD", "#AF8640", "#4F9242", "#F4EB24", "#ED2024", "#3B3B3B"); + $hotspot_colors = array( + "", + "#4271B5", + "#FE8E16", + "#45C7F0", + "#BCD631", + "#D63173", + "#D7D7D7", + "#90AFDD", + "#AF8640", + "#4F9242", + "#F4EB24", + "#ED2024", + "#3B3B3B" + ); } else { - $hotspot_colors = array("", // $i starts from 1 on next loop (ugly fix) + $hotspot_colors = array( + "", // $i starts from 1 on next loop (ugly fix) "#4271B5", "#FE8E16", "#45C7F0", @@ -496,7 +533,8 @@ if ($modifyAnswers) { "#F4EB24", "#ED2024", "#3B3B3B", - "#F7BDE2"); + "#F7BDE2" + ); } Display::tag('h3', get_lang('Question') . ": " . $questionName . ' ' . strip_tags(get_lang('HotspotChoose')) . ''); @@ -504,503 +542,450 @@ if ($modifyAnswers) { Display::display_normal_message($msgErr); //main API } - $hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId; + $hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId.'&'.api_get_cidreq(); ?> -
- - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - ' . get_lang('Thresholds') . ''; ?> + + + + + + + 'TestProposedAnswer' + ); + $form->add_html_editor('comment['.$i.']', null, false, false, $config); + $renderer = $form->defaultRenderer(); + $form_template = '{content}'; + $renderer->setFormTemplate($form_template); + $element_template = ' + {label} + {element} + '; + $renderer->setElementTemplate($element_template); + + $form->setDefaults(array('comment['.$i.']' => $commentValue)); + $return = $form->return_form(); + ?> + + + + + + get_flat_list(); + $select_lp_id = array(); + $option_lp = ''; + $isSelected = false; + foreach ($flat_list as $id => $details) { + $selected = ''; + $select_lp_id[$id] = $details['lp_name']; + if (isset($lp_noerror) && $id == $lp_noerror) { + $selected = 'selected="selected"'; + $isSelected = true; + } + $option_lp.=''; + } + + if ($isSelected) { + $option_lp = '' . $option_lp; + } else { + $option_lp = '' . $option_lp; + } + + // Feedback SELECT + $question_list = $objExercise->selectQuestionList(); + $option_feed = ''; + $option_feed.=''; + $details = isset($details) ? $details : null; + $id = isset($id) ? $id : 0; + $selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; + foreach ($question_list as $key => $questionid) { + $selected = ''; + $question = Question::read($questionid); + $val = 'Q' . $key . ' :' . substrwords($question->selectTitle(), ICON_SIZE_SMALL); + $select_lp_id[$id] = $details['lp_name']; + if ($questionid == $selectQuestionNoError) { + $selected = 'selected="selected"'; + } + $option_feed.=''; + } + if ($selectQuestionNoError == -1) + $option_feed.=''; + else + $option_feed.=''; + + if ($answerType == HOT_SPOT_DELINEATION) { ?> + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + +
  *
+ + + + + + + + +
+ + + + + + + ' . get_lang('Thresholds') . ''; ?> selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - ' . get_lang('Scenario') . ''; ?> + + + ' . get_lang('Scenario') . ''; ?> - + + + + * - - - get_flat_list(); //loading list of LPs - - for ($i = 1; $i <= $nbrAnswers; $i++) { - // is an delineation - if ($answerType == HOT_SPOT_DELINEATION) { + $list = new LearnpathList(api_get_user_id()); + // Loading list of LPs + $flat_list = $list->get_flat_list(); - $select_lp_id = array(); - $option_lp = ''; - - // setting the LP - $isSelected = false; - foreach ($flat_list as $id => $details) { - $select_lp_id[$id] = $details['lp_name']; - $selected = ''; - if ($id == $lp[$i]) { - $isSelected = true; - $selected = 'selected="selected"'; - } - $option_lp.=''; - } - if ($isSelected) { - $option_lp = '' . $option_lp; - } else { - $option_lp = '' . $option_lp; + for ($i = 1; $i <= $nbrAnswers; $i++) { + // is an delineation + if ($answerType == HOT_SPOT_DELINEATION) { + $select_lp_id = array(); + $option_lp = ''; + + // setting the LP + $isSelected = false; + foreach ($flat_list as $id => $details) { + $select_lp_id[$id] = $details['lp_name']; + $selected = ''; + if ($id == $lp[$i]) { + $isSelected = true; + $selected = 'selected="selected"'; } + $option_lp.=''; + } + if ($isSelected) { + $option_lp = '' . $option_lp; + } else { + $option_lp = '' . $option_lp; + } - //Feedback SELECT - $question_list = $objExercise->selectQuestionList(); - $option_feed = ''; - $option_feed.=''; - - foreach ($question_list as $key => $questionid) { - $selected = ''; - $question = Question::read($questionid); - $val = 'Q' . $key . ' :' . substrwords($question->selectTitle(), ICON_SIZE_SMALL); - $select_lp_id[$id] = $details['lp_name']; - if ($questionid == $select_question[$i]) { - $selected = 'selected="selected"'; - } - $option_feed.=''; + // Feedback SELECT + $question_list = $objExercise->selectQuestionList(); + $option_feed = ''; + $option_feed.=''; + + foreach ($question_list as $key => $questionid) { + $selected = ''; + $question = Question::read($questionid); + $val = 'Q' . $key . ' :' . substrwords($question->selectTitle(), ICON_SIZE_SMALL); + $select_lp_id[$id] = $details['lp_name']; + if ($questionid == $select_question[$i]) { + $selected = 'selected="selected"'; } - if ($select_question[$i] == -1) - $option_feed.=''; - else - $option_feed.=''; - - //-------- IF it is a delineation - - if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { - for ($k = 1; $k <= 100; $k++) { - $selected1 = $selected2 = $selected3 = ''; - if ($k == $threadhold1[$i]) - $selected1 = 'selected="selected"'; - if ($k == $threadhold2[$i]) - $selected2 = 'selected="selected"'; - if ($k == $threadhold3[$i]) - $selected3 = 'selected="selected"'; - $option1.=''; - $option2.=''; - $option3.=''; - } - ?> - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - - - - + $option_feed.=''; + } + if ($select_question[$i] == -1) { + $option_feed .= ''; + } else { + $option_feed .= ''; + } - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + //-------- IF it is a delineation + + if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { + for ($k = 1; $k <= 100; $k++) { + $selected1 = $selected2 = $selected3 = ''; + if ($k == $threadhold1[$i]) + $selected1 = 'selected="selected"'; + if ($k == $threadhold2[$i]) + $selected2 = 'selected="selected"'; + if ($k == $threadhold3[$i]) + $selected3 = 'selected="selected"'; + $option1.=''; + $option2.=''; + $option3.=''; + } + ?> + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + } elseif (false) { + ?> + + + + + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + + - ToolbarSet = 'TestProposedAnswer'; - $oFCKeditor->Config['ToolbarStartExpanded'] = 'false'; - $oFCKeditor->Width = '100%'; - $oFCKeditor->Height = '100'; - $oFCKeditor->Value = $content; - //$return = $oFCKeditor->CreateHtml(); - $return = $oFCKeditor->editor("comment[$i]", $oFCKeditor->Value);*/ - /* */ - ?> - - - - - - get_flat_list(); - $select_lp_id = array(); - $option_lp = ''; - $isSelected = false; - foreach ($flat_list as $id => $details) { - $selected = ''; - $select_lp_id[$id] = $details['lp_name']; - if ($id == $lp_noerror) { - $selected = 'selected="selected"'; - $isSelected = true; - } - $option_lp.=''; - } - - if ($isSelected) { - $option_lp = '' . $option_lp; - } else { - $option_lp = '' . $option_lp; - } - - //Feedback SELECT - - $question_list = $objExercise->selectQuestionList(); - $option_feed = ''; - $option_feed.=''; - $details = isset($details) ? $details : null; - $id = isset($id) ? $id : 0; - $selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; - foreach ($question_list as $key => $questionid) { - $selected = ''; - $question = Question::read($questionid); - $val = 'Q' . $key . ' :' . substrwords($question->selectTitle(), ICON_SIZE_SMALL); - $select_lp_id[$id] = $details['lp_name']; - if ($questionid == $selectQuestionNoError) { - $selected = 'selected="selected"'; - } - $option_feed.=''; - } - if ($selectQuestionNoError == -1) - $option_feed.=''; - else - $option_feed.=''; - - if ($answerType == HOT_SPOT_DELINEATION) { - ?> - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + - - - - - -
  * *
-
- -
-

-

-

-

-
-

- % -

- % -

- % -
-
-
- - - -
- -
- - - - - -
- /> - -

- -
- - - -

-
- -

-
- - - -
-
 
- - - - - - - -
+
+ +
+

+

+

+

+
+

+ % +

+ % +

+ % +
+
+
+ + + +
+ +
+ + - - - - - - +
- - - - -
- /> - -

- -
- -

- -
- -

-
- -
+ /> + +

+
+ +

+
+ +

+
+
 
+
 
+ + + + + + + + + - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - +
 * 
-
-
- - - - - - - - - - -
- /> - -

- -
- -

-
- -

-
- - -
+ /> + +

+ +
+ +

+
+ +

+
+
 
+
 
 * 
- +   - - - - - - + + + - - -
 
- - - -
- /> - + /> +

-
- +

- -
- +
+

-
- +
  
+ +
+
+
+ +   + + + + + + + + + +
 
+ + + + + + + + +
+ /> + +

+
+ +

+
+ +

+
+ +
+
  
- +
diff --git a/main/exercice/hotspot_save.inc.php b/main/exercice/hotspot_save.inc.php index 44f9decbcf..5bd499c353 100755 --- a/main/exercice/hotspot_save.inc.php +++ b/main/exercice/hotspot_save.inc.php @@ -8,7 +8,7 @@ * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ */ -include('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER); $questionId = intval($_GET['questionId']); diff --git a/main/exercice/hotspot_savescore.inc.php b/main/exercice/hotspot_savescore.inc.php index 79d4cd1ca8..9e58f151d1 100755 --- a/main/exercice/hotspot_savescore.inc.php +++ b/main/exercice/hotspot_savescore.inc.php @@ -7,7 +7,7 @@ * @author Toon Keppens * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ */ -include('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; $courseCode = $_GET['coursecode']; $questionId = $_GET['questionId']; $coordinates = $_GET['coord']; @@ -36,7 +36,7 @@ foreach ($coords as $coord) { } $coordinates = substr($coordinates,0,-1); -$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); +$TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); // Save into db $sql = "INSERT INTO $TBL_TRACK_E_HOTSPOT (user_id , course_id , quiz_id , question_id , answer_id , correct , coordinate ) VALUES ( ".intval($_user['user_id']).", diff --git a/main/exercice/hotspot_updatescore.inc.php b/main/exercice/hotspot_updatescore.inc.php index 94d6c2a72a..a4dab2e46d 100755 --- a/main/exercice/hotspot_updatescore.inc.php +++ b/main/exercice/hotspot_updatescore.inc.php @@ -8,7 +8,7 @@ * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ */ -include '../inc/global.inc.php'; +require_once '../inc/global.inc.php'; $courseCode = $_GET['coursecode']; $questionId = $_GET['questionId']; @@ -47,7 +47,7 @@ foreach ($coords as $coord) { } $coordinates = substr($coordinates,0,-1); -$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); +$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); // update db $update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId];