Proposal: Enhance Problem Customization by Restructuring Tdoc Schema

Open
#1,015 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
mongodb, typescript
Domain
database

Research direction

Start by locating the tdoc schema and its current pids, score, and balloon usages, then trace how problem data is read and written. Define the compatibility and synchronization behavior for the proposed problems array, including deprecation handling, and verify that legacy fields and customized labels, titles, scores, and balloons remain consistent.

Written by the indexing model from the issue text.

Description

Current Limitation

The current tdoc schema stores problem-related data through separate fields:

  • pids: Array of problem IDs
  • score: Fullmark value
  • balloon: Balloon color information

This structure don't support the customization of problem titles and labels (e.g., "A,B,C", "L1-1,L1-2", "A,B1,B2" formats).

Proposed Solution

Introduce a structured problems array field with enhanced flexibility:

export interface Tdoc extends Document {
    // ...
    problems: { 
        pid: number; 
        label: string;       // Custom label (required)
        title?: string;      // Optional custom title
        score?: number;      // Optional score override
        balloon?: string | { color: string, name: string }; // Optional balloon customization
    }[];
    // ...
}
Backward Compatibility
  • Maintain existing fields (pids, score, balloon) during transition
  • Implement synchronization mechanism between legacy fields and new structure
  • Add deprecation warnings for legacy fields
Feedback Request

Would the maintainers consider accepting this change? If so, I'm willing to try to work on this task.

I understand this represents a significant change - would you prefer this approach over maintaining the current schema?

Dominant language
TypeScript
Stars
7.3k
Forks
504
Avg merge
11h 29m
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hydro-dev/Hydro

All issues in hydro-dev/Hydro

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.