Closed (outdated)
Project:
Quiz
Version:
6.x-4.1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2011 at 19:39 UTC
Updated:
15 Jul 2016 at 20:28 UTC
Jump to comment: Most recent
Comments
Comment #1
webservant316 commentedPerhaps I could use the views_calc or views_crosstab modules to accomplish the same? Hoping for a tip from anyone who has figured out how to display the highest quiz score for the current logged in user with Views.
Thanks for any help.
Comment #2
mpearrow commentedCurious if you found a solution for this; I'm hoping to do the same thing.
Comment #3
webservant316 commentednot yet, but still interested.
Comment #4
lzimmerman commentedI'm not very familiar with Quiz + Views, but found your thread while tackling a similar problem.
Can you sort the view by descending score? If so, the first result returned should contain the highest score, and you could limit displayed results to one.
Comment #5
mpearrow commentedSo close :) In my case that trick does not work because I'm returning a list of many quizzes (and hence their various result_id cases where someone took the quiz more than once). If I limit to one record, I only get the top quiz out of all quizzes rather than the top instance of each quiz.
For example, if someone took Quiz 1 a total of 5 times and got scores of 0, 0, 20, 60, and 100, I'd only want to show the 100.
I'm pretty sure that just adding a MAX() in the correct query would have the desired effect. Just not sure exactly where to put it.
Comment #6
lzimmerman commentedI see the problem! Hmm, in my case I used an extra view to find the highest value, and created a template for the main view which loaded the second view and checked each row against that value. If the value was equal, it displayed the row.
You might be able to get the result you want by doing something like this:
1. Set up a view returning all quizzes (limited by current user, etc. as you like)
2. Set up a view with a quiz argument, sorting by score (probably returning just the top result)
3. In a template for #1, you could loop through the results (i.e. all appropriate quizzes), and for each one load view #2, which should return the top score for that quiz.
The "view of a view" approach is certainly roundabout, but might work. I hope you find a good solution - I'd love to know about any straightforward MAX() type method, because these kind of questions do seem to come up fairly often.
Comment #7
djdevinThis issue is being closed because it is filed against a version that is no longer supported.