diff --git a/main/exercice/admin.php b/main/exercice/admin.php index e53ff87a8c..44935a0ae1 100644 --- a/main/exercice/admin.php +++ b/main/exercice/admin.php @@ -60,7 +60,7 @@ * * @package dokeos.exercise * @author Olivier Brouckaert -* @version $Id: admin.php 10789 2007-01-18 19:18:27Z pcool $ +* @version $Id: admin.php 10791 2007-01-19 09:02:48Z elixir_inter $ */ @@ -416,7 +416,6 @@ function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) } // --> "; -$interbreadcrumb[] = array ("url"=>"exercice.php", "name"=> get_lang('Exercices')); Display::display_header($nameTools,"Exercise"); ?> diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php index 4a1c5e61fc..8c8bfeac65 100644 --- a/main/exercice/question.class.php +++ b/main/exercice/question.class.php @@ -22,7 +22,7 @@ * File containing the Question class. * @package dokeos.exercise * @author Olivier Brouckaert -* @version $Id: question.class.php 10789 2007-01-18 19:18:27Z pcool $ +* @version $Id: question.class.php 10791 2007-01-19 09:02:48Z elixir_inter $ */ @@ -104,7 +104,7 @@ abstract class Question $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION); - $sql="SELECT question,description,ponderation,position,type,picture FROM `$TBL_QUESTIONS` WHERE id='$id'"; + $sql="SELECT question,description,ponderation,position,type,picture FROM $TBL_QUESTIONS WHERE id='$id'"; $result=api_sql_query($sql,__FILE__,__LINE__); @@ -460,7 +460,7 @@ abstract class Question $Extension=$picture[sizeof($picture)-1]; $picture='quiz-'.$questionId.'.'.$Extension; - $sql="UPDATE `$TBL_QUESTIONS` SET picture='$picture' WHERE id='$questionId'"; + $sql="UPDATE $TBL_QUESTIONS SET picture='$picture' WHERE id='$questionId'"; api_sql_query($sql,__FILE__,__LINE__); return @copy($picturePath.'/'.$this->picture,$picturePath.'/'.$picture)?true:false; @@ -547,13 +547,13 @@ abstract class Question // question already exists if($id) { - $sql="UPDATE `$TBL_QUESTIONS` SET question='$question',description='$description',ponderation='$weighting',position='$position',type='$type',picture='$picture' WHERE id='$id'"; + $sql="UPDATE $TBL_QUESTIONS SET question='$question',description='$description',ponderation='$weighting',position='$position',type='$type',picture='$picture' WHERE id='$id'"; api_sql_query($sql,__FILE__,__LINE__); } // creates a new question else { - $sql="INSERT INTO `$TBL_QUESTIONS`(question,description,ponderation,position,type,picture) VALUES('$question','$description','$weighting','$position','$type','$picture')"; + $sql="INSERT INTO $TBL_QUESTIONS(question,description,ponderation,position,type,picture) VALUES('$question','$description','$weighting','$position','$type','$picture')"; api_sql_query($sql,__FILE__,__LINE__); $this->id=mysql_insert_id(); @@ -651,7 +651,7 @@ abstract class Question $sql="DELETE FROM `$TBL_EXERCICE_QUESTION` WHERE question_id='$id'"; api_sql_query($sql,__FILE__,__LINE__); - $sql="DELETE FROM `$TBL_QUESTIONS` WHERE id='$id'"; + $sql="DELETE FROM $TBL_QUESTIONS WHERE id='$id'"; api_sql_query($sql,__FILE__,__LINE__); $sql="DELETE FROM `$TBL_REPONSES` WHERE question_id='$id'"; @@ -685,7 +685,7 @@ abstract class Question $position=$this->position; $type=$this->type; - $sql="INSERT INTO `$TBL_QUESTIONS`(question,description,ponderation,position,type) VALUES('$question','$description','$weighting','$position','$type')"; + $sql="INSERT INTO $TBL_QUESTIONS(question,description,ponderation,position,type) VALUES('$question','$description','$weighting','$position','$type')"; api_sql_query($sql,__FILE__,__LINE__); $id=mysql_insert_id(); diff --git a/main/exercice/question_pool.php b/main/exercice/question_pool.php index 34f920ff3d..4b882d0b0d 100644 --- a/main/exercice/question_pool.php +++ b/main/exercice/question_pool.php @@ -24,7 +24,7 @@ * One question can be in several exercises * @package dokeos.exercise * @author Olivier Brouckaert -* @version $Id: question_pool.php 10789 2007-01-18 19:18:27Z pcool $ +* @version $Id: question_pool.php 10791 2007-01-19 09:02:48Z elixir_inter $ */ // name of the language file that needs to be included @@ -152,19 +152,19 @@ if($is_allowedToEdit) // if we have selected an exercise in the list-box 'Filter' if($exerciseId > 0) { - $sql="SELECT id,question,type FROM `$TBL_EXERCICE_QUESTION`,`$TBL_QUESTIONS` WHERE question_id=id AND exercice_id='$exerciseId' ORDER BY position LIMIT $from,".($limitQuestPage+1); + $sql="SELECT id,question,type FROM `$TBL_EXERCICE_QUESTION`,$TBL_QUESTIONS WHERE question_id=id AND exercice_id='$exerciseId' ORDER BY position LIMIT $from,".($limitQuestPage+1); $result=api_sql_query($sql,__FILE__,__LINE__); } // if we have selected the option 'Orphan questions' in the list-box 'Filter' elseif($exerciseId == -1) { - $sql="SELECT id,question,type FROM `$TBL_QUESTIONS` LEFT JOIN `$TBL_EXERCICE_QUESTION` ON question_id=id WHERE exercice_id IS NULL ORDER BY question LIMIT $from,".($limitQuestPage+1); + $sql="SELECT id,question,type FROM $TBL_QUESTIONS LEFT JOIN `$TBL_EXERCICE_QUESTION` ON question_id=id WHERE exercice_id IS NULL ORDER BY question LIMIT $from,".($limitQuestPage+1); $result=api_sql_query($sql,__FILE__,__LINE__); } // if we have not selected any option in the list-box 'Filter' else { - $sql="SELECT id,question,type FROM `$TBL_QUESTIONS` LEFT JOIN `$TBL_EXERCICE_QUESTION` ON question_id=id WHERE exercice_id IS NULL OR exercice_id<>'$fromExercise' GROUP BY id ORDER BY question LIMIT $from,".($limitQuestPage+1); + $sql="SELECT id,question,type FROM $TBL_QUESTIONS LEFT JOIN `$TBL_EXERCICE_QUESTION` ON question_id=id WHERE exercice_id IS NULL OR exercice_id<>'$fromExercise' GROUP BY id ORDER BY question LIMIT $from,".($limitQuestPage+1); $result=api_sql_query($sql,__FILE__,__LINE__); // forces the value to 0