Need URL parameter to persist through user taking the quiz

Created on 6 July 2023, over 1 year ago
Updated 11 July 2023, over 1 year ago

Hi,
I need a URL parameters if added to the 1st page of the quiz to persist through user taking the quiz, e.g.
if quiz was called with
/node/1101/take/1?parameter=value
then for the rest of the questions and the quiz results page it should be:
/node/1101/take/2?parameter=value
/node/1101/take/3?parameter=value
...
/node/1101/quiz-results/32357/view?parameter=value

I'm using URL parameters to remove everything but quiz HTML elements from the page to display it inside iframe.

How can I achieve this, please? Thank you!

💬 Support request
Status

Closed: works as designed

Version

5.8

Component

Code - Quiz core

Created by

🇨🇦Canada gennadiy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gennadiy
  • Status changed to Closed: works as designed over 1 year ago
  • 🇨🇦Canada gennadiy

    Used the code inside page.tpl.php to accomplish it, thanks:

    // if ?view=clean is in referrer's URL redirect to the stripped template
    if (!empty($_SERVER['HTTP_REFERER'])) {
    	$parts = parse_url($_SERVER['HTTP_REFERER']);
    	parse_str($parts['query'], $query);
    	if ($query['view'] === 'clean') {
    		$goto_url='https://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI];
    		drupal_goto($goto_url, array('query' => array('view' => 'clean')));
    	}
    }
    
Production build 0.71.5 2024