chore: simplify grading for self paced course (#326)
* updated the grading flow for self paced course * updated some logic and translations * fix bug with newsfeed not opening for students and fix more bugs * remove console * add blog template route * add doc page --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
import Grade from '$lib/components/Question/Grade.svelte';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import ReasonBox from '../ReasonBox.svelte';
|
||||
import { course } from '$lib/components/Course/store';
|
||||
import { COURSE_TYPE } from '$lib/utils/types';
|
||||
|
||||
export let title = '';
|
||||
export let index = 1;
|
||||
@@ -17,6 +19,7 @@
|
||||
export let onPrevious = () => {};
|
||||
export let defaultValue = [];
|
||||
export let disablePreviousButton = false;
|
||||
export let isLast = false;
|
||||
export let disabled = false;
|
||||
export let isPreview = false;
|
||||
export let nextButtonProps = {};
|
||||
@@ -134,7 +137,9 @@
|
||||
<PrimaryButton
|
||||
variant={nextButtonProps.isActive ? VARIANTS.CONTAINED : VARIANTS.OUTLINED}
|
||||
type="submit"
|
||||
label={nextButtonProps.label}
|
||||
label={isLast
|
||||
? $t('course.navItem.lessons.exercises.all_exercises.finish')
|
||||
: $t('course.navItem.lessons.exercises.all_exercises.next')}
|
||||
isDisabled={nextButtonProps.isDisabled}
|
||||
{name}
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
import Grade from '$lib/components/Question/Grade.svelte';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import ReasonBox from '../ReasonBox.svelte';
|
||||
import { COURSE_TYPE } from '$lib/utils/types';
|
||||
import { course } from '$lib/components/Course/store';
|
||||
|
||||
export let title = '';
|
||||
export let index = 1;
|
||||
@@ -20,6 +22,7 @@
|
||||
export let disabled = false;
|
||||
export let isPreview = false;
|
||||
export let nextButtonProps = {};
|
||||
export let isLast = false;
|
||||
export let grade: number;
|
||||
export let gradeMax = 0;
|
||||
export let disableGrading = false;
|
||||
@@ -135,7 +138,9 @@
|
||||
<PrimaryButton
|
||||
variant={nextButtonProps.isActive ? VARIANTS.CONTAINED : VARIANTS.OUTLINED}
|
||||
type="submit"
|
||||
label={nextButtonProps.label}
|
||||
label={isLast
|
||||
? $t('course.navItem.lessons.exercises.all_exercises.finish')
|
||||
: $t('course.navItem.lessons.exercises.all_exercises.next')}
|
||||
isDisabled={nextButtonProps.isDisabled}
|
||||
{name}
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
import Grade from '$lib/components/Question/Grade.svelte';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import ReasonBox from '../ReasonBox.svelte';
|
||||
import { course } from '$lib/components/Course/store';
|
||||
import { COURSE_TYPE } from '$lib/utils/types';
|
||||
|
||||
export let title = '';
|
||||
export let index = 1;
|
||||
@@ -76,7 +78,9 @@
|
||||
<div class="ml-4">
|
||||
{#if disabled}
|
||||
<div class="bg-gray-200 dark:bg-gray-500 py-3 px-5 rounded-md mb-3">
|
||||
{defaultValue}
|
||||
{defaultValue === ''
|
||||
? $t('course.navItem.lessons.exercises.all_exercises.no_answer')
|
||||
: defaultValue}
|
||||
</div>
|
||||
{#if gradeWithAI}
|
||||
<ReasonBox {reason} {isLoading} {acceptGrade} {rejectGrade} />
|
||||
@@ -95,7 +99,7 @@
|
||||
<PrimaryButton
|
||||
variant={VARIANTS.OUTLINED}
|
||||
onClick={handlePrevious}
|
||||
label="Previous"
|
||||
label={$t('course.navItem.lessons.exercises.all_exercises.previous')}
|
||||
isDisabled={disablePreviousButton}
|
||||
/>
|
||||
<PrimaryButton
|
||||
|
||||
Reference in New Issue
Block a user