]> code.communitydata.science - coldcallbot-discord.git/commitdiff
change assessment code for BSOC 2024 master
authorBenjamin Mako Hill <mako@atdot.cc>
Tue, 7 Oct 2025 22:37:08 +0000 (15:37 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Tue, 7 Oct 2025 22:44:49 +0000 (15:44 -0700)
assessment_and_tracking/compute_final_case_grades.R
coldcallbot-manual.py

index 93d6d1f782b1e79d0aee2f2d956a13bca474e015..e35505269fa3f7149da622ed0362b4ea66125860 100644 (file)
@@ -1,6 +1,6 @@
 ## load in the data
 #################################
-myuw <- read.csv("../data/2022_winter_COM_481_A_students.csv", stringsAsFactors=FALSE)
+myuw <- read.csv("../data/2024_autumn_COMMLD_570_A_joint_students.csv", stringsAsFactors=FALSE)
 
 current.dir <- getwd()
 source("../assessment_and_tracking/track_participation.R")
@@ -11,20 +11,20 @@ call.list$timestamp <- as.Date(call.list$timestamp)
 
 ## class-level variables
 gpa.point.value <- 50/(4 - 0.7)
-question.grades <- c("PLUS"=100, "CHECK"=100-gpa.point.value, "MINUS"=100-(gpa.point.value*2))
+## question.grades <- c("GOOD"=100, "FAIR"=100-gpa.point.value, "BAD"=100-(gpa.point.value*2))
+question.grades <- c("GOOD"=100, "SATISFACTORY"=100-gpa.point.value, "POOR"=100-(gpa.point.value*2), "NO MEANINGFUL ANSWER"=0)
 missed.question.penalty <- gpa.point.value * 0.2 ## 1/5 of a full point on the GPA scale
 
 ## inspect set the absence threashold
 ggplot(d) + aes(x=absences) + geom_histogram(binwidth=1, fill="white",color="black")
 absence.threshold <- median(d$absences)
 
-
 ## inspect and set the questions cutoff
 ## questions.cutoff <- median(d$num.calls)
 ## median(d$num.calls)
 ## questions.cutoff <- nrow(call.list) / nrow(d) ## TODO talk about this
 ## this is the 95% percentile based on simulation in simulation.R
-questions.cutoff <- 4
+questions.cutoff <- 15
 
 ## show the distribution of assessments
 table(call.list$assessment)
@@ -78,6 +78,7 @@ median(d$num.calls)
 ## helper function to generate average grade minus number of missing
 gen.part.grade <- function (x.unique.name) {
     q.scores <- question.grades[call.list$assessment[call.list$unique.name == x.unique.name]]
+    print(q.scores)
     base.score <- mean(q.scores, na.rm=TRUE)
 
     ## number of missing days
@@ -89,7 +90,6 @@ gen.part.grade <- function (x.unique.name) {
                missing.in.class.days=missing.in.class.days)
 }
 
-
 ## create the base grades which do NOT include missing questions
 tmp <- do.call("rbind", lapply(d$unique.name, gen.part.grade))
 d <- merge(d, tmp)
index 61c2010e8b27b8e416f89400e8bf5fe8641539c9..985ada0e9d32ee92d894fc57c0998855b1556911 100755 (executable)
@@ -3,7 +3,19 @@
 from coldcall import ColdCall
 from datetime import datetime
 from csv import DictReader
+from random import sample
 import json
+import argparse
+
+parser = argparse.ArgumentParser(description='run the coldcall bot manually to create a coldcall list')
+
+parser.add_argument('-n', '--num', dest="num_calls", default=100, const=100, type=int, nargs='?',
+                    help="how many students should be called")
+
+parser.add_argument('-s', '--shuffle', dest="shuffle_roster", action="store_true",
+                    help="select without replacement (i.e., call each person once with n equal to the group size)")
+
+args = parser.parse_args()
 
 current_time = datetime.today()
 with open("configuration.json") as config_file:
@@ -44,8 +56,12 @@ preferred_names = cc.get_preferred_names()
 students_present = [s for s in registered_students if s not in missing_today]
 # print("Students present:", students_present)  # useful for debug
 
-for i in range(100):
-    selected_student = cc.select_student_from_list(students_present)
+def print_selected(selected_student):
+    if "print_index" in globals():
+        global print_index
+    else:
+        global print_index
+        print_index = 1
 
     try:
         preferred_name = preferred_names[selected_student]
@@ -56,8 +72,23 @@ for i in range(100):
         pronouns = preferred_pronouns[selected_student]
     else:
         pronouns = "[unknown pronouns]"
-    
-    print(f"{i + 1}. {preferred_name} :: {pronouns} :: {full_names[selected_student]} :: {selected_student}")
+
+    print(f"{print_index}. {preferred_name} :: {pronouns} :: {full_names[selected_student]} :: {selected_student}")
 
     cc.record_coldcall(selected_student)
+    print_index += 1 ## increase the index
+
+# if we're in suffle mode
+shuffle = args.shuffle_roster
+
+print_index = 1
+
+if shuffle:
+    for selected_student in sample(students_present, len(students_present)):
+        print_selected(selected_student)
+else:
+    num_calls = args.num_calls
 
+    for i in range(num_calls):
+        selected_student = cc.select_student_from_list(students_present)
+        print_selected(selected_student)

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