-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTemplate_Multiple_Choice.html
113 lines (105 loc) · 4.35 KB
/
Template_Multiple_Choice.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="Neff, Our Changing Planet" name="description">
<!-- bootstrap_plus.css contains styling for the dropdown menu and other common core styles -->
<link href="css/bootstrap_plus.css" rel="stylesheet" media="screen">
<!-- widgets.css contains styling for the interactive brix -->
<link href="css/widgets.css" rel="stylesheet">
</head>
<body>
<div id="target1"></div>
<script src="js/d3.v3.min.js"></script>
<script src="js/brixlib-compiled.js"></script>
<script>
/*
* This is a Multiple Choice Question bric template.
*
* Edit the "question" string, the "choices" array and the "answerKey.answers" object
* below, leave everything else as it is.
*
* The choices "answerKey" value matches the "answerKey.answers" property name.
* So every choice must have a matching entry in the "answerKey.answers".
*
* A "score" of 0 means incorrect, a "score" of 1 means correct.
*
* A helpful hint:
* if you change the number of choices, remember that both the choices
* and the answers must be separated by commas, but that the last one
* should not have a trailing comma.
*/
var bric1Config =
{
"bricId": "bric1",
"bricType": "MultipleChoiceQuestion",
"config":
{
"id": "Q1",
"questionId": "6391be68-3c8f-4f37-98fb-e6059d2d53c2",
"order": "randomized",
"maxAttempts": 3,
"presenterType": "RadioGroup",
"presenterConfig": { "numberFormat": "latin-upper" },
"question": "Which of the following statements about resource demands is incorrect?",
"choices":
[
{
"content": "We will need 300% more food by 2050",
"answerKey": "answer1"
},
{
"content": "We will need 70% more food by 2050",
"answerKey": "answer2"
},
{
"content": "We will need 80% more water by 2050",
"answerKey": "answer3"
},
{
"content": "We will need 200% more energy by 2050",
"answerKey": "answer4"
}
]
},
"answerKey":
{
"assessmentType": "multiplechoice",
"answers":
{
"answer1":
{
"score": 1,
"response": "We need enough more food to support the increase in population but it isn't going to quadruple by 2050."
},
"answer2":
{
"score": 0,
"response": ""
},
"answer3":
{
"score": 0,
"response": ""
},
"answer4":
{
"score": 0,
"response": "The energy used per person is increasing at the same time the population is increasing so we're going to need three times as much energy."
}
}
}
};
var eventManager = new pearson.utils.EventManager();
var answerMan = new pearson.brix.utils.LocalAnswerMan();
var submitManager = new pearson.brix.utils.SubmitManager(eventManager, answerMan);
var bricLayer = new pearson.brix.BricLayer(null, eventManager, submitManager);
var bricWorks = bricLayer.getBricWorks();
var bric1 = bricWorks.createBric(bric1Config.bricType, bric1Config.config);
bric1.draw(d3.select('#target1'));
answerMan.registerAnswerKey(bric1Config.config.questionId, bric1Config.answerKey);
submitManager.handleRequestsFrom(bric1);
</script>
</body>
</html>