Skip to content

Commit 0952460

Browse files
committed
fixed cors and added a get endpoint for experiment questions in flask. Also added a script that stops loading the questions page if the params for pid and expid are not present.
1 parent f1dd3ff commit 0952460

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

game_server/src/main/kotlin/com/imsproject/gameserver/business/auth/SecurityConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class SecurityConfig(
2020
@Throws(Exception::class)
2121
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
2222
http
23+
.cors { it.configurationSource(corsConfigurationSource()) }
2324
.authorizeHttpRequests { authorize ->
2425
authorize
2526
.requestMatchers(

manager/src/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ def get_all_sessions_route():
478478
return jsonify({"status": "error",
479479
"message": "Internal server error"}), 500
480480

481+
@app.route('/experiment_questions', methods=['GET'])
482+
def get_experiment_questions_route():
483+
return render_template('experiment_questions.html')
484+
481485

482486
if __name__ == '__main__':
483487
# run on port 80

manager/Untitled-1.html renamed to manager/src/templates/experiment_questions.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<!DOCTYPE html>
22
<html lang="he" dir="rtl">
3+
<script>
4+
const params = new URLSearchParams(window.location.search);
5+
const expId = params.get('expid');
6+
const pid = params.get('pid');
7+
if (!expId || !pid) {
8+
alert('שגיאה: חסר מזהה ניסוי או מזהה משתתף.');
9+
window.stop();
10+
}
11+
</script>
312
<head>
413
<meta charset="UTF-8">
514
<title>שאלון חוויית שיתוף פעולה</title>
@@ -261,7 +270,7 @@
261270
function getQueryParams() {
262271
const params = new URLSearchParams(window.location.search);
263272
return {
264-
expId: parseInt(params.get('expId')),
273+
expId: parseInt(params.get('expid')),
265274
pid: parseInt(params.get('pid'))
266275
};
267276
}

0 commit comments

Comments
 (0)