common_core_parser 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ 'Standard:DUPLICATEDREF_ID:F053D3437D1E4338A2C18B25DACBED85':
2
+ code: CCSS.ELA-Literacy.L.3.1
3
+
4
+ 3B25AF48C22D4668A6085998F847B56E:
5
+ code: CCSS.Math.Content.2.NBT.A.1
6
+
7
+ 91516855132E48E19AA8EC19D5EF6739:
8
+ code: CCSS.Math.Content.5.NBT.B.5
9
+
10
+ 867A71BD1E35497A847049DD8A3EFE29:
11
+ code: CCSS.Math.Content.5.NBT.B.6
12
+
13
+ 7E8ADBEC52174A8EB1E0407D65FDAEAB:
14
+ code: CCSS.Math.Content.5.NBT.B.7
15
+
16
+ 9E5B5BE5D4E144e28A396066AF456486:
17
+ statement: >
18
+ By the end of grade 9, read and comprehend literature, including stories,
19
+ dramas, and poems, in the grades 9–10 text complexity band proficiently, with
20
+ scaffolding as needed at the high end of the range.
21
+ By the end of grade 10, read and comprehend literature, including stories,
22
+ dramas, and poems, at the high end of the grades 9–10 text complexity band
23
+ independently and proficiently.
24
+
25
+ 5E76C90156944cd6A1DF0887BEA27672:
26
+ statement: >
27
+ By the end of grade 11, read and comprehend literature, including stories,
28
+ dramas, and poems, in the grades 11–CCR text complexity band proficiently, with
29
+ scaffolding as needed at the high end of the range.
30
+ By the end of grade 12, read and comprehend literature, including stories,
31
+ dramas, and poems, at the high end of the grades 11–CCR text complexity band
32
+ independently and proficiently.
33
+
34
+
35
+ E8C42265F5F341ea9C0284AA7BDC65AF:
36
+ statement: >
37
+ Use the properties of exponents to interpret expressions for exponential functions.
38
+ For example, identify percent rate of change in functions such as
39
+ y = (1.02)<sup>t</sup>, y = (0.97)<sup>t</sup>, y = (1.01)<sup>12t</sup>, y = (1.2)<sup>t/10</sup>,
40
+ and classify them as representing exponential growth or decay.
@@ -3,6 +3,7 @@ module CommonCoreParser
3
3
 
4
4
  class << self
5
5
  def run
6
+ load_corrections_from_yaml
6
7
  Master.instance.elements.each do |element|
7
8
  self.private_methods.select { |method_name| method_name.to_s.match(/^correct_/) }.each do |corrector_method|
8
9
  self.send(corrector_method,element)
@@ -10,6 +11,15 @@ module CommonCoreParser
10
11
  end
11
12
  end
12
13
 
14
+ def load_corrections_from_yaml
15
+ corrections_hash.keys.each do |refid|
16
+ element = Master.instance.elements_hash[refid]
17
+ corrections_hash[refid].keys.each do |attribute|
18
+ element.instance_variable_set("@#{attribute}",corrections_hash[refid][attribute])
19
+ end
20
+ end
21
+ end
22
+
13
23
  # There are a some cases where multiple items are sharing the same ref_id.
14
24
  # * Two cases of an ELA Standard and Domain having the same ref_id.
15
25
  # * Three cases of pairs of clusters sharing the same ref_id.
@@ -144,12 +154,12 @@ module CommonCoreParser
144
154
  end
145
155
  end
146
156
 
147
-
148
-
149
-
150
-
151
157
  ######################################################################################
152
158
 
159
+ def corrections_hash
160
+ @corrections_hash ||= YAML.load_file(File.expand_path('../../../data/corrections.yml', __FILE__))
161
+ end
162
+
153
163
  def strip_stray_close_tags(element,tag)
154
164
  if starts_with_close?(element,tag)
155
165
  element.instance_variable_set(:@statement,element.statement.sub(/^<\/#{tag}>/,''))
@@ -7,7 +7,7 @@ module CommonCoreParser
7
7
 
8
8
  def initialize
9
9
  ELEMENT_NAMES.each do |element_name|
10
- instance_variable_set("@#{element_name}_hash",{})
10
+ instance_variable_set("@#{element_name}_hash",HashWithIndifferentAccess.new)
11
11
  end
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module CommonCoreParser
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -197,6 +197,33 @@ module CommonCoreParser
197
197
  assert_equal(0,failing_elements.size, failing_elements.map{|element| element.ref_id })
198
198
  end
199
199
 
200
+ test 'should correct codes with missing data at the end' do
201
+ @master.load_ela
202
+ assert_equal('CCSS.ELA-Literacy.L.3.1',@master.elements_hash["Standard:DUPLICATEDREF_ID:F053D3437D1E4338A2C18B25DACBED85"].code)
203
+ @master.load_math
204
+ assert_equal('CCSS.Math.Content.2.NBT.A.1',@master.elements_hash["3B25AF48C22D4668A6085998F847B56E"].code)
205
+ assert_equal('CCSS.Math.Content.5.NBT.B.5',@master.elements_hash["91516855132E48E19AA8EC19D5EF6739"].code)
206
+ assert_equal('CCSS.Math.Content.5.NBT.B.6',@master.elements_hash["867A71BD1E35497A847049DD8A3EFE29"].code)
207
+ assert_equal('CCSS.Math.Content.5.NBT.B.7',@master.elements_hash["7E8ADBEC52174A8EB1E0407D65FDAEAB"].code)
208
+ end
209
+
210
+ test 'should fill in missing statement data on literacy standards' do
211
+ @master.load_ela
212
+ assert_match(/end of grade 9.+end of grade 10/,@master.elements_hash["9E5B5BE5D4E144e28A396066AF456486"].statement)
213
+ assert_match(/end of grade 11.+end of grade 12/,@master.elements_hash["5E76C90156944cd6A1DF0887BEA27672"].statement)
214
+ end
215
+
216
+ test 'should add supserscript tags to sample formula that is missing them' do
217
+ @master.load_math
218
+ assert_match(/<sup>/,@master.elements_hash["E8C42265F5F341ea9C0284AA7BDC65AF"].statement)
219
+ end
220
+
221
+ test 'should reset escaped html tags in statments' do
222
+ @master.load_math
223
+ assert_match(/<i>/,@master.elements_hash["70C12332BEED45098AA0A0BBCD977376"].statement)
224
+ assert_match(/<\/i>/,@master.elements_hash["70C12332BEED45098AA0A0BBCD977376"].statement)
225
+ end
226
+
200
227
  #######
201
228
  private
202
229
  #######
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_core_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-14 00:00:00.000000000 Z
14
+ date: 2013-01-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri
@@ -427,6 +427,7 @@ files:
427
427
  - data/Mathematics/Kindergarten/Domain/Math_K_NBT.xml
428
428
  - data/Mathematics/Kindergarten/Domain/Math_K_OA.xml
429
429
  - data/Mathematics/Kindergarten/Mathematics_Kindergarten.xml
430
+ - data/corrections.yml
430
431
  - doc/CCSSI_ELA Standards.pdf
431
432
  - doc/CCSSI_Math Standards.pdf
432
433
  - lib/common_core_parser.rb