Skip to content

[GSoC 2026] M2.21 - Fix part of #24717: Show assessment unavailable modal when an attempt cannot start - #7

Open
mosin74 wants to merge 17 commits into
learner-assessment-m2.16from
learner-assessment-m2.21
Open

mosin74 wants to merge 17 commits into
learner-assessment-m2.16from
learner-assessment-m2.21

Conversation

@mosin74

@mosin74 mosin74 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Overview

  1. This PR fixes or fixes part of #[fill_in_number_here].
  2. This PR does the following:
    • Added AssessmentUnavailableModalComponent (assessment-unavailable-modal.component.ts/.html/.css
    • Updated certificate-assessment-player-page-root.component.ts:
      • startAssessment() now sets showAssessmentUnavailableModal = true when assessment startup validation fails.
      • Added onGoToAvailableCertificates() to navigate learners to CERTIFICATE_OFFERING_AVAILABLE_ROUTE using the classroom URL fragment.
    • Updated certificate-assessment-player-page-root.component.html to render the modal and bind the (goToAvailableCertificates) event.
    • Registered and exported AssessmentUnavailableModalComponent in certificate-offering-shared.module.ts.
    • Added new localization strings in assets/i18n/en.json and qqq.json for the assessment unavailable modal.

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

Screencast.from.2026-08-21.00-37-13.webm

PR Pointers

tarsoliyaansh and others added 3 commits August 20, 2026 16:46
…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
Add an overlay modal for unavailable assessments and show it when
starting an attempt fails, with navigation to available certificates.
@mosin74 mosin74 changed the title Show assessment unavailable modal when attempt cannot start [GSoC 2026] M2.21 - Fix part of #24717: Show assessment unavailable modal when an attempt cannot start Aug 20, 2026
mosin74 and others added 14 commits August 21, 2026 02:49
…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.

5 participants