From 1acbae281a5564e74318fc93bb93f97f6f47925b Mon Sep 17 00:00:00 2001 From: emmanuel Date: Mon, 23 Oct 2023 18:33:27 +0000 Subject: [PATCH] CLASSROOMIO-T-231: Worked on the analytics of the individual student CLASSROOMIO-T-231:worked on the individual page Merge branch 'main' into CLASSROOMIO-T-231 CLASSROOMIO-T-231:worked on the individual page Co-authored-by: Ifeanyi Nwosu Merge-request: CLASSROOMIO-MR-112 Merged-by: Best Admin --- .../Exercise/Submissions/Individual.svelte | 77 ++++++++++++++----- .../Exercise/Submissions/Summary.svelte | 11 ++- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/lib/components/Course/components/Lesson/Exercise/Submissions/Individual.svelte b/src/lib/components/Course/components/Lesson/Exercise/Submissions/Individual.svelte index 26357912..f9067cdb 100644 --- a/src/lib/components/Course/components/Lesson/Exercise/Submissions/Individual.svelte +++ b/src/lib/components/Course/components/Lesson/Exercise/Submissions/Individual.svelte @@ -1,4 +1,6 @@ {#if isLoading} - Loading data + {:else if $submissions?.length}
{#each $submissions as student, i} @@ -52,28 +85,30 @@ {#if $questionnaire.questions} {#each $questionnaire.questions as q, i}
-

{i + 1}. {q.title}

+

{i + 1}. {q.title}

{#if q.question_type_id !== 3} {#each q.options as option, i}
- -

{option.label}

+ + {option.label}
{/each} - {/if} - {#if q.question_type_id === 3} -
- {#if $submissions[studentSelected].answers.map((ans) => ans.open_answer)} -

- {$submissions[studentSelected].answers.map((ans) => ans.open_answer)} -

- {:else} -

No answer

- {/if} + {:else} +
+ + {getOpenAnswer($submissions[studentSelected], q)} +
{/if}
diff --git a/src/lib/components/Course/components/Lesson/Exercise/Submissions/Summary.svelte b/src/lib/components/Course/components/Lesson/Exercise/Submissions/Summary.svelte index 6b928104..45fee2ce 100644 --- a/src/lib/components/Course/components/Lesson/Exercise/Submissions/Summary.svelte +++ b/src/lib/components/Course/components/Lesson/Exercise/Submissions/Summary.svelte @@ -13,6 +13,7 @@ import { getChartOptions } from './functions'; import { submissions } from './store'; import '@carbon/charts-svelte/styles.css'; + import { Loading } from 'carbon-components-svelte'; export let isLoading = true; @@ -138,7 +139,7 @@ {#if isLoading} - Loading data + {:else if browser}

Question Charts

@@ -150,14 +151,12 @@ {:else if q.type === 2} {:else} -
+
    {#each q.chartData as answer (answer)} {#if answer.group} -
    -
  • {answer.group}
  • +
    +
  • {answer.group}
  • {/if} {/each}