yorkcmarker 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "yorkcmarker" # i.e. visualruby. This name will show up in the gem list.
3
+ s.version = "2.3.4" # i.e. (major,non-backwards compatable).(backwards compatable).(bugfix)
4
+ s.add_dependency "vrlib", ">= 0.0.1"
5
+ s.add_dependency "gtk2", ">= 0.0.1"
6
+ s.add_dependency "require_all", ">= 0.0.1"
7
+ s.add_dependency "prawn"
8
+ s.add_dependency "json"
9
+ s.has_rdoc = false
10
+ s.authors = ["Mat Alan Gilbert"]
11
+ s.email = "matalangilbert@gmail.com" # optional
12
+ s.summary = "A marking assistant for the University of York Introduction to C course." # optional
13
+ s.homepage = "https://github.com/matalangilbert/york-c-marking-assistant" # optional
14
+ s.description = "A marking assistant for the York University Introduction to C course. No official association with the University of York." # optional
15
+ s.executables = ['yorkcmarker'] # i.e. 'vr' (optional, blank if library project)
16
+ s.default_executable = ['yorkcmarker'] # i.e. 'vr' (optional, blank if library project)
17
+ s.bindir = ['.'] # optional, default = bin
18
+ s.require_paths = ['.'] # optional, default = lib
19
+ s.files = `git ls-files`.split("\n")
20
+ s.rubyforge_project = "nowarning" # supress warning message
21
+ end
@@ -0,0 +1,314 @@
1
+ require 'spec_helper'
2
+
3
+ describe ReportMarkerGUI do
4
+ before(:each) do
5
+ @gui = ReportMarkerGUI.new
6
+ end
7
+
8
+ describe '#requirements_marks' do
9
+ before(:each) do
10
+ @gui.load_from_layout
11
+ end
12
+ context 'when no marks awarded' do
13
+ it 'totals 0' do
14
+ @gui.requirements_marks.inject(:+).should eq 0
15
+ end
16
+ end
17
+ context 'when mark 1 awarded' do
18
+ before(:each) do
19
+ @gui.builder["checkbutton_r1"].active = true
20
+ end
21
+ it "totals 1" do
22
+ @gui.requirements_marks.inject(:+).should eq 1
23
+ end
24
+ it "returns a 0 at all positions except 0" do
25
+ @gui.requirements_marks.each_with_index do |mark, index|
26
+ mark.should eq 0 unless index == 0
27
+ end
28
+ end
29
+ context 'when mark 2 awarded' do
30
+ before(:each) do
31
+ @gui.builder["checkbutton_r2"].active = true
32
+ end
33
+ it "totals 2" do
34
+ @gui.requirements_marks.inject(:+).should eq 2
35
+ end
36
+ context 'when mark 1 awarded' do
37
+ before(:each) do
38
+ @gui.builder["checkbutton_r1"].active = true
39
+ end
40
+ it "totals 2" do
41
+ @gui.requirements_marks.inject(:+).should eq 2
42
+ end
43
+ end
44
+ end
45
+ end
46
+ context 'when mark 2 awarded' do
47
+ before(:each) do
48
+ @gui.builder["checkbutton_r2"].active = true
49
+ end
50
+ it "totals 1" do
51
+ @gui.requirements_marks.inject(:+).should eq 1
52
+ end
53
+ end
54
+ end
55
+
56
+ describe '#analysis_marks' do
57
+ before(:each) do
58
+ @gui.load_from_layout
59
+ end
60
+ it 'consists of 7 marks' do
61
+ @gui.analysis_marks.length.should eq 7
62
+ end
63
+ context 'when only mark 1 awarded' do
64
+ before(:each) do
65
+ @gui.builder["checkbutton_a1"].active = true
66
+ end
67
+ it 'totals 1' do
68
+ @gui.analysis_marks.inject(:+).should eq 1
69
+ end
70
+ it "returns a 0 at all positions except 0" do
71
+ @gui.analysis_marks.each_with_index do |mark, index|
72
+ mark.should eq 0 unless index == 0
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ describe '#specification_marks' do
79
+ before(:each) do
80
+ @gui.load_from_layout
81
+ end
82
+ it 'consists of 3 marks' do
83
+ @gui.specification_marks.length.should eq 3
84
+ end
85
+ context 'when only mark 1 awarded' do
86
+ before(:each) do
87
+ @gui.builder["checkbutton_s1"].active = true
88
+ end
89
+ it "totals 1" do
90
+ @gui.specification_marks.inject(:+).should eq 1
91
+ end
92
+ it "returns a 1 at position 0" do
93
+ @gui.specification_marks[0].should eq 1
94
+ end
95
+ it "returns a 0 at position 1" do
96
+ @gui.specification_marks[1].should eq 0
97
+ end
98
+ it "returns a 0 at position 2" do
99
+ @gui.specification_marks[2].should eq 0
100
+ end
101
+ end
102
+ end
103
+
104
+ describe '#design_marks' do
105
+ before(:each) do
106
+ @gui.load_from_layout
107
+ end
108
+ it 'consists of 11 marks' do
109
+ @gui.design_marks.length.should eq 11
110
+ end
111
+ context 'when only mark 1 awarded' do
112
+ before(:each) do
113
+ @gui.builder["checkbutton_d1"].active = true
114
+ end
115
+ it "totals 1" do
116
+ @gui.design_marks.inject(:+).should eq 1
117
+ end
118
+ it "returns a 1 at position 0" do
119
+ @gui.design_marks[0].should eq 1
120
+ end
121
+ it "returns a 0 at position 1" do
122
+ @gui.design_marks[1].should eq 0
123
+ end
124
+ it "returns a 0 at position 2" do
125
+ @gui.design_marks[2].should eq 0
126
+ end
127
+ it "returns a 0 at all positions except 0" do
128
+ @gui.design_marks.each_with_index do |mark, index|
129
+ mark.should eq 0 unless index == 0
130
+ end
131
+ end
132
+ end
133
+ end
134
+
135
+ describe '#implementation_marks' do
136
+ before(:each) do
137
+ @gui.load_from_layout
138
+ end
139
+ it 'consists of 3 marks' do
140
+ @gui.implementation_marks.length.should eq 3
141
+ end
142
+ context 'when only mark 1 awarded' do
143
+ before(:each) do
144
+ @gui.builder["checkbutton_i1"].active = true
145
+ end
146
+ it "totals 1" do
147
+ @gui.implementation_marks.inject(:+).should eq 1
148
+ end
149
+ it "returns a 1 at position 0" do
150
+ @gui.implementation_marks[0].should eq 1
151
+ end
152
+ it "returns a 0 at position 1" do
153
+ @gui.implementation_marks[1].should eq 0
154
+ end
155
+ it "returns a 0 at position 2" do
156
+ @gui.implementation_marks[2].should eq 0
157
+ end
158
+ end
159
+ context 'when only mark 2 awarded' do
160
+ before(:each) do
161
+ @gui.builder["checkbutton_i2"].active = true
162
+ end
163
+ it "totals 1" do
164
+ @gui.implementation_marks.inject(:+).should eq 1
165
+ end
166
+ it "returns a 0 at position 0" do
167
+ @gui.implementation_marks[0].should eq 0
168
+ end
169
+ it "returns a 1 at position 1" do
170
+ @gui.implementation_marks[1].should eq 1
171
+ end
172
+ it "returns a 0 at position 2" do
173
+ @gui.implementation_marks[2].should eq 0
174
+ end
175
+ end
176
+ context 'when only mark 3 awarded' do
177
+ before(:each) do
178
+ @gui.builder["checkbutton_i3"].active = true
179
+ end
180
+ it "totals 1" do
181
+ @gui.implementation_marks.inject(:+).should eq 1
182
+ end
183
+ it "returns a 0 at position 0" do
184
+ @gui.implementation_marks[0].should eq 0
185
+ end
186
+ it "returns a 0 at position 1" do
187
+ @gui.implementation_marks[1].should eq 0
188
+ end
189
+ it "returns a 1 at position 2" do
190
+ @gui.implementation_marks[2].should eq 1
191
+ end
192
+ end
193
+ context 'when all marks awarded' do
194
+ it 'totals 3' do
195
+ @gui.builder["checkbutton_i1"].active = true
196
+ @gui.builder["checkbutton_i2"].active = true
197
+ @gui.builder["checkbutton_i3"].active = true
198
+ @gui.implementation_marks.inject(:+).should eq 3
199
+ end
200
+ end
201
+ end
202
+
203
+ describe '#code_listing_marks' do
204
+ before(:each) do
205
+ @gui.load_from_layout
206
+ end
207
+ it 'consists of 11 marks' do
208
+ @gui.code_listing_marks.length.should eq 11
209
+ end
210
+ context 'when only mark 1 awarded' do
211
+ before(:each) do
212
+ @gui.builder["checkbutton_cl1"].active = true
213
+ end
214
+ it "totals 1" do
215
+ @gui.code_listing_marks.inject(:+).should eq 1
216
+ end
217
+ it "returns a 1 at position 0" do
218
+ @gui.code_listing_marks[0].should eq 1
219
+ end
220
+ it "returns a 0 at all positions except 0" do
221
+ @gui.code_listing_marks.each_with_index do |mark, index|
222
+ mark.should eq 0 unless index == 0
223
+ end
224
+ end
225
+ end
226
+ context 'when only one mark 2 awarded' do
227
+ before(:each) do
228
+ @gui.builder["checkbutton_cl2"].active = true
229
+ end
230
+ it "totals 1" do
231
+ @gui.code_listing_marks.inject(:+).should eq 1
232
+ end
233
+ it "returns a 1 at position 1" do
234
+ @gui.code_listing_marks[1].should eq 1
235
+ end
236
+ it "returns a 0 at all positions except 1" do
237
+ @gui.code_listing_marks.each_with_index do |mark, index|
238
+ mark.should eq 0 unless index == 1
239
+ end
240
+ end
241
+ end
242
+ context 'when two marks for 2 awarded' do
243
+ it 'totals 2 when marks 2-1 and 2-2' do
244
+ @gui.builder["checkbutton_cl2"].active = true
245
+ @gui.builder["checkbutton_cl2_2"].active = true
246
+ @gui.code_listing_marks.inject(:+).should eq 2
247
+ end
248
+ it 'totals 2 when marks 2-1 and 2-3' do
249
+ @gui.builder["checkbutton_cl2"].active = true
250
+ @gui.builder["checkbutton_cl2_3"].active = true
251
+ @gui.code_listing_marks.inject(:+).should eq 2
252
+ end
253
+ it 'totals 2 when marks 2-2 and 2-3' do
254
+ @gui.builder["checkbutton_cl2_2"].active = true
255
+ @gui.builder["checkbutton_cl2_3"].active = true
256
+ @gui.code_listing_marks.inject(:+).should eq 2
257
+ end
258
+ end
259
+ context 'when all marks awarded' do
260
+ it 'totals 21' do
261
+ @gui.builder["checkbutton_cl1"].active = true
262
+ @gui.builder["checkbutton_cl2"].active = true
263
+ @gui.builder["checkbutton_cl2_2"].active = true
264
+ @gui.builder["checkbutton_cl2_3"].active = true
265
+ @gui.builder["checkbutton_cl3"].active = true
266
+ @gui.builder["checkbutton_cl3_2"].active = true
267
+ @gui.builder["checkbutton_cl4"].active = true
268
+ @gui.builder["checkbutton_cl4_2"].active = true
269
+ @gui.builder["checkbutton_cl5"].active = true
270
+ @gui.builder["checkbutton_cl6"].active = true
271
+ @gui.builder["checkbutton_cl7"].active = true
272
+ @gui.builder["checkbutton_cl8"].active = true
273
+ @gui.builder["checkbutton_cl8_2"].active = true
274
+ @gui.builder["checkbutton_cl8_3"].active = true
275
+ @gui.builder["checkbutton_cl9"].active = true
276
+ @gui.builder["checkbutton_cl9_2"].active = true
277
+ @gui.builder["checkbutton_cl9_3"].active = true
278
+ @gui.builder["checkbutton_cl9_3"].active = true
279
+ @gui.builder["checkbutton_cl10"].active = true
280
+ @gui.builder["checkbutton_cl10_2"].active = true
281
+ @gui.builder["checkbutton_cl11"].active = true
282
+ @gui.builder["checkbutton_cl11_2"].active = true
283
+
284
+ @gui.code_listing_marks.inject(:+).should eq 21
285
+ end
286
+ end
287
+ end
288
+
289
+ describe '#testing_and_verification_marks' do
290
+ before(:each) do
291
+ @gui.load_from_layout
292
+ end
293
+ it 'consists of 5 marks' do
294
+ @gui.testing_and_verification_marks.length.should eq 5
295
+ end
296
+ context 'when only mark 1 awarded' do
297
+ before(:each) do
298
+ @gui.builder["checkbutton_tv1"].active = true
299
+ end
300
+ it 'totals 1' do
301
+ @gui.testing_and_verification_marks.inject(:+).should eq 1
302
+ end
303
+ it 'returns a 1 at position 0' do
304
+ @gui.testing_and_verification_marks[0].should eq 1
305
+ end
306
+ it "returns a 0 at all positions except 0" do
307
+ @gui.testing_and_verification_marks.each_with_index do |mark, index|
308
+ mark.should eq 0 unless index == 0
309
+ end
310
+ end
311
+ end
312
+
313
+ end
314
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'vrlib'
3
+ require './bin/ReportMarker'
4
+ require './bin/ReportMarkerGUI'
5
+
6
+
7
+ #Dir[File.dirname(__FILE__) + '/bin/*.rb'].each {|file| require file }
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'vrlib'
4
+
5
+ #make program output in real time so errors visible in VR.
6
+ STDOUT.sync = true
7
+ STDERR.sync = true
8
+
9
+ #everything in these directories will be included
10
+ my_path = File.expand_path(File.dirname(__FILE__))
11
+ require_all Dir.glob(my_path + "/bin/**/*.rb")
12
+
13
+ x = ReportMarkerGUI.new
14
+ x.show
15
+
16
+
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yorkcmarker
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mat Alan Gilbert
9
+ autorequire:
10
+ bindir:
11
+ - .
12
+ cert_chain: []
13
+ date: 2012-05-31 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: vrlib
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.0.1
31
+ - !ruby/object:Gem::Dependency
32
+ name: gtk2
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: 0.0.1
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: require_all
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.1
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.0.1
63
+ - !ruby/object:Gem::Dependency
64
+ name: prawn
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ - !ruby/object:Gem::Dependency
80
+ name: json
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ type: :runtime
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ description: A marking assistant for the York University Introduction to C course.
96
+ No official association with the University of York.
97
+ email: matalangilbert@gmail.com
98
+ executables:
99
+ - yorkcmarker
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - .gitignore
104
+ - .rspec
105
+ - LICENCE
106
+ - README.markdown
107
+ - assets/assignment-mark-form.pdf
108
+ - assets/summary-mark-form.pdf
109
+ - bin/DataFiles.rb
110
+ - bin/Generator.rb
111
+ - bin/ReportMarker.rb
112
+ - bin/ReportMarkerGUI.rb
113
+ - bin/glade/ReportMarkerGUI.glade
114
+ - cmarking2.gemspec
115
+ - spec/ReportMarkerGUI_spec.rb
116
+ - spec/spec_helper.rb
117
+ - yorkcmarker
118
+ - ./yorkcmarker
119
+ homepage: https://github.com/matalangilbert/york-c-marking-assistant
120
+ licenses: []
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - .
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ! '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project: nowarning
139
+ rubygems_version: 1.8.24
140
+ signing_key:
141
+ specification_version: 3
142
+ summary: A marking assistant for the University of York Introduction to C course.
143
+ test_files: []