From f2807d3e382f7bb839498bd0ea39f4d16d9a45a2 Mon Sep 17 00:00:00 2001
From: Leo Daniel A <137432765+LeoDanielA01@users.noreply.github.com>
Date: Thu, 19 Mar 2026 17:55:24 +0530
Subject: [PATCH] fix: LiveCodeSession reference error and UI loading state
(#2218)
* fix: LiveCodeSession reference error and UI loading state
* fix: remove trailing slash from livecode_url in LMS Settings and add patch to update existing records
* fix: remove reload function in patch file and update live_code_url default value by administrator
---------
Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
---
.../ProgrammingExerciseSubmission.vue | 11 +++++++++--
lms/lms/doctype/lms_settings/lms_settings.json | 8 ++++----
lms/patches.txt | 3 ++-
lms/patches/v2_0/fix_livecode_url_default.py | 7 +++++++
4 files changed, 22 insertions(+), 7 deletions(-)
create mode 100644 lms/patches/v2_0/fix_livecode_url_default.py
diff --git a/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue b/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue
index 2c6fb81f..03951d1e 100644
--- a/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue
+++ b/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue
@@ -49,11 +49,14 @@
"
variant="solid"
@click="submitCode"
+ :loading="running"
+ :disabled="running"
+ class="text-ink-gray-9"
>
- {{ __('Run') }}
+ {{ running ? __('Running') : __('Run') }}
@@ -172,8 +175,9 @@ const { brand } = sessionStore()
const { settings } = useSettings()
const router = useRouter()
const fromLesson = ref(false)
-const falconURL = ref('https://falcon.frappe.io/')
+const falconURL = ref('https://falcon.frappe.io')
const falconError = ref(null)
+const running = ref(false)
const props = withDefaults(
defineProps<{
@@ -308,8 +312,10 @@ const loadFalcon = () => {
}
const submitCode = async () => {
+ running.value = true
await runCode()
createSubmission()
+ running.value = false
}
const runCode = async () => {
@@ -406,6 +412,7 @@ const execute = (stdin = ''): Promise => {
setTimeout(() => {
if (!hasExited) {
+ running.value = false
error.value = true
errorMessage.value = 'Execution timed out.'
reject('Execution timed out.')
diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json
index fd1136cd..287f712d 100644
--- a/lms/lms/doctype/lms_settings/lms_settings.json
+++ b/lms/lms/doctype/lms_settings/lms_settings.json
@@ -85,7 +85,7 @@
],
"fields": [
{
- "default": "https://falcon.frappe.io/",
+ "default": "https://falcon.frappe.io",
"fieldname": "livecode_url",
"fieldtype": "Data",
"label": "LiveCode URL"
@@ -512,8 +512,8 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
- "modified": "2026-03-18 15:32:56.259783",
- "modified_by": "sayali@frappe.io",
+ "modified": "2026-03-19 11:31:14.951880",
+ "modified_by": "Administrator",
"module": "LMS",
"name": "LMS Settings",
"owner": "Administrator",
@@ -544,4 +544,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
-}
+}
\ No newline at end of file
diff --git a/lms/patches.txt b/lms/patches.txt
index 9f73a032..8056c04f 100644
--- a/lms/patches.txt
+++ b/lms/patches.txt
@@ -122,4 +122,5 @@ lms.patches.v2_0.rename_badge_assignment_event
lms.patches.v2_0.enable_allow_job_posting
lms.patches.v2_0.set_conferencing_provider_for_zoom
lms.patches.v2_0.sync_evaluator_roles
-lms.patches.v2_0.give_event_permission #10-03-2026
\ No newline at end of file
+lms.patches.v2_0.fix_livecode_url_default
+lms.patches.v2_0.give_event_permission #10-03-2026
diff --git a/lms/patches/v2_0/fix_livecode_url_default.py b/lms/patches/v2_0/fix_livecode_url_default.py
new file mode 100644
index 00000000..772f4319
--- /dev/null
+++ b/lms/patches/v2_0/fix_livecode_url_default.py
@@ -0,0 +1,7 @@
+import frappe
+
+
+def execute():
+ livecode_url = frappe.db.get_single_value("LMS Settings", "livecode_url")
+ if livecode_url == "https://falcon.frappe.io/":
+ frappe.db.set_single_value("LMS Settings", "livecode_url", "https://falcon.frappe.io")