Skip to content

[GSoC 2026] M2.19 - Fix part of #24717: Fix unanswered question flow in certificate assessment player - #5

Open
mosin74 wants to merge 13 commits into
learner-assessment-m2.16from
learner-assessment-m2.19
Open

mosin74 wants to merge 13 commits into
learner-assessment-m2.16from
learner-assessment-m2.19

Conversation

@mosin74

@mosin74 mosin74 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Overview

  1. This PR fixes #[fill_in_number_here].
  2. This PR does the following:
    • core/templates/pages/certificate-assessment-player-page/certificate-assessment-player-page.component.ts
      • Added detection for unanswered questions during assessment submission.
      • Opens the unanswered-question modal when unanswered questions are present.
      • Wired the modal's Submit Anyway and Go Back actions with the appropriate callbacks.
      • Replaced the temporary hardcoded unansweredQuestionCount = 3 mock with actual unanswered-question counting logic.
      • Configured the submission flow so that:
        • Submit Anyway submits the assessment.
        • Go Back returns the player
    • core/templates/pages/exploration-player-page/services/current-interaction.service.ts
      • Made showNoResponseError() and showInvalidResponseError() null-safe using optional chaining.
      • Prevents runtime errors in the certificate assessment player, which does not use a StateCard transcript in the same way as the exploration player.
    • assets/i18n/en.json
      • Updated modal copy and related localization strings.

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

Proof of changes on desktop with slow/throttled network

PR Pointers

…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
@mosin74 mosin74 changed the title Learner assessment m2.19 [GSoC 2026] M2.19 - Fix part of #24717: Fix unanswered question flow in certificate assessment player Aug 20, 2026
mosin74 and others added 9 commits August 20, 2026 22:42
…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>
…piry and wire time-expired modal actions (oppia#27161)

* 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

* Handle certificate assessment time expiry and learner exit navigation

* Fix coverage

* Make assessment timer more realiable and tests cleaner

* Centralize certificate assessment state in a service and address PR review

* Centralize certificate assessment state in a service and address PR review

---------

Co-authored-by: mosin74 <mosin74@gmail.com>
…ia#27045)

* Updates voiceover feature flag from TEST to PROD

* Fixes backend tests
…pt cards (oppia#27083)

* Fix part of oppia#24933: Display translated concept cards

* Translate the skill description on concept cards

* Move the up-to-date translation lookup into translation_services

The same private helper was being added separately in three PRs, so it now
lives once as a public function in the module that owns translations, with
tests covering the missing, stale and non-string cases.

* Address review comments: Prioritize lesson study language for concept card translations and fix comment grammar

* Clean PR diff: remove unrelated service and storage test files
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.

6 participants