Hi Matt & sivaji - thank you both again for your solutions regarding Pathauto & anonymous users/quiz takers #460550: Quiz URLs/Paths using Pathauto for Logged-in and Non-logged in users - this is working great and is greatly appreciated!
My new question - I was wondering about the feasibility of having the "Results/Report page" utilize a unique path - different from the "questions" pages (e.g. maybe something like a "results" token for both anonymous and logged-in users?).
My thinking here is that by distinguishing "questions" pages from the final "results/report" page (based on URL/path) - Drupal will allow themers to assign unique page templates for each. For instance, one could easily assign a "multi-column" template for "questions" and a "single-column" template for the final "results/report" page.
With the understanding that the path for logged-in users has no token applied (whereas paths for anonymous users does) I am not certain if this is even possible without a lot of "leg work." Any thoughts?
Comments
Comment #1
FWE commentedJust following up to see if anyone has any suggestions - thank you!
Comment #2
FWE commentedBump...
Just following up to see if anyone might have some insight - thanks!
Comment #3
FWE commentedBump...
Just hoping to break the silence :-).
Comment #4
anilo commentedHi,
I felt bad about the Bump's
I'm stuck at the same point, maybe worse... if that makes you feel any better :)
I've PathAutho'd the true/false questions to be /truefalse/*
and the quiz to be /quiz/*
However when I take the quiz, the path still shows as quiz/* and it completely ignores the truefalsequestion/* -- making life miserable.
I think the solution you find will work for me as well.
Maybe there's a way to check the content of the page .. and then shows blocks based on the existence of certain text. In your case, it would mean looking for text: "Question Results"
Comment #5
FWE commentedHi anilo,
My apologies for not replying sooner. I actually gave up on this thread due to the lack of input - but checked back last night and saw your post - thank you! From an end-user/user experience point of view - it would be beneficial to be able to to have more control over the URL's (e.g. theming would be a breeze!). With the patch used from my opening comment on this page (e.g. #460550: Quiz URLs/Paths using Pathauto for Logged-in and Non-logged in users) I am able to generate URL's like the following for anonymous users - have you tried this yet?:
quiz/title-of-quiz <<< This is the first page the user lands on for taking each specific quiz.
quiz/title-of-quiz?quizkey=8x92xw5... (e.g. random key - 32 characters) <<< all successive quiz questions have a unique key appended to the URL.
quiz/title-of-quiz?quizkey=7r45q5x... (e.g. random key - 32 characters) <<< final quiz report page - follows the same URL format as each question.
For my situation I am hoping to be able to change the last example to "quiz/title-of-quiz?quizresult=7r45q5x..." so that I can theme the results page separately from the actual questions.
I gotta believe that this is not too difficult to do - however, not being the greatest coder...I am at a loss for where to start.
Comment #6
aaronbaumannecro-bump
Comment #7
djdevinWe did a lot of work on this in 5.x. Most of Quiz is now REST-compliant, with the quiz, questions, feedback, and result pages having their own unique URLs.
Quiz - node/X
Question/Page - node/X/take/Y
Question/Page feedback - node/X/take/Y/feedback
Quiz result (for the user) - node/X/quiz-results/Y
So you would be able to place blocks on any of these URLs. You could even override these URLs with views/panels and create your own layouts. For example, "Y" after quiz-results is the result ID, and with the result ID, you could use views to generate the list of questions, etc.
The core issue here was "unique path for results/reports page" which is definitely done as part of the 5.x refactoring. I'd give 5.x a shot if you are looking into this as it's pretty stable and almost ready to be the "recommended" release.
Comment #8
aaronbauman5.x seems to be working great for me so far.
Thank you for all your effort!