R script for updating student grades on Blackboard

This might be of interest to some of you teaching large enrollment courses and using scantrons for quizzes/exams. I developed a script using R programming language to automatically extract scores from ITS test scoring results and upload the grades to Blackboard.

The script needs two CSV format input files: the student info file from Blackboard (Full Grade Center -> Work Offline – Download) and the ITS test scoring results (convert the Excel file to CSV). It takes less than one second to get the results.

Feel free to let me know if you have any questions.

########################################

BBfile <- file.choose()  #”roster.csv”    ### The file downloaded from Blackboard
ITSfile <- file.choose()   #”result.csv”   ### The file received from ITS scantron results

# BBfile <- “roster.csv”
# ITSfile <- “result.csv”
output <- “score.csv”
scale.factor <- 1  ### scale factor multiplied by the scantron results.
### Extract students’ fullname from Blackboard roster
roster <- read.csv(BBfile,header = TRUE,stringsAsFactors = FALSE)
str(roster)
roster$firstname = as.character(lapply(strsplit(as.character(roster$First.Name), split=” “), “[“, 1))
roster$fullname <- tolower(paste(roster$Last.Name,roster$firstname,sep=””))
### read the ITS results
df <- read.csv(ITSfile,stringsAsFactors = FALSE)
df <- df[nchar(gsub(” “,””,df$X))>0,]
df <- df[!is.na(as.numeric(df$X.5)),c(“X”,”X.2″)]
colnames(df) <- c(“Name”,”Score”)
df$Score <- as.numeric(df$Score) * scale.factor
str(df)
### extract student names from ITS results

lastname <- as.character(lapply(strsplit(as.character(df$Name), split=” “), “[“, 1))
firstname <- as.character(lapply(strsplit(as.character(df$Name), split=” “), “[“, 2))
df$fullname  <- tolower(paste(lastname,firstname,sep = “”))
### match student names from Blackboard and ITS
m.x <- merge(roster,df,by = “fullname”,all.x = TRUE)
fix(m.x)
m.x$raw <- m.x$Score / scale.factor
### save the results to csv file
write.csv(m.x,output,na = “”,row.names = FALSE)
m.y <- merge(roster,df,by = “fullname”,all.x = TRUE,all.y = TRUE)
m.y.sub <- m.y[is.na(m.y$Last.Name), ]
score <- read.csv(output,header = TRUE,stringsAsFactors = FALSE)
summary(score)

########################################

Advertisements

About Qiusheng Wu

Assistant Professor of Geography at Binghamton University, State University of New York

Posted on February 19, 2016, in Algorithms, Tutorials. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Alex Tereshenkov

Programming and managing GIS

REDD+ for the Guiana Shield

Technical Cooperation Project

LidarBlog.com

Dr. Qiusheng Wu @ SUNY Binghamton

Writing Science

How to write papers that get cited and proposals that get funded

GIS In Ecology

Providing Training, Advice And Consultation On The Use Of GIS In Ecology

metrhispanic

On cities, land, ...

GeoAcademy

Open GIS: No Bounds

Scientia Plus Conscientia

Thoughts on Science and Nature

r4hydrology

Learning hydrology with R

Karl Hennermann

GIS at the University of Manchester

GIS and Science

Applications of geospatial technology for scientific research and understanding.

GISblog.com

GIS, Mapping, Remote Sensing, Geodata, Geospatial news

Whitebox Geospatial Analysis Tools

Open-source GIS development and spatial analysis with Whitebox GAT

TopoToolbox

MATLAB-based software for topographic analysis

Anything Geospatial – AnyGeo

Dr. Qiusheng Wu @ SUNY Binghamton

GeospatialPython.com

Dr. Qiusheng Wu @ SUNY Binghamton

Another GIS Blog

Dr. Qiusheng Wu @ SUNY Binghamton

%d bloggers like this: