patch_bug16.diff
| administrator/components/com_jquarks/models/quizzes.php (working copy) | ||
|---|---|---|
| 168 | 168 |
foreach($sets AS $set) |
| 169 | 169 |
{
|
| 170 | 170 |
// checking if the current set contain a question |
| 171 |
$query = 'SELECT randomSets.nquestions AS randomCount, count(setsofquestions_questions.id) AS customCount' . |
|
| 171 |
$query = 'SELECT soq.id, randomSets.nquestions AS randomCount, count(setsofquestions_questions.id) AS customCount' . |
|
| 172 | 172 |
' FROM #__jquarks_setsofquestions AS soq' . |
| 173 | 173 |
' LEFT JOIN #__jquarks_customsets AS customSets ON customSets.set_id = soq.id' . |
| 174 | 174 |
' LEFT JOIN #__jquarks_randomsets AS randomSets ON randomSets.set_id = soq.id' . |
| 175 | 175 |
' LEFT JOIN #__jquarks_setsofquestions_questions AS setsofquestions_questions ON setsofquestions_questions.setofquestions_id = customSets.set_id' . |
| 176 |
' WHERE soq.id = ' . $set ; |
|
| 176 |
' WHERE soq.id = ' . $set . |
|
| 177 |
' GROUP BY soq.id' ; |
|
| 177 | 178 |
|
| 178 | 179 |
$this->_db->setQuery($query) ; |
| 179 | 180 |
$count = $this->_db->loadObject() ; |
| administrator/components/com_jquarks/models/quiz.php (working copy) | ||
|---|---|---|
| 656 | 656 |
' GROUP BY questions.category_id' ; |
| 657 | 657 |
|
| 658 | 658 |
$this->_db->setQuery($query) ; |
| 659 |
echo $this->_db->getQuery() ; |
|
| 660 | 659 |
$array = $this->_db->loadObjectList() ; |
| 661 | 660 |
|
| 662 | 661 |
if (count($array) > 0) |
| ... | ... | |
| 723 | 722 |
' LEFT JOIN #__jquarks_customsets AS customSets ON soq.id = customSets.set_id' . |
| 724 | 723 |
' LEFT JOIN #__jquarks_randomsets AS randomSets ON soq.id = randomSets.set_id' . |
| 725 | 724 |
' LEFT JOIN #__jquarks_setsofquestions_questions AS setsofquestions_questions ON setsofquestions_questions.setofquestions_id = soq.id' . |
| 726 |
' WHERE soq.id = ' . $line['setofquestions_id'] ; |
|
| 725 |
' WHERE soq.id = ' . $line['setofquestions_id'] . |
|
| 726 |
' GROUP BY soq.id' ; |
|
| 727 | 727 |
|
| 728 | 728 |
$this->_db->setQuery($query) ; |
| 729 | 729 |
$set = $this->_db->loadObject() ; |