Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Investigate shared homework scoring consolidation without behavior changes

オープン
#439 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
46/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, testing

調査の方向性

Start from commit f143a19b7d5ef7b713c7b8139d01619f333961b6 and inspect courses/homework_answer_checks.py, courses/homework_score_calculation.py, and courses/views/homework_answers.py, then build the required repository-wide caller inventory. Run the focused answer-check, resolution, crypto, scoring, and rendered-answer tests before and after; done means the duplicate is gone, all callers use community_base.coursework.answer_checks, behavior is unchanged, and the specified CI verification passes.

索引モデルが issue の本文から書いたものです。

説明

courses enhancement P1

Retire duplicate homework answer checks using the pinned shared package

Status: groomed, ready
Tags: courses, enhancement, P1
Depends on: None. #438 is complete in merged commit f143a19b7d5ef7b713c7b8139d01619f333961b6; use that revision or a descendant as the implementation base.
Blocks: —

Reporter context

The owner wants DTC, AISL, and community-base course code simplified without changing any feature or visible UX. The retirement inventory named DTC homework checking and scoring as a candidate, but a candidate is not approval to replace scoring orchestration or to bypass the larger cohort adoption in #55.

Normative references

  • _docs/specs/04-courses-and-cohorts.md, especially the preserved homework/question/answer/scoring contract and its characterization requirement.
  • _docs/specs/07-security-privacy-operations.md for bounded answer failures and redaction.
  • _docs/architecture/app-boundaries.md and AGENTS.md for one domain owner and no legacy runtime shim.
  • _docs/ci/change-selective-ci.md and _docs/specs/10-verification-strategy.md for versioned verification.
  • community-base v0.5.10, community_base.coursework.answer_checks, the public owner already in DTC's pin.
  • docs/plan/evidence/code-retirement-inventory-2026-09-29.md, ranked bundle 8.

Scope

With #438 merged at f143a19b7d5ef7b713c7b8139d01619f333961b6 as the implementation base, remove the duplicate courses/homework_answer_checks.py module and retarget its production and test imports directly to community_base.coursework.answer_checks. Production importers are courses/homework_score_calculation.py (is_answer_correct) and courses/views/homework_answers.py (is_free_form_answer_correct); verify the complete caller set on the implementation revision, including all Python import forms, aliases, tests, patch targets, and dynamic strings. Do not leave a compatibility facade or copy the checks into another site file.

The v0.5.10 shared module has the same answer and question type values and checking rules as the site duplicate. Its Question and Answer annotations do not enforce model identity at runtime; its checks use the existing DTC question/answer attributes and methods. DTC already installs community_base.coursework. Characterize this interoperability on actual DTC model instances before deleting the duplicate. Preserve the exact HomeworkAnswerCryptoError identity established by #438 and the current Question.get_correct_answer() resolution and configuration path.

Keep courses/homework_score_calculation.py as DTC's scoring owner. Its FAQ and learning-in-public components, persistence, observability, invalidation and transaction behavior are outside this slice. Retargeting its answer-check import does not adopt package scoring.py. Report actual net application lines deleted separately from changed test imports; the 145-line site check module is a gross candidate, not a promised net reduction.

Behavior to preserve

  • ANY answer handling, free-form trimming, case-insensitive exact and contains checks, integer parsing, and the existing 0.01 default float tolerance.
  • Multiple-choice and checkbox answer indexing, comma splitting, blank answers, malformed numeric input behavior, and unknown answer/question type behavior.
  • The precise crypto failure boundary: is_answer_correct converts HomeworkAnswerCryptoError to False, while other exceptions keep their existing behavior. Never reveal source answers, key material or ciphertext in errors or logs.
  • Existing configured keyring lookup, source answer resolution, stored envelopes, scores, answer correctness fields, rendered feedback, routes and permissions.

Non-goals and dependency boundary

  • No package pin bump, package change, model/schema migration, stored-data rewrite, template/view behavior change, API addition, or new UI.
  • No replacement of courses/homework_score_calculation.py or homework batch scoring with package scoring. #55 remains the dependency-blocked domain adoption owner for that larger transition; this issue does not satisfy or bypass its prerequisites #51, #52, #53 and #244.
  • #438 is complete at f143a19b7d5ef7b713c7b8139d01619f333961b6; base the isolated implementation worktree on that commit or a descendant. Do not edit or reuse #438's frozen verification worktree. Its shared crypto exception identity is part of this contract.
  • Keep the shared DTC main and other agents' work untouched. Use an isolated issue worktree; no merge, push or PR during review.

Acceptance criteria

  • A pre-deletion and final-revision caller inventory covers direct, parent-package and dotted imports, aliases and attributes, tests, scripts, patch targets and dynamic references; no use of the deleted site module remains.
  • courses/homework_answer_checks.py is deleted and every caller uses the v0.5.10 public package owner directly, with no facade or second implementation; actual net application lines deleted are reported separately from test changes.
  • Shared checks operate on DTC Question and Answer instances with the same AnswerTypes and QuestionTypes values, answer resolution/configuration, and exact shared crypto exception identity established by #438.
  • Existing tests characterize and preserve correct/incorrect ANY, exact, contains, float, integer, multiple-choice, checkbox, blank, malformed and unknown-type outcomes, including score values and safe crypto failure. Add a focused behavior test before deletion only for a material uncovered boundary.
  • DTC FAQ and learning-in-public score components, persistence, observability, invalidation, scoring errors, timestamps and grading UX remain unchanged; no package scoring orchestration is adopted.
  • No package pin, model, migration, template, route, API, permission, stored answer or visible page change occurs.
  • Focused answer-check, answer-resolution, crypto, homework-scoring and rendered-answer tests pass before and after. uv run --frozen python scripts/ci.py lint and the versioned _docs/ci/change-selective-ci.md verification plan, run, evidence-check and report-check pass; execute the graph-selected scripts/ci.py quality contract (including verification-quality when required by the plan) with exact base/head, graph and plan digests and every component disposition recorded by Engineer and independent Tester. Use the graph-selected backend browser tier; any fallback follows the plan.
  • Independent Tester verifies the uncommitted isolated diff, including a repository-wide import check and screenshot evidence classified as not_applicable only if the graph confirms no render impact. PM accepts afterward. No commit, merge, push or PR occurs before the approved handoff.

Browser regression scenario

Learner submits and reviews graded homework

Given an enrolled learner has an existing homework containing free-form and choice questions, including a source-managed encrypted correct answer,
when the learner submits answers and later views the scored homework,
then answer correctness, question/FAQ/learning-in-public components, total score, feedback and safe answer visibility match the current site. The backend ownership change introduces no new page or browser behavior.

Repository and operations scenarios

  • An answer whose stored encrypted source value cannot be resolved produces the same safe false correctness result through the shared crypto exception class.
  • A malformed numeric choice retains the existing failure boundary; the refactor does not silently turn it into an incorrect-answer result.

Blocked by: None. #438 was merged at f143a19b7d5ef7b713c7b8139d01619f333961b6.

主要言語
Python
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataTalksClub/website のほかの issue

DataTalksClub/website の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。