Skip to content

Proposal: Enhance Problem Customization by Restructuring Tdoc Schema #1015

@bhscer

Description

@bhscer

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions