Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 51 def self.corrected_corrs(simulation)
- 52 debugger
- 53 #get all items and responses
- 54 items = simulation.items
- 55 res = simulation.examinee_responses
- 56
- 57 #convert string to array of Fixnum and calc the sum for responses
- 58 res.each do |x|
- 59 if x.response.class == String
- 60 x.response = x.response.split(//).map {|s| s.to_f}
- 61 x.response.sum = x.r_sum
- 62 x.save
- 63 elsif
- debugger output:
- (rdb:1) simulation.items
- ArgumentError Exception: wrong number of arguments (1 for 0)
- (rdb:1) Simulation.first.items
- [#<Item id: 13508, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.894, num: "1", simulation_id: 2629, corr: nil>, #<Item id: 13509, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.234, num: "2", simulation_id: 2629, corr: nil>, #<Item id: 13510, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: -0.196, num: "3", simulation_id: 2629, corr: nil>, #<Item id: 13511, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.389, num: "4", simulation_id: 2629, corr: nil>, #<Item id: 13512, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.534, num: "5", simulation_id: 2629, corr: nil>, #<Item id: 13513, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.418, num: "6", simulation_id: 2629, corr: nil>, #<Item id: 13514, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: -0.469, num: "7", simulation_id: 2629, corr: nil>, #<Item id: 13515, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.176, num: "8", simulation_id: 2629, corr: nil>, #<Item id: 13516, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.371, num: "9", simulation_id: 2629, corr: nil>, #<Item id: 13517, name: "testrun_n10_m02.wgi", created_at: "2011-01-12 06:01:50", updated_at: "2011-01-12 06:01:50", a: 0.793, num: "10", simulation_id: 2629, corr: nil>]
- (rdb:1)
Add Comment
Please, Sign In to add comment