Skip to content

Pre/post test assessment viewer within course context #14134

@rtibbles

Description

@rtibbles

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Create the pre/post test assessment viewer within the course context. When a learner is taking an active pre/post test, the main content area renders the quiz questions and the side panel is taken over by a flat question list. Navigation within the course is constrained to only the test — the learner cannot navigate to other course content until the test is submitted. This shares infrastructure with #14107 (QuizRenderer integration) but accepts logic duplication for now.

Complexity: High

Context

The ResourceLayout component from #14064 provides the side panel + main content architecture. The progress tracking enhancement in #14133 returns the mastery_criterion with type: PRE_POST_TEST, version (A or B), and test_type (pre or post), along with attempt history. The frontend uses the version to determine which quiz content to render. The resume/redirect logic in #14073 directs learners to active tests. The side panel navigation from #14072 displays the test items but hands off to this component's question list view when a test is actively being taken.

The Change

Frontend: Enhance initContentSession to accept unit_id and pre/post indicator alongside the existing course_session_id. On response, the mastery_criterion includes version: "A" or "B", which the frontend uses to select the corresponding item IDs (version_a_item_ids or version_b_item_ids) from the Unit ContentNode's completion_criteria. The quiz is then rendered with that subset of assessment items from the single file attached to the content node, similar to other quiz flows in Kolibri.

Side panel takeover: When the test is active, the side panel switches from the course navigation to a flat question list showing the test title, question count, current position, and completion indicators for each question. Questions are navigable via the side panel or via prev/next buttons in the bottom bar.

Navigation constraint: While in the test, the learner cannot navigate to other course content via the side panel. The side panel only shows the question list.

Submission: Submit is available on the last question, with a confirmation modal. After submission, the test becomes non-selectable in the side panel (handled by #14072). No preview toggle appears on pre/post test assessments.

Acceptance Criteria

General

  • initContentSession accepts unit_id and pre/post indicator alongside course_session_id
  • Frontend uses the version field from the returned mastery_criterion to select version_a_item_ids or version_b_item_ids from the Unit ContentNode's completion_criteria
  • Quiz renders with only the selected subset of assessment items from the content node's file
  • Uses ResourceLayout to take over the side panel with the assessment question list

Side panel

  • Side panel switches from course navigation to a flat question list when test is active
  • Question list shows test title, question count, current position, and completion indicators
  • Questions are navigable via the side panel
  • No other course navigation items are accessible while in the test

Navigation and submission

  • Questions are navigable via PrevNextBar from ResourceLayout
  • Submit is available on the last question
  • Submission shows a confirmation modal (same as or duplicated from existing quiz submission)
  • After submission, test becomes non-selectable in the side panel (handled by Course side panel navigation component #14072)
  • No preview toggle appears on pre/post test assessments

Testing

  • Tests verify initContentSession correctly passes unit_id and pre/post indicator
  • Tests verify correct item subset is selected based on A/B version
  • Tests verify navigation is constrained to the test while active

🤖 This issue was written with AI assistance, under supervision, review and final edits by [@rtibbles] 🤖

Metadata

Metadata

Assignees

Labels

APP: LearnRe: Learn App (content, quizzes, lessons, etc.)DEV: frontendP0 - criticalPriority: Release blocker or regressionTAG: new featureNew user-facing feature

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions