You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
working on adding a minimum version check for lockdown apps
We want to set a minimum version of the lockdown app that students must
have, so we can deprecate old versions and ensure compatibility with the
Numbas runtime.
The immediate motivation is that the new Numbas default theme will use
CSS features that weren't supported by the old versions of the Numbas
lockdown app or SEB.
This also consolidates a lot of the lockdown app launch logic in a class
called numbas_lti.lockdown_app.LockdownApp, which has subclasses for the
Numbas app and SEB, as well as a trivial one for "no lockdown app
required".
TODO:
* Check version numbers on the iOS and Android Numbas apps
* Check how SEB puts its version number in the user agent
raiseValueError(f"{version_string} is not a valid version number.")
63
+
64
+
defcompare_versions(a: str, b: str) ->int:
65
+
a=parse_version(a)
66
+
b=parse_version(b)
67
+
return1ifa>belse-1ifa<belse0
68
+
69
+
classLockdownApp:
70
+
app_name=''
71
+
app_name_display=''
72
+
73
+
def__init__(self, request):
74
+
self.request=request
75
+
76
+
defis_lockdown_app(self) ->bool:
77
+
raiseNotImplementedError
78
+
79
+
defget_app_version(self):
80
+
""" Return (version: str, platform: str)
81
+
"""
82
+
raiseNotImplementedError
83
+
84
+
defget_install_url(self) ->str:
85
+
raiseNotImplementedError
86
+
87
+
defshow_lockdown_link(self):
88
+
"""
89
+
Show the link to open the lockdown app.
90
+
"""
91
+
92
+
raiseNotImplementedError
93
+
94
+
95
+
defcheck_version(self):
96
+
"""
97
+
Raises an OldVersionException if the user's version of the app is older than the minimum specified in settings.LOCKDOWN_APP['minimum_version'][this.app_name][platform]
{% if request.resource.show_lockdown_app_password and password %}
@@ -31,8 +31,8 @@ <h1>
31
31
</div>
32
32
{% endif %}
33
33
34
-
<p>{% translate "Or, click the link below to open this resource in the Numbas lockdown app:" %}</p>
35
-
<p><aclass="button large primary" href="{{lockdown_url}}">{% translate "Launch in the Numbas lockdown app" %}</a></p>
34
+
<p>{% blocktranslate with app_name=app_name %}Or, click the link below to open this resource in {{app_name}}{% endblocktranslate %}</p>
35
+
<p><aclass="button large primary" href="{{launch_url}}">{% blocktranslate with app_name=app_name %}Launch in {{app_name}}{% endblocktranslate %}</a></p>
{% block title %}{% blocktranslate with app=app %}Please upgrade {{app}}{% endblocktranslate %} - {{block.super}}{% endblock title %}
6
+
7
+
{% block content %}
8
+
<header>
9
+
<h1>
10
+
{% blocktranslate with app=app %}Please upgrade {{app}}{% endblocktranslate %}
11
+
</h1>
12
+
</header>
13
+
14
+
<main>
15
+
<p>{% blocktranslate with app_name=app_name %}The version of {{app_name}} that you are using is out of date.{% endblocktranslate %}</p>
16
+
<p>{% blocktranslate with version=version min_version=min_version %}You have version {{version}} but version {{min_version}} or newer is required.{% endblocktranslate %}</p>
17
+
<p>{% blocktranslate %}Please install the latest version, and then open this link again.{% endblocktranslate %}</p>
0 commit comments