/
run_attempt.html
120 lines (115 loc) · 6.87 KB
/
run_attempt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{% load static %}
{% load i18n %}
{% load statici18n %}
<!doctype html>
<html>
<head>
<title>{{attempt.resource.title}}</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" href="{% static "run_attempt.css" %}"></link>
</head>
<body>
{% include "numbas_lti/csrf_token_form.html" %}
<div id="status-display" tabindex="1" class="ok">
<span class="symbol">!</span>
<span class="status-message text-unavailable-at">
<div class="text">
<p>{% blocktrans with available_until=available_until|date:"r" %}This attempt will automatically close at <span class="available-until">{{available_until}}</span>, if not already closed. {% endblocktrans %}</p>
</div>
</span>
<span class="status-message text-ended">
<div class="text">
<p>{% blocktrans with available_until=available_until|date:"r" %}This attempt automatically closed at <span class="available-until">{{available_until}}</span>{% endblocktrans %}</p>
</div>
</span>
<span class="status-message text-terminated">
<div class="text">
<p>{% trans "Attempt data is being saved to the database. Please wait." %}</p>
</div>
</span>
<span class="status-message text-ok">
<div class="text">
<p>{% trans "All attempt data has been saved to the database. You may now close this window." %}</p>
{% if attempt.resource.require_lockdown_app == 'seb' %}
<p><a href="{{SEB_QUIT_LINK}}">{% translate "Close the window" %}</a></p>
{% endif %}
</div>
</span>
<span class="status-message text-disconnected">
<div class="text">
<p>{% trans "There is currently no connection to the server - your attempt data can not be saved to the database." %}</p>
<p>{% trans "When the connection is restored, data will be saved to the database." %}</p>
<p class="text-localstorage-used">{% trans "Data is being saved locally, so you'll be able to resume this attempt <strong>from this device</strong> when the connection is restored." %}</p>
{% if support_name %}<p>{% trans "If this warning remains visible for a long time, please contact " %}{% if support_url %}<a href="{{support_url}}">{% endif %}{{support_name}}{% if support_url %}</a>{% endif %}.</p>{% endif %}
</div>
</span>
<span class="status-message text-confirmation">
<div class="text">
<p>{% trans "The following code can be used by your instructor to verify the information in this receipt:" %}</p>
<pre id="receipt-code"></pre>
</div>
</span>
<span class="status-message text-failed-final-ajax">
<div class="text">
<p>{% trans "There was an error closing this attempt. Please ask your instructor to check that your data has been saved correctly." %}</p>
<button type="button" id="try-final-ajax-again">{% trans "Try again" %}</button>
</div>
</span>
<span class="status-message text-loading-error">
<div class="text">
<p>{% trans "There was an error loading the data for this attempt. Please reload the page." %}</p>
<button type="button" onclick="location.reload()">{% trans "Reload the page" %}</button>
</div>
</span>
</div>
<div id="deadline-change-display" tabindex="1">
<p>{% blocktrans %}The availability dates for this attempt have changed. The attempt is available until <span class="available-until"></span>.{% endblocktrans %}</p>
<p>{% trans "Click this message to dismiss it." %}</p>
</div>
<div id="scorm-player-container">
<h1 style="text-align: center">Loading "{{attempt.resource.title}}"</h1>
</div>
{% if load_cmi %}
<script>
/*! modernizr 3.3.1 (Custom Build) | MIT *
* https://modernizr.com/download/?-websockets-setclasses !*/
!function(e,n,s){function o(e,n){return typeof e===n}function a(){var e,n,s,a,t,l,c;for(var r in f)if(f.hasOwnProperty(r)){if(e=[],n=f[r],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(s=0;s<n.options.aliases.length;s++)e.push(n.options.aliases[s].toLowerCase());for(a=o(n.fn,"function")?n.fn():n.fn,t=0;t<e.length;t++)l=e[t],c=l.split("."),1===c.length?Modernizr[c[0]]=a:(!Modernizr[c[0]]||Modernizr[c[0]]instanceof Boolean||(Modernizr[c[0]]=new Boolean(Modernizr[c[0]])),Modernizr[c[0]][c[1]]=a),i.push((a?"":"no-")+c.join("-"))}}function t(e){var n=c.className,s=Modernizr._config.classPrefix||"";if(r&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+s+"no-js(\\s|$)");n=n.replace(o,"$1"+s+"js$2")}Modernizr._config.enableClasses&&(n+=" "+s+e.join(" "+s),r?c.className.baseVal=n:c.className=n)}var i=[],f=[],l={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var s=this;setTimeout(function(){n(s[e])},0)},addTest:function(e,n,s){f.push({name:e,fn:n,options:s})},addAsyncTest:function(e){f.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=l,Modernizr=new Modernizr;var c=n.documentElement,r="svg"===c.nodeName.toLowerCase(),u=!1;try{u="WebSocket"in e&&2===e.WebSocket.CLOSING}catch(d){}Modernizr.addTest("websockets",u),a(),t(i),delete l.addTest,delete l.addAsyncTest;for(var p=0;p<Modernizr._q.length;p++)Modernizr._q[p]();e.Modernizr=Modernizr}(window,document);
if(!Modernizr.websockets) {
window.location = '/no-websockets';
}
</script>
{% get_current_language as LANGUAGE_CODE %}
<script src="{% statici18n LANGUAGE_CODE %}"></script>
<script type="text/javascript" src="{% static 'robust-websocket.js' %}"></script>
<script type="text/javascript" src="{% static 'promise.min.js' %}"></script>
<script type="text/javascript" src="{% static 'fetch.js' %}"></script>
<script type="text/javascript" src="{% static 'polyfills.js' %}"></script>
{% include "numbas_lti/scripts/luxon.html" %}
<script type="text/javascript" src="{% static 'api.js' %}"></script>
{{js_vars|json_script:"js_vars"}}
<script type="text/javascript" src="{% static 'run_attempt.js' %}"></script>
{% endif %}
<script type="text/javascript">
window.addEventListener('load',function() {
function resize_iframe() {
var iframe = document.getElementById('scorm-player');
if(!(iframe && iframe.contentWindow)) {
return;
}
try {
var dh = document.documentElement.getBoundingClientRect().bottom;
var ih = iframe.clientHeight;
var oh = dh-ih;
var wh = window.innerHeight;
var h = wh-oh-10;
var height = Math.max(500,h);
iframe.style.height = height+'px';
} catch(e) {
}
}
setInterval(resize_iframe,500);
});
</script>
</body>
</html>