forked from topcoderinc/umbrella_city
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample Data Code City-2
More file actions
179 lines (157 loc) · 6.19 KB
/
Sample Data Code City-2
File metadata and controls
179 lines (157 loc) · 6.19 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
String cityId = 'a0Ai000000dXnZW';
for(Integer i=0; i< 6; i++) {
CB_Quadrant__c quadrant = new CB_Quadrant__c();
quadrant.CB_Quadrant_Name__c = 'Quadrant'+i+' in City1';
quadrant.CB_City__c = cityId;
quadrant.CB_Sequence__c = i;
insert quadrant;
//-----------------
integer j=0;
//for(Integer j=0; j < 4; j++) {
CB_Block__c block = new CB_Block__c();
block.CB_Block_Name__c = 'Block0-'+i+'-'+j;
block.CB_Sequence__c = j;
block.CB_Quadrant__c = quadrant.Id;
block.CB_Cost__c = 4000;
insert block;
CB_Story__c story = new CB_Story__c();
story.CB_Story_Text__c = 'Which statements are true about Master-Detail relationships';
story.CB_Solution_Data_Type__c = 'Radio';
story.CB_Block__c = block.Id;
insert story;
CB_Solution_Option__c option1 = new CB_Solution_Option__c();
option1.CB_Story__c = story.Id;
option1.CB_Sequence__c = 0;
option1.CB_Solution_Text__c = 'Access to parent determines access to children';
option1.CB_Solution_Selection_Description__c = 'Access to parent determines access to children';
option1.CB_Reward__c = 15000;
option1.CB_Score__c = 'Best';
insert option1;
CB_Solution_Option__c option2 = new CB_Solution_Option__c();
option2.CB_Story__c = story.Id;
option2.CB_Sequence__c = 1;
option2.CB_Solution_Text__c = 'Up to 25 allowed per object';
option2.CB_Solution_Selection_Description__c = 'Up to 25 allowed per object';
option2.CB_Reward__c = 0;
option2.CB_Score__c = 'OK';
insert option2;
CB_Solution_Option__c option3 = new CB_Solution_Option__c();
option3.CB_Story__c = story.Id;
option3.CB_Sequence__c = 2;
option3.CB_Solution_Text__c = 'Can be multiple layers deep';
option3.CB_Solution_Selection_Description__c = 'Can be multiple layers deep';
option3.CB_Reward__c = -5000;
option3.CB_Score__c = 'Bad';
insert option3;
//--------
j=1;
block = new CB_Block__c();
block.CB_Block_Name__c = 'Block0-'+i+'-'+j;
block.CB_Sequence__c = j;
block.CB_Quadrant__c = quadrant.Id;
block.CB_Cost__c = 5000;
insert block;
story = new CB_Story__c();
story.CB_Story_Text__c = 'Custom objects on the “detail” side of a master-detail relationship cannot have sharing rules.';
story.CB_Solution_Data_Type__c = 'Radio';
story.CB_Block__c = block.Id;
insert story;
option1 = new CB_Solution_Option__c();
option1.CB_Story__c = story.Id;
option1.CB_Sequence__c = 0;
option1.CB_Solution_Text__c = 'false';
option1.CB_Solution_Selection_Description__c = 'false';
option1.CB_Reward__c = 15000;
option1.CB_Score__c = 'Best';
insert option1;
option2 = new CB_Solution_Option__c();
option2.CB_Story__c = story.Id;
option2.CB_Sequence__c = 1;
option2.CB_Solution_Text__c = 'true';
option2.CB_Solution_Selection_Description__c = 'None';
option2.CB_Reward__c = 0;
option2.CB_Score__c = 'OK';
insert option2;
option3 = new CB_Solution_Option__c();
option3.CB_Story__c = story.Id;
option3.CB_Sequence__c = 2;
option3.CB_Solution_Text__c = 'true';
option3.CB_Solution_Selection_Description__c = 'true';
option3.CB_Reward__c = -6000;
option3.CB_Score__c = 'Bad';
insert option3;
//--------
j=2;
block = new CB_Block__c();
block.CB_Block_Name__c = 'Block0-'+i+'-'+j;
block.CB_Sequence__c = j;
block.CB_Quadrant__c = quadrant.Id;
block.CB_Cost__c = 3500;
insert block;
story = new CB_Story__c();
story.CB_Story_Text__c = 'What elements does a custom object automatically contain when it is created?';
story.CB_Solution_Data_Type__c = 'Radio';
story.CB_Block__c = block.Id;
insert story;
option1 = new CB_Solution_Option__c();
option1.CB_Story__c = story.Id;
option1.CB_Sequence__c = 0;
option1.CB_Solution_Text__c = 'Standard Controller';
option1.CB_Solution_Selection_Description__c = 'Standard Controller';
option1.CB_Reward__c = -7000;
option1.CB_Score__c = 'Bad';
insert option1;
option2 = new CB_Solution_Option__c();
option2.CB_Story__c = story.Id;
option2.CB_Sequence__c = 1;
option2.CB_Solution_Text__c = 'Page Layout';
option2.CB_Solution_Selection_Description__c = 'Page Layout';
option2.CB_Reward__c = 0;
option2.CB_Score__c = 'OK';
insert option2;
option3 = new CB_Solution_Option__c();
option3.CB_Story__c = story.Id;
option3.CB_Sequence__c = 2;
option3.CB_Solution_Text__c = 'Record Types';
option3.CB_Solution_Selection_Description__c = 'Record Types';
option3.CB_Reward__c = 20000;
option3.CB_Score__c = 'Best';
insert option3;
//--------
j=3;
block = new CB_Block__c();
block.CB_Block_Name__c = 'Block0-'+i+'-'+j;
block.CB_Sequence__c = j;
block.CB_Quadrant__c = quadrant.Id;
block.CB_Cost__c = 7000;
insert block;
story = new CB_Story__c();
story.CB_Story_Text__c = 'A custom object contains employee salary and other employee information. The HR Manager may see all information about the employee. However, the HR Administrator should not see the salary. What settings would you use to accomplish this?';
story.CB_Solution_Data_Type__c = 'Radio';
story.CB_Block__c = block.Id;
insert story;
option1 = new CB_Solution_Option__c();
option1.CB_Sequence__c = 0;
option1.CB_Story__c = story.Id;
option1.CB_Solution_Text__c = 'Organization Wide Default';
option1.CB_Solution_Selection_Description__c = 'Organization Wide Default';
option1.CB_Reward__c = -7000;
option1.CB_Score__c = 'Bad';
insert option1;
option2 = new CB_Solution_Option__c();
option3.CB_Story__c = story.Id;
option2.CB_Sequence__c = 1;
option2.CB_Solution_Text__c = 'Sharing Rules';
option2.CB_Solution_Selection_Description__c = 'Sharing Rules';
option2.CB_Reward__c = 0;
option2.CB_Score__c = 'OK';
insert option2;
option3 = new CB_Solution_Option__c();
option3.CB_Story__c = story.Id;
option3.CB_Sequence__c = 2;
option3.CB_Solution_Text__c = 'Field Level Security';
option3.CB_Solution_Selection_Description__c = 'Field Level Security';
option3.CB_Reward__c = 20000;
option3.CB_Score__c = 'Best';
insert option3;
}