Ckeditor - hotspot fixes.

1.10.x
Julio Montoya 10 years ago
parent 5d351996b3
commit 662238a892
  1. 25
      main/exercice/admin.php
  2. 959
      main/exercice/hotspot_admin.inc.php
  3. 2
      main/exercice/hotspot_save.inc.php
  4. 4
      main/exercice/hotspot_savescore.inc.php
  5. 4
      main/exercice/hotspot_updatescore.inc.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];
}
</script>';
$htmlHeadXtra[] = "<script type=\"text/javascript\" src=\"../plugin/hotspot/JavaScriptFlashGateway.js\"></script>
@ -523,7 +521,6 @@ if ($newQuestion || $editQuestion) {
if ($newQuestion == 'yes') {
$objExercise->edit_exercise_in_lp = true;
}
require 'question_admin.inc.php';
}

File diff suppressed because it is too large Load Diff

@ -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']);

@ -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']).",

@ -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];

Loading…
Cancel
Save