Hello everyone,
I am encountering a problem in OTree: I want the participants to play a Uno games for 5 rounds. I am using an UNO app for which I have several files (scripts, style, images).
After dropping everything in the _static folder, I managed to load the primary scripts, as well as the style.css, but the problem I'm encountering is that the main.js file is loading other .js files, which are then not found because they are loaded elsewhere and not in the static folder. More precisely, the error code in the console reads as follows: "
Loading failed for the <script> with source
« http://localhost:8000/p/kkbrzfeu/Introduction/Test_Uno/scripts/c3runtime.js ».
Below is my code for the template form:
{% extends "global/Page.html" %}
{% load otree %}
{% block title %}TEST{% endblock %}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="description" content="UNO">
<link rel="manifest" href="{{ static "HTML_Uno/scripts/appmanifest.json" }}">
<link rel="apple-touch-icon" href="{{ static "HTML_Uno/icons/icon-128.png" }}">
<link rel="apple-touch-icon" href="{{ static "HTML_Uno/icons/icon-256.png" }}">
<link rel="apple-touch-icon" href="{{ static "HTML_Uno/icons/icon-512.png" }}">
<link rel="icon" type="image/png" href="{{ static "HTML_Uno/icons/icon-512.png" }}">
<link rel="stylesheet" href="{{ static "HTML_Uno/style.css" }}">
</head>
<body>
<div id="fb-root">
<noscript>
<div id="notSupportedWrap">
<h2 id="notSupportedTitle">This content requires JavaScript</h2>
<p class="notSupportedMessage">JavaScript appears to be disabled. Please enable it to view this content.</p>
</div>
</noscript>
<script src="{{ static "HTML_Uno/scripts/supportcheck.js" }}"></script>
<script src="{{ static "HTML_Uno/scripts/offlineclient.js" }}"></script>
<script src="{{ static "HTML_Uno/scripts/main.js" }}"></script>
<script src="{{ static "HTML_Uno/scripts/register-sw.js" }}"></script>
</div>
</body>
I know that main.js is initiating
this file, for in the network tab, it says so. Thus, the issue is that I
do not know how to specify OTree to look in the _static folder and not
elsewhere.
I tried to specify
<script src="{{ static "HTML_Uno/scripts/c3runtime.js" }}"></script>, but without success.
Note that loading the game without OTree in a local web server yields no issues.
Can somebody know what to do?
Thank you in advance.