Hi,
I have developed a custom module in order to implement a strange request in a multilanguage website.
The request was The following:
There 3 Quizzes with 12 questions each. They categorize each question of each Quiz as skill.
For example :
Quiz 1, Quiz 2, Quiz 3 - Question 1 = Skill 1
Quiz 1, Quiz 2, Quiz 3 - Question 2 = Skill 2
...
Quiz 1, Quiz 2, Quiz 3 - Question 12 = Skill 12
Then I should generate results per skill.
So I created question banks for each skill and I was getting the results filtering the banks.
So what I did is create Quiz categories (English, German, Italian, etc) and I was using the category as language filter.
Everything worked fine but then more languages came up.
ARI Quiz does not support language filtering. There is no language field in any table.
But the Quiz category is not in any of the Tables (ariquizstatistics, ariquizstatisticsinfo).
So what happens now is when getting the results from the database I get for all the languages
This is my query :
Code: |
$query = "select t.`QuestionCategoryId`, sum(maxScore)\n"
. "from (\n"
. "SELECT a.`QuestionCategoryId`,max(c.score) maxScore,b.UserId,c.`BankQuestionId` FROM `tct_ariquizstatistics` c \n"
. "join `tct_ariquizquestion` a on c.`BankQuestionId`=a.`QuestionId`\n"
. "join `tct_ariquizstatisticsinfo` b on b.`StatisticsInfoId`=c.`StatisticsInfoId`\n"
. "WHERE a.`Status` =1 and c.`Completed`=1 and b.UserId = " . $userId . "\n"
. "GROUP BY b.UserId,a.`QuestionCategoryId`,c.`BankQuestionId`\n"
. " ) t\n"
. "GROUP BY t.`QuestionCategoryId`";
|
where I can use the category id that I already have ?
This is Urgent so please help.
Thank you