|
@@ -1,4 +1,4 @@
|
|
|
-<?php
|
|
|
+<?php
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
@@ -30,7 +30,7 @@
|
|
|
* One question can be in several exercises
|
|
|
* @package dokeos.exercise
|
|
|
* @author Olivier Brouckaert
|
|
|
-* @version $Id: question_pool.php 17300 2008-12-15 20:05:50Z ivantcholakov $
|
|
|
+* @version $Id: question_pool.php 17302 2008-12-15 21:13:36Z ivantcholakov $
|
|
|
*/
|
|
|
|
|
|
|
|
@@ -189,28 +189,28 @@ if($is_allowedToEdit)
|
|
|
|
|
|
if($exerciseId > 0)
|
|
|
{
|
|
|
- $sql="SELECT id,question,type FROM $TBL_EXERCICE_QUESTION,$TBL_QUESTIONS WHERE question_id=id AND exercice_id='".Database::escape_string($exerciseId)."' ORDER BY question_order";
|
|
|
+ $sql="SELECT id,question,type FROM $TBL_EXERCICE_QUESTION,$TBL_QUESTIONS WHERE question_id=id AND exercice_id='".Database::escape_string($exerciseId)."' ORDER BY question_order LIMIT $from, ".($limitQuestPage + 1);
|
|
|
}
|
|
|
|
|
|
elseif($exerciseId == -1)
|
|
|
{
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
$sql='SELECT questions.id, questions.question, questions.type, quizz_questions.exercice_id FROM '.$TBL_QUESTIONS.
|
|
|
' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions ON questions.id=quizz_questions.question_id LEFT JOIN '.$TBL_EXERCICES.
|
|
|
- ' as exercices ON exercice_id=exercices.id WHERE quizz_questions.exercice_id IS NULL OR exercices.active = -1';
|
|
|
+ ' as exercices ON exercice_id=exercices.id WHERE quizz_questions.exercice_id IS NULL OR exercices.active = -1 LIMIT '.$from.', '.($limitQuestPage + 1);
|
|
|
}
|
|
|
|
|
|
else
|
|
|
{
|
|
|
- $sql="SELECT id,question,type FROM $TBL_QUESTIONS";
|
|
|
+ $sql="SELECT id,question,type FROM $TBL_QUESTIONS LIMIT $from, ".($limitQuestPage + 1);
|
|
|
|
|
|
$exerciseId=0;
|
|
|
}
|