#1
by
LIDONGDONG
We are running an oTree 6.x experiment deployed on Heroku and creating HITs on the MTurk Sandbox.
The HIT is created successfully, and workers can accept it, but the iframe content is completely blank (picture inattached).
At the moment, we cannot get any oTree content to render inside the MTurk iframe at all. After accepting the HIT, the MTurk page renders normally, but the embedded iframe area stays blank. In the Network tab, we only see requests to MTurk assets/pages, and we do not see any request reaching our oTree/Heroku domain.
here are some mturk_tamplate,html code resulting blank Mturk sandbox:
"<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Study</title>
</head>
<body>
<div id="_otree-content" class="container">
<div id="_otree-body">
<!-- oTree会自动在这里插入您实验的内容 -->
</div>
</div>
</body>
</html>"
"1. <!DOCTYPE html> <html> <head> <title>MTurk Study</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> </body> </html>"
"<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Study</title>
</head>
<body>
</body>
</html>"
We initially suspected this might be related to mturk_template.html (or the default template), because our current global/mturk_template.html was initially a minimal empty HTML page. We then tried adding an <iframe src="..."> using variables such as external_url, session_url, and link, but we received template errors like:
UndefinedVariable: Cannot resolve the variable 'external_url'
UndefinedVariable: Cannot resolve the variable 'session_url'
UndefinedVariable: Cannot resolve the variable 'link'
TemplateSyntaxError: Unrecognised filter name 'default:request.url'
Network tab shows only workersandbox.mturk.com and workersandbox.mturkcontent.com requests; nothing to our Heroku domain.
So we are unsure what the correct / supported template variables are in oTree 6.x, and what the expected default mturk_template.html should contain.