feat: exercise form and submission list

This commit is contained in:
Jannat Patel
2025-06-20 19:59:10 +05:30
parent 9bb4c45a23
commit 88a2b69980
26 changed files with 938 additions and 51 deletions

View File

@@ -1,5 +1,6 @@
<template>
<header
v-if="!fromLesson"
class="sticky flex items-center justify-between top-0 z-10 border-b bg-surface-white px-3 py-2.5 sm:px-5"
>
<Breadcrumbs :items="breadcrumbs" />
@@ -135,6 +136,7 @@ const boilerplate = ref<string>(
)
const { brand } = sessionStore()
const router = useRouter()
const fromLesson = ref(false)
const props = withDefaults(
defineProps<{
@@ -154,6 +156,9 @@ onMounted(() => {
if (!code.value) {
code.value = boilerplate.value
}
if (new URLSearchParams(window.location.search).get('fromLesson')) {
fromLesson.value = true
}
})
const exercise = createDocumentResource({
@@ -261,8 +266,6 @@ const execute = async (stdin = '') => {
code: code.value,
files: [{ filename: 'stdin', contents: stdin }],
onMessage: (msg: any) => {
console.log(msg)
if (msg.msgtype === 'write' && msg.file === 'stdout') {
outputChunks.push(msg.data)
}