Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Need a table with answers from particular quizz
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: Need a table with answers from particular quizz
#10944
Need a table with answers from particular quizz 13 Years, 9 Months ago Karma: 0
Hello,

I have a big hope that you can help me easly.

I am using ari quiz for registration to medical conference.

There are 3 questions:
1) Name and surname (text question, `QuestionId` =430)
2) City (text question, `QuestionId` =431)
3) medical doctor or student (single question, `QuestionId` =432)

I'd love to get a table showing me in one row:
Name and surname | City | md / student

*It doesn't have to be included into joomla.

For example:

David Dickson | Chicago | medical doctor
Andrew Pas | Berlin | student
Matthew Palczewski | Wroclaw | student

Do you have any ideas?

I was trying with SQL question:
SELECT *
FROM `jos_ariquizstatistics`
WHERE `QuestionId` =430
OR `QuestionId` =431
OR `QuestionId` =432
LIMIT 0 , 30


but it's not satisfying me because:
- text answers looks like <answers><answers>[?] Matthew Palczewski</answer></answers>
- records are not in one row

Is it possible with your ARI Quiz system to get such an expected by me effect?
Thanks a lot for your time!

Mat
The administrator has disabled public write access.
 
#10959
Re:Need a table with answers from particular quizz 13 Years, 9 Months ago Karma: 760
Hello,

Could you specify what version of MySQL is installed on your server?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#10961
Re:Need a table with answers from particular quizz 13 Years, 9 Months ago Karma: 0
Sure,

it's MySQL 5.

Thanks
The administrator has disabled public write access.
 
#10963
Re:Need a table with answers from particular quizz 13 Years, 9 Months ago Karma: 760
If MySQL v. 5.1+ is installed on your server, you can use the following SQL query:

Code:


SELECT
ExtractValue(S_NAME.Data, 'answers/answer') AS Name,
ExtractValue(S_CITY.Data, 'answers/answer') AS City,
SUBSTR(
QV_DEGREE.Data, 
LOCATE(
'>',
QV_DEGREE.Data,
LOCATE(
ExtractValue(S_DEGREE.DATA, 'answers/answer/attribute::id'),
QV_DEGREE.Data
)


1, 
LOCATE(
'</answer>', 
QV_DEGREE.Data,
LOCATE(
ExtractValue(S_DEGREE.DATA, 'answers/answer/attribute::id'),
QV_DEGREE.Data
)


LOCATE(
'>',
QV_DEGREE.Data,
LOCATE(
ExtractValue(S_DEGREE.DATA, 'answers/answer/attribute::id'),
QV_DEGREE.Data
)


1
) AS Degree
FROM
  jos_ariquizstatisticsinfo SI LEFT JOIN jos_ariquizstatistics S_NAME
   ON SI.StatisticsInfoId = S_NAME.StatisticsInfoId
  LEFT JOIN jos_ariquizstatistics S_CITY
   ON SI.StatisticsInfoId = S_CITY.StatisticsInfoId
  LEFT JOIN jos_ariquizstatistics S_DEGREE
   ON SI.StatisticsInfoId = S_DEGREE.StatisticsInfoId
  LEFT JOIN jos_ariquizquestionversion QV_DEGREE
   ON S_DEGREE.QuestionVersionId = QV_DEGREE.QuestionVersionId
WHERE
 SI.QuizId = QUIZ_ID
 AND
 SI.Status = "Finished"
 AND
 S_NAME.QuestionId = 430
 AND
 S_CITY.QuestionId = 431
 AND
 S_DEGREE.QuestionId = 432



QUIZ_ID in "WHERE" clause is ID of quiz.

Regards,
ARI Soft
Last Edit: 2011/02/13 09:51 By admin.
The administrator has disabled public write access.
 
Go to topPage: 1