44 lines
936 B
TypeScript
44 lines
936 B
TypeScript
export type VariableTermKind = "constant" | "variable";
|
|
|
|
export interface VariableParenthesisTerm {
|
|
kind: VariableTermKind;
|
|
coefficient: number;
|
|
variable?: "x";
|
|
}
|
|
|
|
export interface DistributedVariableTerm {
|
|
kind: VariableTermKind;
|
|
coefficient: number;
|
|
variable?: "x";
|
|
latex: string;
|
|
}
|
|
|
|
export interface VariableTermChoice {
|
|
id: string;
|
|
coefficient: number;
|
|
variable?: "x";
|
|
latex: string;
|
|
}
|
|
|
|
export interface VariableParenthesisProblem {
|
|
id: string;
|
|
key: string;
|
|
multiplier: number;
|
|
terms: VariableParenthesisTerm[];
|
|
operators: ("+" | "-")[];
|
|
correctTerms: DistributedVariableTerm[];
|
|
choices: VariableTermChoice[][];
|
|
latexBefore: string;
|
|
latexAfter: string;
|
|
}
|
|
|
|
export interface VariableUserAnswer {
|
|
selectedChoiceIds: (string | null)[];
|
|
}
|
|
|
|
export interface VariableGradeResult {
|
|
correct: boolean;
|
|
userAnswer: (DistributedVariableTerm | null)[];
|
|
correctAnswer: DistributedVariableTerm[];
|
|
}
|