Exam Edit on ExamList

This commit is contained in:
Carlos-Mesquita
2024-11-27 02:01:50 +00:00
parent ca5977e78b
commit a2a513077f
13 changed files with 199 additions and 53 deletions

View File

@@ -5,7 +5,7 @@ import { ExamPart, ModuleState, SectionState } from "./types"
import { levelPart, listeningSection, readingPart, speakingTask, writingTask } from "@/stores/examEditor/sections"
const defaultSettings = (module: Module) => {
export const defaultSettings = (module: Module) => {
const baseSettings = {
category: '',
introOption: { label: 'None', value: 'None' },
@@ -77,7 +77,7 @@ const defaultSettings = (module: Module) => {
}
}
const sectionLabels = (module: Module) => {
export const sectionLabels = (module: Module, levelParts?: number) => {
switch (module) {
case 'reading':
return Array.from({ length: 3 }, (_, index) => ({
@@ -131,7 +131,6 @@ const defaultSection = (module: Module, sectionId: number) => {
export const defaultSectionSettings = (module: Module, sectionId: number, part?: ExamPart) => {
return {
sectionId: sectionId,
sectionLabel: "",
settings: defaultSettings(module),
state: part !== undefined ? part : defaultSection(module, sectionId),
generating: undefined,