+
diff --git a/src/lib/adminAccess.ts b/src/lib/adminAccess.ts
index 638b148..5ca320b 100644
--- a/src/lib/adminAccess.ts
+++ b/src/lib/adminAccess.ts
@@ -29,7 +29,7 @@ export function isContentManagerRole(role?: string): boolean {
}
export function canSendTeamInvitations(role?: string): boolean {
- return normalizedTeamRole(role) === "SUPER_ADMIN"
+ return FULL_PANEL_TEAM_ROLES.has(normalizedTeamRole(role))
}
export function isPathAllowedForTeamRole(pathname: string, role?: string): boolean {
diff --git a/src/lib/practiceEditDirty.ts b/src/lib/practiceEditDirty.ts
index 01bd83e..86cf99c 100644
--- a/src/lib/practiceEditDirty.ts
+++ b/src/lib/practiceEditDirty.ts
@@ -20,8 +20,10 @@ function normalizeQuestionRow(question: PracticeFormState["questions"][number])
stimulusBlockKey: question.stimulusBlockKey ?? null,
questionTypeDefinitionId: question.questionTypeDefinitionId ?? null,
text: String(question.text ?? "").trim(),
- difficultyLevel: question.difficultyLevel,
- points: Number(question.points),
+ difficultyLevel: question.difficultyLevel ?? "EASY",
+ points: Number.isFinite(Number(question.points)) && Number(question.points) > 0
+ ? Number(question.points)
+ : 1,
dynamicFieldValues: question.dynamicFieldValues ?? {},
mcqOptions: (question.mcqOptions ?? []).map((option) => ({
text: String(option.text ?? "").trim(),
diff --git a/src/lib/practiceFullMapper.ts b/src/lib/practiceFullMapper.ts
index 0deacb4..e0937c7 100644
--- a/src/lib/practiceFullMapper.ts
+++ b/src/lib/practiceFullMapper.ts
@@ -56,8 +56,8 @@ export interface PracticeFormQuestionRow {
stimulusBlockKey: string | null
questionTypeDefinitionId: number | null
text: string
- difficultyLevel: "EASY" | "MEDIUM" | "HARD"
- points: number
+ difficultyLevel?: "EASY" | "MEDIUM" | "HARD"
+ points?: number
dynamicFieldValues: Record
sourceDynamicPayload?: DynamicQuestionPayload | null
mcqOptions: { text: string; isCorrect: boolean }[]
@@ -641,8 +641,6 @@ export function mapPracticeFullToFormState(
stimulusBlockKey: null,
questionTypeDefinitionId: typeDefinitions[0]?.id ?? null,
text: "",
- difficultyLevel: "EASY" as const,
- points: 1,
dynamicFieldValues: typeDefinitions[0]
? emptyDynamicFieldValuesForDefinition(typeDefinitions[0])
: {},
diff --git a/src/pages/content-management/AddPracticeFlow.tsx b/src/pages/content-management/AddPracticeFlow.tsx
index 6da1c29..b518d31 100644
--- a/src/pages/content-management/AddPracticeFlow.tsx
+++ b/src/pages/content-management/AddPracticeFlow.tsx
@@ -243,8 +243,6 @@ export function AddPracticeFlow() {
stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null,
text: "",
- difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
- points: 1,
dynamicFieldValues: {} as Record,
mcqOptions: [
{ text: "", isCorrect: true },
@@ -576,8 +574,6 @@ export function AddPracticeFlow() {
questionTypeDefinitionId:
typeDefinitions[0]?.id ?? (null as number | null),
text: "",
- difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
- points: 1,
dynamicFieldValues: typeDefinitions[0]
? emptyDynamicFieldValuesForDefinition(typeDefinitions[0])
: {},
@@ -750,26 +746,26 @@ export function AddPracticeFlow() {
};
return (
-
-
-
+
+
+
-
-
-
+
+
+
{isFromQuestionType ? "Create Practice from Question Type" : "Add New Practice"}
-
+
{isFromQuestionType
? `Build a practice using ${seededQuestionType?.display_name ?? "the selected question type"}. Locations are optional — attach courses, modules, or lessons later.`
: "Create a practice with story details, a persona, and questions from your question type library."}
@@ -813,12 +809,12 @@ export function AddPracticeFlow() {
) : null}
-
+
{renderStep()}
diff --git a/src/pages/content-management/AddVideoFlow.tsx b/src/pages/content-management/AddVideoFlow.tsx
index d6a97ff..2c5284e 100644
--- a/src/pages/content-management/AddVideoFlow.tsx
+++ b/src/pages/content-management/AddVideoFlow.tsx
@@ -186,31 +186,31 @@ export function AddVideoFlow() {
}
return (
-
-
-
+
+
+
-
+
Add new lesson
-
+
s.label)}
currentStep={currentStep}
/>
-
+
{currentStep === 1 && (
-
+
+
{/* Navigation Breadcrumb */}
-
+
Back to Videos
@@ -159,34 +159,34 @@ export function AttachPracticeFlow() {
{/* Stepper Area */}
-
+
{/* Page Title & Header Actions */}
-
-
-
{title}
-
+
+
+
{title}
+
{description}
-
+
-
{/* Form Content */}
-
{renderStep()}
+
{renderStep()}
);
diff --git a/src/pages/content-management/AttachProgramPracticeFlow.tsx b/src/pages/content-management/AttachProgramPracticeFlow.tsx
index da3d6cd..d0bc98f 100644
--- a/src/pages/content-management/AttachProgramPracticeFlow.tsx
+++ b/src/pages/content-management/AttachProgramPracticeFlow.tsx
@@ -105,13 +105,13 @@ export function AttachProgramPracticeFlow() {
: "Verify practice details before publishing it.";
return (
-
-
+
+
{/* Navigation Breadcrumb */}
-
+
Back to Program
@@ -119,20 +119,20 @@ export function AttachProgramPracticeFlow() {
{/* Stepper Area */}
-
+
{/* Page Title & Header Actions */}
-
-
-
{title}
-
{description}
+
+
+
{title}
+
{description}
-
+
navigate(backPath)}
>
Cancel
diff --git a/src/pages/content-management/ContentManagementLayout.tsx b/src/pages/content-management/ContentManagementLayout.tsx
index 2ad6753..33707f7 100644
--- a/src/pages/content-management/ContentManagementLayout.tsx
+++ b/src/pages/content-management/ContentManagementLayout.tsx
@@ -3,11 +3,11 @@ import { Outlet } from "react-router-dom";
export function ContentManagementLayout() {
return (
-
-
-
-
-
+
+
+
+
+
Content Management
diff --git a/src/pages/content-management/CreateQuestionTypeFlow.tsx b/src/pages/content-management/CreateQuestionTypeFlow.tsx
index 9650139..2ebbff9 100644
--- a/src/pages/content-management/CreateQuestionTypeFlow.tsx
+++ b/src/pages/content-management/CreateQuestionTypeFlow.tsx
@@ -346,7 +346,7 @@ export function CreateQuestionTypeFlow() {
-
+
-
-
-
+
+
+
{isEdit ? "Edit question type definition" : "Create question type definition"}
-
+
{isEdit
? `Update reusable question type definition #${editDefinitionId}.`
: "Build a reusable question type template for dynamic practice and assessment questions."}
-
+
navigate("/new-content/question-types")}
>
Cancel
void handleHeaderSaveDraft()}
disabled={saving || (isEdit && !hasUnsavedChanges)}
>
diff --git a/src/pages/content-management/EditPracticeFlow.tsx b/src/pages/content-management/EditPracticeFlow.tsx
index b601e98..1762526 100644
--- a/src/pages/content-management/EditPracticeFlow.tsx
+++ b/src/pages/content-management/EditPracticeFlow.tsx
@@ -280,8 +280,6 @@ export function EditPracticeFlow() {
stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null,
text: "",
- difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
- points: 1,
dynamicFieldValues: {} as Record,
mcqOptions: [
{ text: "", isCorrect: true },
@@ -740,18 +738,26 @@ export function EditPracticeFlow() {
};
return (
-
-
-
+
+
+
-
-
-
Edit Practice
-
+
+
+
Edit Practice
+
goBack()}
+ >
+ Cancel
+
+
@@ -764,27 +770,19 @@ export function EditPracticeFlow() {
"Save changes"
)}
- goBack()}
- >
- Cancel
-
-
+
Update story details, persona, and questions for practice #{practiceId}.
-
+
{renderStep()}
diff --git a/src/pages/content-management/LinkExistingPracticeFlow.tsx b/src/pages/content-management/LinkExistingPracticeFlow.tsx
index 88a7dee..d59c8fe 100644
--- a/src/pages/content-management/LinkExistingPracticeFlow.tsx
+++ b/src/pages/content-management/LinkExistingPracticeFlow.tsx
@@ -252,24 +252,24 @@ export function LinkExistingPracticeFlow() {
}
return (
-
-
-
+
+
+
-
-
-
Attach Existing Practice
+
+
+
Attach Existing Practice
Cancel
-
+
Browse your practice library and link an existing practice to this content location.
@@ -287,11 +287,11 @@ export function LinkExistingPracticeFlow() {
-
+
-
+
{currentStep === 1 ? (
{/* 4. Action Footer */}
-
+
Back
-
+
Save as Draft
@@ -205,10 +205,10 @@ export function AttachPracticeReviewStep({
onClick={onPublish}
disabled={!isConfirmed}
className={cn(
- "h-12 px-10 rounded-[6px] font-bold text-white shadow-xl flex items-center gap-3 transition-all active:scale-95",
+ "flex h-12 w-full items-center justify-center gap-3 rounded-[6px] px-10 font-bold text-white shadow-xl transition-all active:scale-95 sm:w-auto",
isConfirmed
- ? "bg-[#9E2891] hover:bg-[#8A237E] shadow-[#9E2891]/20"
- : "bg-grayScale-200 cursor-not-allowed opacity-50",
+ ? "bg-[#9E2891] shadow-[#9E2891]/20 hover:bg-[#8A237E]"
+ : "cursor-not-allowed bg-grayScale-200 opacity-50",
)}
>
diff --git a/src/pages/content-management/components/practice-steps/AttachPracticeStep1.tsx b/src/pages/content-management/components/practice-steps/AttachPracticeStep1.tsx
index 2f13df7..3125e05 100644
--- a/src/pages/content-management/components/practice-steps/AttachPracticeStep1.tsx
+++ b/src/pages/content-management/components/practice-steps/AttachPracticeStep1.tsx
@@ -148,7 +148,7 @@ export function AttachPracticeStep1({
-
+
Next: Review
diff --git a/src/pages/content-management/components/practice-steps/ContextStep.tsx b/src/pages/content-management/components/practice-steps/ContextStep.tsx
index b8da8f2..10222fa 100644
--- a/src/pages/content-management/components/practice-steps/ContextStep.tsx
+++ b/src/pages/content-management/components/practice-steps/ContextStep.tsx
@@ -348,7 +348,7 @@ export function ContextStep({
-
+
Next: Persona
diff --git a/src/pages/content-management/components/practice-steps/PersonaStep.tsx b/src/pages/content-management/components/practice-steps/PersonaStep.tsx
index f570866..d96e3da 100644
--- a/src/pages/content-management/components/practice-steps/PersonaStep.tsx
+++ b/src/pages/content-management/components/practice-steps/PersonaStep.tsx
@@ -115,12 +115,12 @@ export function PersonaStep({
)}
-
+
Back
@@ -128,7 +128,7 @@ export function PersonaStep({
type="button"
onClick={nextStep}
disabled={!selectedPersona || loading || personas.length === 0}
- className="h-10 rounded-[6px] bg-brand-500 px-8 shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50"
+ className="h-10 w-full rounded-[6px] bg-brand-500 px-8 shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50 sm:w-auto"
>
Next: Questions
diff --git a/src/pages/content-management/components/practice-steps/ProgramAttachReviewStep.tsx b/src/pages/content-management/components/practice-steps/ProgramAttachReviewStep.tsx
index cd0422c..a6bc776 100644
--- a/src/pages/content-management/components/practice-steps/ProgramAttachReviewStep.tsx
+++ b/src/pages/content-management/components/practice-steps/ProgramAttachReviewStep.tsx
@@ -75,17 +75,17 @@ export function ProgramAttachReviewStep({
{/* Footer Actions */}
-
+
Cancel
Next: Review & Publish
diff --git a/src/pages/content-management/components/practice-steps/ProgramAttachStep1.tsx b/src/pages/content-management/components/practice-steps/ProgramAttachStep1.tsx
index c7c6715..7cc5057 100644
--- a/src/pages/content-management/components/practice-steps/ProgramAttachStep1.tsx
+++ b/src/pages/content-management/components/practice-steps/ProgramAttachStep1.tsx
@@ -121,7 +121,7 @@ export function ProgramAttachStep1({
-
+
Next: Review
diff --git a/src/pages/content-management/components/practice-steps/QuestionsStep.tsx b/src/pages/content-management/components/practice-steps/QuestionsStep.tsx
index 69d5b8c..eecbe9b 100644
--- a/src/pages/content-management/components/practice-steps/QuestionsStep.tsx
+++ b/src/pages/content-management/components/practice-steps/QuestionsStep.tsx
@@ -77,8 +77,6 @@ function questionSummaryPreview(
text?: string;
dynamicFieldValues?: Record;
questionTypeDefinitionId?: number | null;
- difficultyLevel?: string;
- points?: number;
},
def: QuestionTypeDefinition | undefined,
): string {
@@ -186,8 +184,6 @@ function createEmptyQuestionRow(id: string, displayOrder = 1, inheritAnchor?: {
stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null,
text: "",
- difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
- points: 1,
dynamicFieldValues: {} as Record,
mcqOptions: defaultMcqOptions(),
trueFalseCorrect: true,
@@ -781,9 +777,6 @@ export function QuestionsStep({
Bank #{q.serverQuestionId}
) : null}
-
- {q.difficultyLevel ?? "EASY"}
-
{sectionBadgeLabel(q, formData.questions)}
@@ -792,9 +785,6 @@ export function QuestionsStep({
{q.stimulusBlockKey}
) : null}
-
- {q.points ?? 1} pt{(q.points ?? 1) === 1 ? "" : "s"}
-
{typeLabel}
@@ -896,55 +886,6 @@ export function QuestionsStep({
) : null}
-
-
-
-
-
-
-
- {
- const newQuestions = [...formData.questions];
- const parsed = Number.parseInt(e.target.value, 10);
- newQuestions[i] = {
- ...newQuestions[i],
- points:
- Number.isFinite(parsed) && parsed > 0 ? parsed : 1,
- };
- setFormData({ ...formData, questions: newQuestions });
- }}
- className="h-11 rounded-lg border-grayScale-200"
- />
-
-
-