Skip to content

Commit 0f06b1b

Browse files
authored
Merge pull request #384 from coderoad/feature/subtask-markdown
update subtask schema
2 parents 12c1fe1 + ed664e3 commit 0f06b1b

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Diff for: src/services/testRunner/index.ts

+1-1
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, {

Diff for: typings/tutorial.d.ts

+1-2
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 {

Diff for: web-app/src/containers/Tutorial/components/Level.tsx

+2-2
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
}))

Diff for: web-app/src/services/state/actions/editor.ts

+1-1
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)