Skip to content

Commit 47359c9

Browse files
Merge branch 'add-test-pages' into feat/countly-event-tracking
2 parents 40e5920 + c8cdf13 commit 47359c9

File tree

6 files changed

+107
-1
lines changed

6 files changed

+107
-1
lines changed

src/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import MutableFileSystem08 from './tutorials/Mutable-File-System/08.vue'
4343
import MutableFileSystem09 from './tutorials/Mutable-File-System/09.vue'
4444
import MutableFileSystem10 from './tutorials/Mutable-File-System/10.vue'
4545
import MutableFileSystem11 from './tutorials/Mutable-File-System/11.vue'
46+
import Tests01 from './tutorials/Tests/01.vue'
47+
import Tests02 from './tutorials/Tests/02.vue'
4648

4749
Vue
4850
.use(VueRouter)
@@ -94,6 +96,11 @@ const routes = [
9496
{ path: '/mutable-file-system/10', component: MutableFileSystem10 },
9597
{ path: '/mutable-file-system/11', component: MutableFileSystem11 },
9698
{ path: '/mutable-file-system/resources', component: ResourcesLesson, props: { tutorialId: 'mutableFileSystem' } },
99+
// Tests
100+
{ path: '/tests', component: Landing, props: { tutorialId: 'tests' } },
101+
{ path: '/tests/01', component: Tests01 },
102+
{ path: '/tests/02', component: Tests02 },
103+
{ path: '/tests/resources', component: ResourcesLesson, props: { tutorialId: 'tests' } },
97104
// 404
98105
{ path: '*', name: '404' }
99106
]

src/static/tutorials.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,22 @@
139139
"description": "You've seen the IPFS Files API. Now explore the IPFS DAG API, where you'll use CIDs to create verifiable links between datasets."
140140
}
141141
]
142-
}
142+
},
143+
"tests": {
144+
"project": "IPFS",
145+
"title": "Testing new lesson formats!",
146+
"description": "We'll need to delete this before we merge!",
147+
"lessons": [
148+
{ "to": "/tests/01", "name": "Sample multiple choice lesson" },
149+
{ "to": "/tests/02", "name": "This is another lesson" }
150+
],
151+
"resources": [
152+
{
153+
"title": "JS-IPFS Files API",
154+
"link": "https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md",
155+
"type": "docs",
156+
"description": "Notice that these docs contain two sections, one for top-level methods relevant to files and one for the Mutable File System (MFS) you learned about in this tutorial."
157+
}
158+
]
159+
}
143160
}

src/tutorials/Tests/01.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a lesson about Douglas Adams' book "The Hitchhikers Guide to the Galaxy." Let's imagine we've taught you plenty about it, and you now know everything you need to about towels, Somebody Else's Problem, and the ins and outs of space travel.

src/tutorials/Tests/01.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<MultipleChoiceLesson
3+
:text="text"
4+
:question="question"
5+
:choices="choices"
6+
lessonTitle="The meaning of life, the universe, and everything" />
7+
</template>
8+
9+
<script>
10+
import MultipleChoiceLesson from '../../components/MultipleChoiceLesson'
11+
import text from './01.md'
12+
// question must be a string
13+
const question = "What's the meaning of life, the universe, and everything?"
14+
// choices must be an array of objects, each with the properties: `answer` (string), `correct` (boolean), and `feedback` (string)
15+
const choices = [
16+
{
17+
answer: 'Doing good',
18+
correct: false,
19+
feedback: 'Sorry, we were `looking` for a _numerical_ *value*. Think Douglas Adams.'
20+
},
21+
{
22+
answer: '42',
23+
correct: true,
24+
feedback: 'Great job!'
25+
},
26+
{
27+
answer: '24',
28+
correct: false,
29+
feedback: 'Oops. Looks like you reversed those digits. Try again!'
30+
}
31+
]
32+
export default {
33+
components: {
34+
MultipleChoiceLesson
35+
},
36+
data: () => {
37+
return { text, question, choices }
38+
}
39+
}
40+
</script>

src/tutorials/Tests/02.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a lesson about The Hitchhiker's Guide to the Galaxy by Douglas Adams. It's a fabulour book and answers many meaningful questions. Once you've completed this extensive reading you should be able to answer a simple question.

src/tutorials/Tests/02.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<MultipleChoiceLesson
3+
:text="text"
4+
:question="question"
5+
:choices="choices"
6+
lessonTitle="Sample Multiple Choice Lesson" />
7+
</template>
8+
9+
<script>
10+
import MultipleChoiceLesson from '../../components/MultipleChoiceLesson'
11+
import text from './01.md'
12+
// question must be a string
13+
const question = 'just a random question'
14+
// choices must be an array of objects, each with the properties: `answer` (string), `correct` (boolean), and `feedback` (string)
15+
const choices = [
16+
{
17+
answer: '9191',
18+
correct: true,
19+
feedback: 'Great job!'
20+
},
21+
{
22+
answer: 'dogin bad',
23+
correct: false,
24+
feedback: 'Sorry, we were `looking` for a _numerical_ *value*. Think Douglas Adams.'
25+
},
26+
{
27+
answer: 'fasdfasdf',
28+
correct: false,
29+
feedback: 'Oops. Looks like you reversed those digits. Try again!'
30+
}
31+
]
32+
export default {
33+
components: {
34+
MultipleChoiceLesson
35+
},
36+
data: () => {
37+
return { text, question, choices }
38+
}
39+
}
40+
</script>

0 commit comments

Comments
 (0)