Proposal: Enhance Problem Customization by Restructuring Tdoc Schema
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 IDsscore: Fullmark valueballoon: 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
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hydro-dev/Hydro
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
希望给编辑器加个选择,可回到旧版Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
希望比赛赛制增加CCPC新赛制Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
traPtitech/knoQ_R-UI#290 ·
Maintainers usually reply within 24 days
-
account bug course exam iris lecture
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Add: New Star SDOpencheck:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getsentry/sentry-wizard#1396 · 1 comment ·
Maintainers usually reply within 1 day