Skip to content

Learner assessment m2.18 - #4

Open
mosin74 wants to merge 9 commits into
learner-assessment-m2.16from
learner-assessment-m2.18
Open

mosin74 wants to merge 9 commits into
learner-assessment-m2.16from
learner-assessment-m2.18

Conversation

@mosin74

@mosin74 mosin74 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Overview

  1. This PR fixes part of [Feature Request]: Learner certificates oppia/oppia#24717.
  2. This PR does the following:
    • Added a countdown timer on CertificateAssessmentPlayerPageRootComponent that starts when an assessment attempt is loaded and the learner reaches the questions stage. The remaining time is derived from the certificate offering's timeLimitInMinutes.
    • Wired the TimeExpiredModalComponent actions:
      • View results: emits the new viewResults event, which navigates the learner to the certificate assessment result page.
      • Dismiss: emits the new assessmentEnded event, which navigates the learner back to the learner dashboard.
    • On time expiry, the player auto-submits the current answers via submitAssessment() so a partially-completed attempt is still recorded.

Essential Checklist

Please follow the instructions for making a code change.

  • I have linked the issue that this PR fixes in the "Development" section of the sidebar.
  • I have checked the "Files Changed" tab and confirmed that the changes are what I want to make.
  • I have written tests for my code.
  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I can't assign them directly).

Proof that changes are correct

PR Pointers

Aditya22-smart and others added 6 commits August 20, 2026 18:12
…TML templates removing inconsistency of next 20 files (part-10) (oppia#27119)

* Fix part of oppia#25941: Clean up legacy embedded <style> tags from HTML templates (part-10)

* Fixed import and styleUrls in ts file

* Fixed import path

* Fixed failing acceptance tests

* Fixed feedback-updates-page css
…ent start and submission flow (oppia#27121)

* Created stub intent handler and frontend/backend API services with initial GET logic

* Add unit tests for handler and async API service call

* Create initial service, decorator, and handler

* Lint checks

* Add docstrings, improve test coverage, and fix failing lint and backend tests

* Update docstrings, add test coverage, and fix failing tests

* Updated submission flow fixed mypy checks

* Updated test and logic

* Fixed query

* Reverted some changes and fix failing test

* Remove CertificateAssessmentAnswer and validate responses before write

* Add indexed certificate_id field and use bounded query for next attempt index

* Updated docstring

* Address review comments in certificate assessment submission flow

* Fixed lint checks

* Fix submit certificate assessment handler unit tests to mock attempt retrieval service

* Fix lint and mypy errors in certificate assessment code

* Use attempt_id in certificate question access decorator

* [GSoC 2026] M2.16 - Fix part of oppia#24717: Restrict certificate assessment player to logged-in learners and show 404 for unavailable certificates

* Lint check

* Fixed typescript error

* [GSoC 2026] Fix part of oppia#24717: Improve certificate assessment player page and fix bugs

* Fix strict typescript check errors in conversation skin spec

* fix: Harden certificate assessment player page (auth guard, root component, player component)

* Fix lint errors in certificate assessment player page spec

* Address brianrodri review: rename bannerClick, reorder interfaces, JSDoc, constants

* Add CertificateAssessmentQuestionData domain model to avoid snake_case bleed

* Replace manual answer comparison with AnswerClassificationService

Instead of extracting correct answers from rule inputs and comparing
them manually (extractCorrectAnswerText, extractCorrectAnswerIndex,
extractCorrectAnswerOptionIds, isResponseCorrect), delegate correctness
checking to the shared AnswerClassificationService. This reuses the
existing interaction-specific rule functions (Equals, FuzzyEquals, etc.)
and avoids introducing a bifurcated helper that could diverge from the
shared implementation.

- Remove correctAnswerText, correctAnswerIndex, correctAnswerOptionIds
  from AssessmentQuestion; add stateData field instead.
- Inject AnswerClassificationService and 4 rules services
  (MultipleChoiceInput, ItemSelectionInput, TextInput, NumericInput).
- Add convertAnswerForClassification to convert raw string answers to
  the typed format expected by each interaction's rules service.
- Fix test data: default_outcome now has labelled_as_correct: false so
  that incorrect answers are properly classified as incorrect.

* Support all 8 question interactions in certificate assessment player

Add support for FractionInput, NumberWithUnits, DragAndDropSortInput,
and ImageClickInput interactions alongside the existing MultipleChoice,
ItemSelection, TextInput, and NumericInput.

- Import rules services for all 8 interactions.
- Update AssessmentQuestionType union with fraction_input,
  number_with_units, drag_and_drop_sort, and image_click.
- Update getQuestionType, getRulesService, and
  convertAnswerForClassification for each new interaction.
- Add conversation skin templates for drag-and-drop sort (checkboxes)
  and image click (text fallback) interactions.
- Remove dead NumberWithUnits constant that was incorrectly mapped to
  numeric_input.

* Refactor certificate assessment player to use native interaction components

Replace custom question rendering with oppia-interaction-display driven
by ExplorationHtmlFormatterService, and route answers through
CurrentInteractionService with typed InteractionAnswer values. Extend
interaction components with a lastAnswer input to restore previous
selections when navigating between questions.

* Fix certificate assessment review findings and CI failures

* Add lifecycle cleanup and strict typing fixes for certificate assessment

* Remove dead code and redundant comments from certificate assessment player

* Fix type errors in DragAndDropSortInput spec

* Fix coverage

---------

Co-authored-by: mosin74 <mosin74@gmail.com>
# Conflicts:
#	core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page-root.component.html
#	core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page-root.component.spec.ts
#	core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page-root.component.ts
#	core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page.component.spec.ts
#	core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page.component.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants