8000 update subtask schema · AlexRekt/coderoad-vscode@ed664e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit ed664e3

Browse files
committed
update subtask schema
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent d6742b6 commit ed664e3

File tree

4 files changed

+5
-6
lines changed
  • services/state/actions
  • 4 files changed

    +5
    -6
    lines changed

    src/services/testRunner/index.ts

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -112,7 +112,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => {
    112112
    summary: tap.summary,
    113113
    }
    114114

    115-
    if (step.setup.subtasks) {
    115+
    if (step.subtasks) {
    116116
    const subtaskSummary = parseSubtasks(tap.summary, position.stepId || '')
    117117

    118118
    callbacks.onFail(position, {

    typings/tutorial.d.ts

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,8 +27,8 @@ export type Step = {
    2727
    content: string
    2828
    setup: StepActions
    2929
    solution: Maybe<StepActions>
    30-
    subtasks?: { [index: number]: boolean }
    3130
    hints?: string[]
    31+
    subtasks?: string[]
    3232
    }
    3333

    3434
    /** A tutorial for use in VSCode CodeRoad */
    @@ -52,7 +52,6 @@ export type StepActions = {
    5252
    files?: string[]
    5353
    watchers?: string[]
    5454
    filter?: string
    55-
    subtasks?: string[]
    5655
    }
    5756

    5857
    export interface TestRunnerArgs {

    web-app/src/containers/Tutorial/components/Level.tsx

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -199,8 +199,8 @@ const Level = ({
    199199
    return null
    200200
    }
    201201
    let subtasks = null
    202-
    if (step?.setup?.subtasks) {
    203-
    subtasks = step.setup.subtasks.map((subtask: string, subtaskIndex: number) => ({
    202+
    if (step?.subtasks) {
    203+
    subtasks = step.subtasks.map((subtask: string, subtaskIndex: number) => ({
    204204
    name: subtask,
    205205
    pass: !!(testStatus?.summary ? testStatus.summary[subtaskIndex] : false),
    206206
    }))

    web-app/src/services/state/actions/editor.ts

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -57,7 +57,7 @@ export default (editorSend: any) => ({
    5757
    },
    5858
    })
    5959

    60-
    if (step.setup.subtasks) {
    60+
    if (step.subtasks) {
    6161
    // load subtask summary by running tests and parsing result
    6262
    editorSend({
    6363
    type: 'EDITOR_RUN_TEST',

    0 commit comments

    Comments
     (0)
    0