Skip to content

Commit bb5846a

Browse files
committed
getting ready for dress rehearsal
1 parent cb9f9af commit bb5846a

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

agents/model/student.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ def interview_submitted_for_all_interviewees?(interview = nil)
8888

8989
log "#{self}'s interviewees: #{int_1.inspect} and #{int_2.inspect}"
9090

91-
have_first = true
9291
if int_1
93-
have_first = mongo.collection('interviews').find_one({:author => username, :interviewee => int_1})
92+
have_first = mongo.collection(:interviews).find({:author => username, :interviewee => int_1}).count > 0
9493
end
95-
have_second = true
94+
9695
if int_2
97-
have_second = mongo.collection('interviews').find_one({:author => username, :interviewee => int_2})
96+
have_second = mongo.collection(:interviews).find({:author => username, :interviewee => int_2}).count > 0
9897
end
9998

99+
log "#{self} --> have_first => #{have_first} & have_second => #{have_second}"
100100
if have_first && have_second
101101
log "#{self} has completed all required interviews"
102102
return true

reset_run_data.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
RUN = "michelle-fall-2011"
99

1010
require 'sail/rollcall/user'
11-
#require 'sail/rollcall/group'
11+
require 'sail/rollcall/group'
1212

1313
json = File.read("config.json")
1414
config = JSON.parse(json, :symbolize_names => true)
@@ -17,6 +17,7 @@
1717

1818
puts "Wiping data in mongo..."
1919
mongo.collection(:location_tracking).remove()
20+
mongo.collection(:interviews).remove()
2021
mongo.collection(:events).remove()
2122
mongo.collection(:rainforest_guesses).remove()
2223
mongo.collection(:organism_presence).remove()
@@ -35,12 +36,16 @@
3536
puts " - #{key}"
3637
u.metadata.send("#{key}=", nil)
3738
end
38-
#g = Rollcall::Group.find(u.groups.first.id)
39-
#if g
40-
# puts "Clearing metadata for group #{g.name}"
41-
# g.metadata.assigned_location_for_guess = nil
42-
# g.save
43-
#end
39+
begin
40+
g = Rollcall::Group.find(u.groups.first.id)
41+
if g
42+
puts "Clearing metadata for group #{g.name}"
43+
g.metadata.assigned_location_for_guess = nil
44+
g.save
45+
end
46+
rescue NoMethodError
47+
puts "Not clearing group metadata for #{u.account.login.inspect}..."
48+
end
4449
end
4550
u.save
4651
end

0 commit comments

Comments
 (0)