]> code.communitydata.science - coldcallbot-discord.git/commitdiff
don't count folks who were missing
authorBenjamin Mako Hill <mako@atdot.cc>
Tue, 10 Nov 2020 18:20:43 +0000 (10:20 -0800)
committerBenjamin Mako Hill <mako@atdot.cc>
Tue, 10 Nov 2020 18:20:43 +0000 (10:20 -0800)
Patch the coldcall script so that it doesn't count folks who are missing as
present for a question.

coldcall.py

index 4987c741978a1826c4505a74eae90808251f1494..190584453c10253981f4341f5cd13f771c70948a 100644 (file)
@@ -28,7 +28,8 @@ class ColdCall():
             if re.match("call_list-\d{4}-\d{2}-\d{2}.tsv", fn):
                 with open(f"./data/{fn}", 'r') as f:
                     for row in DictReader(f, delimiter="\t"):
             if re.match("call_list-\d{4}-\d{2}-\d{2}.tsv", fn):
                 with open(f"./data/{fn}", 'r') as f:
                     for row in DictReader(f, delimiter="\t"):
-                        previous_questions[row["discord_name"]] += 1
+                        if not row["answered"] == "FALSE":
+                            previous_questions[row["discord_name"]] += 1
 
         return previous_questions
     
 
         return previous_questions
     
@@ -100,7 +101,7 @@ class ColdCall():
 
 # cc = ColdCall()
  
 
 # cc = ColdCall()
  
-# test_student_list = ["jordan", "Kristen Larrick", "Madison Heisterman", "Maria.Au20", "Laura (Alia) Levi", "Leona Aklipi", "Linya Feng", "anne", "kirst", "emmaaitelli", "ashleylee", "allie_partridge", "Tiana_Cole", "Hamin", "Ella Qu", "Angel Su", "Shizuka", "Ben Baird", "Kim Do", "Isaacm24", "Sam Bell", "Courtneylg", "TasnimHasan"]
+# test_student_list = ["jordan", "Kristen Larrick", "Madison Heisterman", "Maria.Au20", "Laura (Alia) Levi", "Leona Aklipi", "anne", "emmaaitelli", "ashleylee", "allie_partridge", "Tiana_Cole", "Hamin", "Ella Qu", "Shizuka", "Ben Baird", "Kim Do", "Isaacm24", "Sam Bell", "Courtneylg"]
 # print(cc.coldcall(test_student_list))
 
 # test_student_list = ["jordan", "Kristen Larrick", "Mako"]
 # print(cc.coldcall(test_student_list))
 
 # test_student_list = ["jordan", "Kristen Larrick", "Mako"]

Community Data Science Collective || Want to submit a patch?