Project: Jui Mehta Master Thesis Questionnaire
I have a Random Generator question (ID: RG01) with 4 codes:
1 = Branded House
2 = House of Brands
3 = Endorsed Brands
4 = Hybrid Brands
I'm using it to randomly assign respondents to one of four experimental conditions. On the same page as RG01, I placed a PHP code element to branch based on the drawn value:
$grp = value('RG01');
if ($grp == 1) { goToPage('bhstart'); }
elseif ($grp == 2) { goToPage('hobstart'); }
elseif ($grp == 3) { goToPage('ebstart'); }
elseif ($grp == 4) { goToPage('hybstart'); }
pageStop();
This consistently produces the error: "Variable RG01 is unknown to this project (see listing of variables). Therefore no result can be retrieved."
This happens even when:
- Testing from a completely fresh incognito browser session
- Starting the pretest from page 1
- The PHP code sits on the exact same page as RG01, with pageStop() added
- RG01 is confirmed correctly registered in Variables Listing with the correct 4 codes
- There are no draw limits or restrictions under RG01's Management tab
- The PHP code has been manually retyped (not pasted) to rule out formatting issues
I've also tried splitting RG01 and the branching code onto two separate consecutive pages, with the same result.
What could cause value('RG01') to be unavailable even directly on RG01's own page? Is there a project-level setting I might be missing?