Skip to content

Commit

Permalink
Add explanations of question fields
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Jun 27, 2022
1 parent 9122566 commit cf30c9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/lib/questions/multiple-choice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import { MarkdownView } from "../components/markdown";
import { Markdown, QuestionFields, QuestionMethods } from "./types";

export interface MultipleChoicePrompt {
/** The text of the prompt. */
prompt: Markdown;

/** An array of text explaining each choice. */
choices: Markdown[];
}

export interface MultipleChoiceAnswer {
/** The index of the correct answer in the choices array (0-based). */
answer: number;
}

Expand Down
2 changes: 2 additions & 0 deletions js/lib/questions/short-answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { MarkdownView } from "../components/markdown";
import { Markdown, QuestionFields, QuestionMethods } from "./types";

export interface ShortAnswerPrompt {
/** The text of the prompt. */
prompt: Markdown;
}

export interface ShortAnswerAnswer {
/** The exact string that answers the question. */
answer: string;
}

Expand Down
6 changes: 6 additions & 0 deletions js/lib/questions/tracing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import { Snippet } from "../components/snippet";
import { QuestionFields, QuestionMethods } from "./types";

export interface TracingPrompt {
/** The contents of the program to trace */
program: string;
}

export interface TracingAnswer {
/** True if the program should pass the compiler */
doesCompile: boolean;

/** If doesCompile=true, then the contents of stdout after running the program */
stdout?: string;

/** If doesCompile=false, then the line number of the code causing the error */
lineNumber?: number;
}

Expand Down

0 comments on commit cf30c9b

Please sign in to comment.