-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.jl
51 lines (42 loc) · 1.02 KB
/
types.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module Types
export Lesson
abstract AbstractQuestion
type Lesson
name::AbstractString
description::AbstractString
version::VersionNumber
authors::Vector{AbstractString}
keywords::Vector{AbstractString}
questions::Vector{AbstractQuestion}
end
immutable InfoQuestion <: AbstractQuestion
text::AbstractString
end
immutable SyntaxQuestion <: AbstractQuestion
text::AbstractString
hints::Vector{AbstractString}
answer::Expr
end
immutable FunctionQuestion <: AbstractQuestion
text::AbstractString
hints::Vector{AbstractString}
# I'd like to use a tuple, but most formats don't support it so I'll
# use an array for now
tests::Vector{Vector{AbstractString}}
template::AbstractString
end
immutable MultiQuestion <: AbstractQuestion
text::AbstractString
hints::Vector{AbstractString}
options::Vector{AbstractString}
answer::Int
end
type Course
name::AbstractString
description::AbstractString
version::VersionNumber
authors::Vector{AbstractString}
keywords::Vector{AbstractString}
lessons::Vector{Lesson}
end
end # module