-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmultiplechoice.go
87 lines (54 loc) · 1.62 KB
/
multiplechoice.go
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package questions
import (
"github.com/spf13/cobra"
)
func NewMultipleChoiceCommand(params NewQuestionCommandParams) *cobra.Command {
params.name = "Multiple Choice"
params.abbr = "mc"
params.maxTemplate = multipleChoiceTemplate
params.minTemplate = multipleChoiceTemplateMin
params.long = multipleChoiceLongDescription
return createQuestionCommand(params)
}
const multipleChoiceLongDescription = `Multiple Choice challenges allow a student to submit a single answer to a
multiple-choice question.`
const multipleChoiceTemplate = `<!-- >>>>>>>>>>>>>>>>>>>>>> BEGIN CHALLENGE >>>>>>>>>>>>>>>>>>>>>> -->
<!-- Replace everything in square brackets [] and remove brackets -->
### !challenge
* type: multiple-choice
* id: %s
* title: [text, a short question title]
<!-- * points: [1] (optional, the number of points for scoring as a checkpoint) -->
<!-- * topics: [python, pandas] (Checkpoints only. optional the topics for analyzing points) -->
##### !question
[markdown, your question]
##### !end-question
##### !options
a| [Option 1]
b| [Option 2]
c| [Option 3, etc]
##### !end-options
##### !answer
b|
##### !end-answer
<optional-attributes>
### !end-challenge
<!-- ======================= END CHALLENGE ======================= -->`
const multipleChoiceTemplateMin = `<!-- >>>>>>>>>>>>>>>>>>>>>> BEGIN CHALLENGE >>>>>>>>>>>>>>>>>>>>>> -->
### !challenge
* type: multiple-choice
* id: %s
* title:
##### !question
##### !end-question
##### !options
a|
b|
c|
##### !end-options
##### !answer
a|
##### !end-answer
<optional-attributes>
### !end-challenge
<!-- ======================= END CHALLENGE ======================= -->`