feat: LTI support and Moodle plugin

This commit is contained in:
Markos Gogoulos
2026-05-11 12:47:09 +03:00
committed by GitHub
parent b7427869b6
commit 55ab7ff34f
307 changed files with 19966 additions and 3748 deletions
+51
View File
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Returning to Course...</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #f5f5f5;
}
.loading {
text-align: center;
}
.spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #2196F3;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 0 auto 20px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="loading">
<div class="spinner"></div>
<p>Returning to your course...</p>
</div>
<!-- Auto-submit form that posts JWT back to Moodle -->
<form id="deepLinkReturnForm" method="post" action="{{ return_url }}" style="display: none;">
<input type="hidden" name="JWT" value="{{ jwt }}">
</form>
<script>
// Auto-submit on page load
document.getElementById('deepLinkReturnForm').submit();
</script>
</body>
</html>
+94
View File
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LTI Launch Error</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
max-width: 600px;
margin: 50px auto;
padding: 20px;
background-color: #f5f5f5;
}
.error-container {
background: white;
border-radius: 8px;
padding: 30px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #d32f2f;
margin-top: 0;
}
.error-icon {
font-size: 48px;
color: #d32f2f;
margin-bottom: 20px;
}
.error-message {
background: #ffebee;
border-left: 4px solid #d32f2f;
padding: 15px;
margin: 20px 0;
border-radius: 4px;
}
.help-text {
color: #666;
font-size: 14px;
margin-top: 20px;
}
.troubleshooting {
background: #e3f2fd;
border-left: 4px solid #1976d2;
padding: 15px;
margin: 20px 0;
border-radius: 4px;
}
.troubleshooting h3 {
color: #1976d2;
margin-top: 0;
font-size: 16px;
}
.troubleshooting ol {
margin: 10px 0;
padding-left: 20px;
}
.troubleshooting li {
margin: 8px 0;
line-height: 1.5;
}
</style>
</head>
<body>
<div class="error-container">
<div class="error-icon">⚠️</div>
<h1>{{ error }}</h1>
<div class="error-message">
<strong>Error Details:</strong><br>
<pre style="white-space: pre-wrap; word-wrap: break-word; font-family: inherit;">{{ message }}</pre>
</div>
{% if 'cookie' in message|lower or 'session' in message|lower or 'Authentication Failed' in error %}
<div class="troubleshooting">
<h3>🔧 Troubleshooting Steps:</h3>
<ol>
<li><strong>Enable Cookies:</strong> Ensure your browser allows cookies for this site. Check your browser settings under Privacy & Security.</li>
<li><strong>Disable Tracking Protection:</strong> Turn off Enhanced Tracking Protection, Shield, or similar privacy features for this site.</li>
<li><strong>Allow Third-Party Cookies:</strong> Some browsers block cookies from embedded content. Try allowing cookies from all sites temporarily.</li>
<li><strong>Clear Browser Cache:</strong> Clear cookies and cached data for this site, then try launching again from your course.</li>
<li><strong>Try a Different Browser:</strong> Test with Chrome, Firefox, Safari, or Edge to rule out browser-specific issues.</li>
<li><strong>Disable Extensions:</strong> Browser extensions (ad blockers, privacy tools) can interfere with authentication. Try disabling them.</li>
<li><strong>Contact Support:</strong> If the issue persists after trying the above, contact your system administrator with the error details above.</li>
</ol>
</div>
{% endif %}
<div class="help-text">
<p>If this problem persists, please contact your system administrator.</p>
<p>You may close this window and return to your course to try again.</p>
</div>
</div>
</body>
</html>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Media Not Found</title>
</head>
<body style="margin:0;padding:10px;font-family:sans-serif;font-size:14px;">
This media no longer exists
</body>
</html>