Guest User

Untitled

a guest
Jul 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. 51 def self.corrected_corrs(simulation)
  2. 52 debugger
  3. 53 #get all items and responses
  4. 54 items = simulation.items
  5. 55 res = simulation.examinee_responses
  6. 56
  7. 57 #convert string to array of Fixnum and calc the sum for responses
  8. 58 res.each do |x|
  9. 59 if x.response.class == String
  10. 60 x.response = x.response.split(//).map {|s| s.to_f}
  11. 61 x.response.sum = x.r_sum
  12. 62 x.save
  13. 63 elsif
  14.  
  15. debugger output:
  16. (rdb:1) simulation.items
  17. ArgumentError Exception: wrong number of arguments (1 for 0)
  18. (rdb:1) Simulation.first.items
  19. [#<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>]
  20. (rdb:1)
Add Comment
Please, Sign In to add comment