mirror of
https://github.com/jcreek/AutomatedAssessmentFeedbackAgent.git
synced 2026-07-13 11:03:48 +00:00
feat(*): Display feedback after upload
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
<script lang="ts">
|
||||
// Results logic will go here
|
||||
import AssessmentFeedback from '$lib/components/AssessmentFeedback.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let feedback: any = null;
|
||||
|
||||
onMount(() => {
|
||||
// For hackathon simplicity, get feedback from history state
|
||||
if (window.history.state && window.history.state.feedback) {
|
||||
feedback = window.history.state.feedback;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<section class="max-w-xl mx-auto py-12">
|
||||
<h1 class="text-2xl font-bold mb-4">Assessment Results</h1>
|
||||
<p class="mb-6">View detailed feedback and recommendations for each student submission.</p>
|
||||
<!-- Results table or cards will go here -->
|
||||
<div class="border rounded p-6 text-gray-500">No results yet. Upload submissions to see feedback here.</div>
|
||||
{#if feedback}
|
||||
<AssessmentFeedback {...feedback} />
|
||||
{:else}
|
||||
<div class="border rounded p-6 text-gray-500">No results yet. Upload submissions to see feedback here.</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
@@ -47,9 +47,12 @@ async function handleSubmit(event: Event) {
|
||||
});
|
||||
const result = await response.json();
|
||||
if (response.ok && result.success) {
|
||||
successMsg = result.feedback;
|
||||
// Redirect to /results with feedback in history state
|
||||
window.history.pushState({ feedback: result }, '', '/results');
|
||||
window.location.assign('/results');
|
||||
file = null;
|
||||
textInput = '';
|
||||
return;
|
||||
} else {
|
||||
errorMsg = result.error || 'An error occurred.';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user