Showing posts with label grading. Show all posts
Showing posts with label grading. Show all posts

Friday, May 5, 2017

UTC grading scale for letter grade

UTC grading policy, grading scale
90-100 A
80-89 B
70-79 C
60-69 D
Below 60 F

Wednesday, January 18, 2017

gradecenter, blackboard


Wireless connection problem

UTC does not provide computer test service.


Blackboard, grade center,
 grade letter is decided by grade schema.
 Midterm grade on blackboard (is dynamic and can change. So, miderm grade should be called "current grade".




Thursday, December 10, 2015

bio233 final grade calculation in R

# Written Exams 50%
# Practical Exams 5%
# Assignments & Laboratory Reports 25%
# participation, Quizzes 5%
# Oral Presentations 15%
# bonus

require(xlsx)
rm(list=ls())
setwd("~/Dropbox/courses.student.research.dp/bio233.Fall2015_dpbx/course.management/grades/final-grade,fall15")
list.files()
tb = read.csv("201509-92253-01 Grades.csv")  #, colClasses=c(rep("character",4), rep("numeric",18)))
str(tb[,1:10])
names(tb)[1:10]
empty.columns= NULL
for (j in 7:length(tb[1,])){
  tb[,j] = as.numeric( tb[,j])
  if( max(tb[,j]) == 0 ) {
    print( mean(tb[,j]))
    print(paste(j, names(tb)[j]))
    empty.columns = c(empty.columns, j)
   }
}

names(tb)[ grep("bonus", names(tb))]

tb2 = tb[, - empty.columns]

tb2 = tb2[, -c(3:6)] #remove some character columns
names(tb2)[ grep( "not.count", names(tb2))] #remove does counted grades
tb3 = tb2[, - grep( "not.count", names(tb2)) ]

###
report = tb3[,1:2] #report table
###

# pick Exams
examColumns = names(tb3)[grep("Exam", names(tb3))]
examColumns[ grep("bonus", examColumns)]

exam1 = c(   "Quiz.Exam.1..Fall.2015..closed.book.part...Chapter.1.4...Real." ,                                                    
  "Assignment.Exam.1..Fall.2015.bonus.point.for.self.screen.recording.during.closed.book.exam..and.partial.credits..Real.",
  "Assignment.Exam.1..Fall.2015.bonus.point.for.self.screen.recording.during.open.book.exam..Real.",
  "Quiz.Exam.1..Fall.2015.Part.2..Real.",
  "Quiz.Exam.1..Fall.2015.Part.2..redo.for.makeup.points..Real.")      
exam2= c(  "Quiz.Exam.2..closed.book.part..Fall.2015..Real.",                                                                      
  "Assignment.bonus.point..self.recording.of.closed.book.exam..Exam.2..Fall.2015..Real.",                                
  "Assignment.bonus.point..self.recording.of.openbook..Exam.2..Fall.2015..Real.",                                        
  "Quiz.Exam.2.Open.book.part..Fall.2015..Real.")
exam3=c("Assignment.bonus.point..self.recording.of.closed.and.open.book..Exam.3.Fall.2015..Real.",                              
        "Quiz.Fall.2015.Exam.3..closed.book.part..ch8..10..12..28...Real." ,                                                    
        "Quiz.Fall.2015.Exam3.open.book.part..Real." )                      
final = c( "Quiz.Final.Exam..Fall.2015..closed.book.part..Real."  ,                                                                
  "Quiz.Final.Exam..open.book.part..Fall.2015..Real." ,                                                                  
  "Assignment.bonus.point..self.recording.of.closed.and.open.book..Final.Exam..Fall.2015..Real.")

#there is an extra column for Exam1 final grade. Do not double-count this again.
#"Exam.1.Fall.2015..Total.Grade..Real."                                                                                

report$Exam1 = apply( tb3[,exam1], 1, sum)
report$Exam2 = apply( tb3[,exam2], 1, sum)
report$Exam3 = apply( tb3[,exam3], 1, sum)
report$Final = apply( tb3[,final], 1, sum)

# take best 2 regular exam and the final
report$badExam = apply(report[,c("Exam1","Exam2", "Exam3")], 1, min)
report$ExamTot = (report$Exam1 + report$Exam2 + report$Exam3 + report$Final - report$badExam) / 3

# practical 5%
#"Assignment.Practical.Exam..microscope.and.morphogy..Fall.2015..Real."                                                
#"Assignment.Picture.of.streaked.plates..practical.exam..fall.2015..Real."                                              
practical = names(tb3)[grep("ractical", names(tb3))]
summary(tb3[practical])
report$PracticalTot = apply( tb3[,practical], 1, sum)*5/200

########
# assignments, quizs, lab reprts, 25%
tb3[1:2,grep("Assignment", names(tb3))]

#tb3[1:2,grep("Quiz", names(tb3))]
tb3[1:2,grep("v14", names(tb3))]
names(tb3)[grep("12", names(tb3))]
report$ch1 = tb3[, grep("v14Ch1",names(tb3))]
report$ch2= apply( tb3[, grep("v14Ch2",names(tb3))],1, max)
report$ch3= apply( tb3[, grep("v14..Ch3",names(tb3))],1, max)
report$ch4= apply( tb3[, grep("v14..Ch4",names(tb3))],1, max)
report$ch5= tb3[, grep("v14Ch5",names(tb3))]
report$ch6= apply( tb3[, grep("v14Ch6",names(tb3))],1, max)
report$ch7= apply( tb3[, grep("v14..Ch7",names(tb3))],1, max)
report$ch8= tb3[, grep("v14.Ch8",names(tb3))]
report$ch10= apply( tb3[, grep("v14..Ch10",names(tb3))],1, max)
report$ch12= apply( tb3[, grep("v14..Ch12",names(tb3))],1, max)
#report$ch12= tb3[, grep("v14..Ch12",names(tb3))]
report$ch28= apply( tb3[, grep("v14..Ch28",names(tb3))],1, max)

report$scale= apply( tb3[, grep("scale.of.microbes",names(tb3))],1, max)
report$DePaepe= apply( tb3[, grep("DePaepeTaddei",names(tb3))],1, max)
report$EcoliGenome= apply( tb3[, grep("E.coli.genome",names(tb3))],1, max)
report$video1 = tb3[, "Assignment.Homework..Video.recording.of.self.introduction..Real."]

misc = c("Assignment.Homework..Video.recording.of.self.introduction..Real.",
"Assignment.Lab.report..west.nile.virus..Individual.effort...Real.",
"Assignment.Serial.dilution.lab.group.report..Each.group.only.needs.to.submit.1.report...Real.",
"Quiz.Lab.report..myxoma.and.australian.rabbits..Real.",
"Assignment.Report.for.Gram.stain.lab..individual.report...Real.",
"Assignment.Milestone.check..googleDoc.serial.dilution.group.data.input..Real.",
"Assignment.Milestone.check..googleDoc.serial.dilution.group.data.input..for.plat.counting.results..Real.",
"Assignment.Ontime.submission.of.oral.presentation.topic.on.GoogleDoc..Real.")
tb3[1:2,misc]
report$misc = apply( tb3[, misc],1, sum)

names(report)
assignment.lab = c("ch1","ch2","ch3","ch4","ch5","ch6","ch7","ch8","ch10","ch12","ch28","scale","DePaepe","EcoliGenome","video1","misc")
summary(report[,assignment.lab])

report$assignment.lab = apply(report[, assignment.lab], 1, sum)
report$assignment.labTot = 25* report$assignment.lab / (ceiling(max(report$assignment.lab)/10)*10)

#participation 5
report$participation = tb3[,"Attendance.Attendance..Real."]

### bonus
report$bonus = tb3[,"Assignment.bio233.bonus.points..fall.2015..Real."]

#oral presentation
names(tb3)[grep("oral", names(tb3))]
report$oral = tb3[,"Assignment.Second.video.recording..oral.presentation.of.a.primary.research.paper.on.microbiology..individual.effort..Real."]
report$oral = report$oral * 15/ 100

names(report)[grep("Tot", names(report))]
# Final Grade
final.grades = c("ExamTot","PracticalTot","assignment.labTot", 'oral','participation', 'bonus')
report$TotalGrade = apply( report[,final.grades], 1, sum)
source("grade2letter.R")
report$letter = lapply(report$TotalGrade,  grade2letter)

write.xlsx(report, "bio233_fall2015_final_grades.xlsx")

#generate a sorted report
report.sorted = report[order(report$TotalGrade),]
write.xlsx(report.sorted, "bio233FinalGradesFall2015-sorted.xlsx")

#generate a student report file
studentReport = c("First.name","Last.name", final.grades, 'TotalGrade', 'letter' )
write.xlsx(report.sorted[,studentReport], "bio233FinalGradeFall2015_student_report.xlsx")
 


Monday, December 7, 2015

FYE writing grading, 10 hours.

FYE reflections grading.

Wed 6 hours, reading.
Thu Chalk&wire grading, 1 hour

Mon, 3 hours of chalk&wire grading.


Wednesday, March 11, 2015

R code, midterm grading, for sections, with letter grade assignment

file = "gradebio125,20150310.R"

#bio125 grades
# Mid-Semester Exam   25%
# Final Exam 25%
# Assignments 25%
# Project Report 10%
# Presentation    10%
# Class Participation     5%

rm(list=ls())
list.files()
flag = 2

#The - signs have to be replaced with zeros in textwrangler
infile = "201501-61953-01 Grades.csv"
if( flag == 2){ infile = "201501-61954-02 Grades.csv" }

tb = read.csv(infile)

empty.columns= NULL
for (j in 7:length(tb[1,])){
 tb[,j] = as.numeric( tb[,j])
 tb[is.na(tb[,j]),j] = 0
 if( max(tb[,j])==0 ) { empty.columns = c(empty.columns, j)}
}
str(tb)
tb2 = tb[, - empty.columns]
summary(tb)

names(tb2)[ grep("total", names(tb2)) ]
tb2 = tb2[, -grep("total", names(tb2)) ]
tb2 = tb2[, -grep("assessment", names(tb2)) ]
names(tb2);
sort(names(tb2))
tb3 = tb2[, sort(names(tb2))]

####
#pick highest scores from regular and makeup ones
makeups = grep("make", names(tb3))
regulars = makeups - 1
names(tb3)[c(makeups, regulars)]
for (i in makeups){
  tb3[,i-1]= apply(tb3[,c(i-1,i)], 1, max)
}
tb3[, c(makeups[2]-1, makeups[2])] #passed.
# now, remove makeups
tb4 = tb3[, -makeups]
###end of pick highest grades

##here is the output report
out= tb4[,c("First.name","Last.name")]

#Midterm 25%
names(tb4)[ grep( 'mid', names(tb4)) ]
#section 1
Midterm = c(  "Quiz.Spring.2015..section.1..midterm..open.part", "X2015midterm.closed.book"  )
#section 2  
if( flag==2){ Midterm = c(  "Quiz.Sp15..Section2..midterm..open.book.part", "X2015.midterm.exam.closed.book" )  }
out$Exam = apply( tb4[,Midterm], 1, sum)
out$Exam = out$Exam + 10  #adjust midterm exam

#Final 25%
# ....

# Project Report  10%
names(tb4)[ grep( 'port', names(tb4)) ]
Reports = c("Assignment.GoogleDoc.report.of.RE.digestion.lab..group.submission.",    
  "Assignment.Set.up.GoogleDoc.for.final.project.and.report.of.miniprep.lab"
)

# Class Participation     5%
#names(tb4)[ grep( 'note', names(tb4)) ]
names(tb4)[ grep( 'Quiz.lab', names(tb4)) ]
Participation = names(tb4)[ grep( 'Quiz', names(tb4)) ]
Participation = Participation [-grep("lab", Participation )]
#Participation = Participation[-grep("Quiz.Spring.2015..section.1..midterm..open.part", Participation)]
Participation = Participation[-grep(Midterm, Participation)]

out$Participation = apply(tb4[,Participation], 1, sum)
out$Participation = 5 * out$Participation / max(out$Participation)

#Assignments  #25%
Assignments = names(tb4)[ grep("Quiz", names(tb4)) ]
out$Assignments = apply( tb4[,Assignments], 1, sum)
out$Assignments = 25 * out$Assignments / max( out$Assignments )

# Presentation    10%
# ...


#out$exam = tb4[,Midterm]

head(out)
out$total = apply( out[,3:5], 1, sum)
out$FinalGrade =  100*out$total/ (50+25+5)
hist(out$FinalGrade, br=20)
summary(out$Exam*2)

grade2letter = function(x){
  if(x>94){    ret='A'
  }else if (x >90) {    ret='A-'
  }else if (x >87 ){    ret = 'B+'
  }else if (x > 84){    ret = 'B'
  }else if (x >80){    ret = 'B-'
  }else if (x > 76){  ret = 'C+'
  }else if (x > 70){ ret = 'C'
  }else if (x > 67){ ret = 'C-'
  }else if (x > 64){ ret = 'D+'
  }else if (x > 60){ ret = 'D'
  }else {   ret = 'F'
  }
  return (ret)
}
grade2letter(70); grade2letter(88)

out$letter = unlist(lapply(out$FinalGrade,  grade2letter))

outfile = paste( "out", infile, sep="." )
write.csv(out, outfile )

#generate a sorted report
out.sorted = out[order(out$FinalGrade),]
write.csv(out.sorted, file=paste("sorted.out",infile, sep="."))

#q("no")
#################


Tuesday, March 10, 2015

R code, bio125 midterm grade analysis

#bio125 grades
# Mid-Semester Exam   25%
# Final Exam 25%
# Assignments 25%
# Project Report 10%
# Presentation    10%
# Class Participation     5%

rm(list=ls())

list.files()
flag = 2
tb = read.csv("201501-61954-02 Grades.csv")
#tb = read.csv("201501-61953-01 Grades.csv")
#The - signs have to be replaced with zeros in textwrangler

empty.columns= NULL
for (j in 7:length(tb[1,])){
 tb[,j] = as.numeric( tb[,j])
 tb[is.na(tb[,j]),j] = 0
 if( max(tb[,j])==0 ) { empty.columns = c(empty.columns, j)}
}
str(tb)
tb2 = tb[, - empty.columns]
summary(tb)

names(tb2)[ grep("total", names(tb2)) ]
tb2 = tb2[, -grep("total", names(tb2)) ]
tb2 = tb2[, -grep("assessment", names(tb2)) ]
names(tb2);
sort(names(tb2))
tb3 = tb2[, sort(names(tb2))]

####
#pick highest scores from regular and makeup ones
makeups = grep("make", names(tb3))
regulars = makeups - 1
names(tb3)[c(makeups, regulars)]
for (i in makeups){
  tb3[,i-1]= apply(tb3[,c(i-1,i)], 1, max)
}
tb3[, c(makeups[2]-1, makeups[2])] #passed.
# now, remove makeups
tb4 = tb3[, -makeups]
###end of pick highest grades

#Midterm 25%
names(tb4)[ grep( 'mid', names(tb4)) ]
Midterm = c(  "Quiz.Spring.2015..section.1..midterm..open.part"  ) #section 1
if( flag==2) {
 Midterm = c(  "Quiz.Sp15..Section2..midterm..open.book.part"  )   #section 2
}

#Final 25%
# ....

# Project Report  10%
names(tb4)[ grep( 'port', names(tb4)) ]
Reports = c("Assignment.GoogleDoc.report.of.RE.digestion.lab..group.submission.",    
  "Assignment.Set.up.GoogleDoc.for.final.project.and.report.of.miniprep.lab"
)

# Class Participation     5%
#names(tb4)[ grep( 'note', names(tb4)) ]
names(tb4)[ grep( 'Quiz.lab', names(tb4)) ]
Participation = names(tb4)[ grep( 'Quiz', names(tb4)) ]
Participation = Participation [-grep("lab", Participation )]
#Participation = Participation[-grep("Quiz.Spring.2015..section.1..midterm..open.part", Participation)]
Participation = Participation[-grep(Midterm, Participation)]

#Assignments  #25%
Assignments = names(tb4)[ grep("Quiz", names(tb4)) ]

# Presentation    10%
out= tb4[,c("First.name","Last.name")]

out$Assignments = apply( tb4[,Assignments], 1, sum)
out$Assignments = 25 * out$Assignments / max( out$Assignments )

out$Participation = apply(tb4[,Participation], 1, sum)

out$Participation = 5 * out$Participation / max(out$Participation)

out$exam = tb4[,Midterm]
head(out)
out$total = apply( out[,3:5], 1, sum)
hist(out$total, br=10)



Sunday, December 14, 2014

BIO233 final grade calculation

#This is file "gradebio233,20141214.R"


require(xlsx)
rm(list=ls())

list.files()
# tb = read.csv("201409-62376-01BIO233 Grades 20141209c.csv")
tb = read.csv("201409-62376-01BIO233 Grades 20141214-a.csv")
#The - signs have to be replaced with zeros in textwrangler

empty.columns= NULL
for (j in 8:length(tb[1,])){
  #for( i in 1:length(tb[,1])){
  #  if( tb[i,j]=='-') {tb[i,j]=NA } 
  #}
 tb[,j] = as.numeric( tb[,j])
 tb[is.na(tb[,j]),j] = 0
 if( max(tb[,j])==0 ) { empty.columns = c(empty.columns, j)}
}
str(tb) 
tb2 = tb[, - empty.columns]
#tb2 = tb2[, -"Course.total"]
#tb2 = tb2[, - grep('Spring', names(tb2))]
#tb2 = tb2[, - grep('spring', names(tb2))]
tb2 = tb2[, -grep("Quiz.Retake..Fall.2014.Exam.1..part.2..online.part", names(tb2))]
names(tb2)

examColumns = names(tb)[grep("xam", names(tb))]
exam1 = c(         "Quiz.Exam1.Part1..Fall.2014"      ,                                   
          "Assignment.Exam1..part2..calculation.questions..Fall.2014"     ,      
          "Quiz.Fall.2014.Exam.1..part.2..online.part"                          
          )        
exam2= c("Quiz.Exam.2..closed.book.section..Fall.2014..Thursday",             
        "Quiz.Exam2..open.book.section..Fall.2014..Tuesday")
exam3=c("Quiz.Exam3..closed.book.section..Nov.20..2014",                   
        "Quiz.Exam.3..open.book.section..Fall.2014"   )                        
final = c( "Quiz.Final.Exam..Open.book.section..Fall2014..Dec.9..11am.13.00",     
    "Quiz.Closed.book.section.of.final.exam..Dec.9..2014..10.30am.12.30pm")

tb2[,final]
names(tb)[grep("inal", names(tb))]

report= tb2[,1:2]
report$Exam1 = apply( tb2[,exam1], 1, sum)
report$Exam2 = apply( tb2[,exam2], 1, sum)
report$Exam3 = apply( tb2[,exam3], 1, sum)
report$Final = apply( tb2[,final], 1, sum)

practical = names(tb2)[grep("ractical", names(tb2))]
report$ToTpractical = (tb2[,"Assignment.Practical.Exam..microscope.and.morphology..Sep.29..2014"]/10
 + tb2[,"Assignment.Streak.plate..practical.exam"])/4

### do find out assignments and chapter quiz
#scale lap report were posted twice
scale = c("Quiz.Lab.assignment..Scale.of.Microbes",                    
"Quiz.scale.of.microbes..lab.report")
report$scale= apply( tb2[, scale],1, max)

# chapter homework can be found with "Quiz" or "Chapter". The names should be consisteny!!!
names(tb2)[grep("Chapter", names(tb2))]

report$ch1 = tb2[, grep("Chapter.1",names(tb2))]
report$ch2 = tb2[, grep("Chapter\\.2",names(tb2))] ##.2 can match 32
report$ch3= apply( tb2[, grep("Chapter.3",names(tb2))],1, max)
report$ch4= apply( tb2[, grep("Chapter.4",names(tb2))],1, max)
report$ch5= apply( tb2[, grep("Chapter.5",names(tb2))],1, max)
report$ch5= apply( tb2[, grep("Chapter.6",names(tb2))],1, max)
report$ch7= apply( tb2[, grep("Chapter.7",names(tb2))],1, max)
report$ch8= apply( tb2[, grep("Chapter.8",names(tb2))],1, max)
report$ch9= apply( tb2[, grep("Chapter9",names(tb2))],1, max)
report$ch10= apply( tb2[, grep("Chapter10",names(tb2))],1, max)
report$ch16= apply( tb2[, grep("Chapter16",names(tb2))],1, max)
report$ch32= apply( tb2[, grep("Chapter32",names(tb2))],1, max)

#misc assignment and lab reports, which can be quiz or assignments
names(tb2)[grep("ment", names(tb2))]

misc= c( "Assignment.Serial.dilution.lab.group.report"      ,                  
 "Quiz.DePaepeTaddei.Reading.Assignment"                 ,             
 "Assignment.Pictures.for.microbes.on.campus.by.groups"     ,          
 "Quiz.Lab.assignment..Scale.of.Microbes"                 ,            
 "Quiz.Lab.assignment..E.coli.genome.studies"       ,                  
 "Assignment.Report.for.Gram.stain.lab..individual.report."  ,         
 "Assignment.Homework.for.Dr..Wenzhi.Li.s.lecture..Individual.effort.",
 "Assignment.homework.on.circulating.tumor.DNA"   )

tb2[, "Assignment.homework.on.circulating.tumor.DNA" ] =  tb2[,  "Assignment.homework.on.circulating.tumor.DNA" ]/10
tb2[, "Assignment.Report.for.Gram.stain.lab..individual.report."] =tb2[, "Assignment.Report.for.Gram.stain.lab..individual.report."]/10
tb2[1:5, misc]

report$misc= apply( tb2[, misc],1, sum)

assignAndLab =c("scale","misc","ch1","ch2","ch3","ch4","ch5","ch7","ch8", "ch9","ch10","ch16","ch32")
report$ToTassignAndLab = apply( report[,assignAndLab], 1, sum)
maxS = apply( report[, assignAndLab], 2, max)
report$ToTassignAndLab = 15*report$ToTassignAndLab / sum(maxS)
## end of assignment and lab reports

#attendence
list.files()
att.tb= read.csv( "201409-62376-01BIO233_Attendances_2014129-1734.csv")
att.tb$ToTAttendence = apply( att.tb[, 6:33], 1, sum)
str(att.tb)
hist(att.tb$ToTAttendence, br=20)
report$ToTAttendence = att.tb$ToTAttendence[match(report$Last.name, att.tb$Last.name)]
report$ToTAttendence = report$ToTAttendence*5/ max(report$ToTAttendence)

# take best 2 regular exam and the final
report$badExam = apply(report[,c("Exam1","Exam2", "Exam3")], 1, min)
report$ExamTot = (report$Exam1 + report$Exam2 + report$Exam3 + report$Final - report$badExam) / 3

head(report)

# bonus points, need to add R bonus points
names(tb2)[grep("onus", names(tb2))]
bonus = c("Assignment.Bonus.points.of.paper.presentations.and.volunteering" ,      
      "Assignment.Bonus.Problem.1..Flow.cytometer.data.analysis.1"     ,
      "Assignment.Bonus.problem.2..Cholera.data.simulation.in.R.1"    )
report$bonus = apply( tb2[,bonus], 1, sum)

# oral 
report$oral = tb2[,"Assignment.Oral.presentation.grades..fall.2014"]

#written report
report$written = tb2$WrittenReport

FinalGrades= c("ExamTot","ToTpractical","ToTassignAndLab", "ToTAttendence", 'bonus', 'oral', "written")
report[,FinalGrades]

report$FinalGrade= apply(report[,FinalGrades], 1, sum) 
hist(report$FinalGrade, br=20)

grade2letter = function(x){
  if(x>94){    ret='A'
  }else if (x >90) {    ret='A-'
  }else if (x >87 ){    ret = 'B+'
  }else if (x > 84){    ret = 'B'
  }else if (x >80){    ret = 'B-'
  }else if (x > 76){  ret = 'C+'  
  }else if (x > 70){ ret = 'C'  
  }else if (x > 67){ ret = 'C-'
  }else if (x > 64){ ret = 'D+'
  }else if (x > 60){ ret = 'D'
  }else {   ret = 'F'
  }
  return (ret)
}
grade2letter(70); grade2letter(88)
report$letter = lapply(report$FinalGrade,  grade2letter)

write.xlsx(report, "bio233FinalGradesFall20141214-a.xlsx")

#generate a sorted report
report.sorted = report[order(report$FinalGrade),]
write.xlsx(report.sorted, "bio233FinalGradesFall20141214-a-sorted.xlsx")

Saturday, December 13, 2014

bio233, written report grading, final grade calculation

4pm-9pm.  I spent 5 hours reading student written report. Plagiarism is a the major concern, and I spent most of time googling sentences. Sometimes, verbatim hits will also show-up in multiple papers, indicating that some researchers also copy-past during their writings.

by 10pm, I calculated the final grade.

Friday, October 24, 2014

R code for midterm grade report



#require(xlsx)
rm(list=ls())

list.files()
tb = read.csv("some grades.csv")
empty.columns= NULL
for (j in 8:length(tb[1,])){
  #for( i in 1:length(tb[,1])){
  #  if( tb[i,j]=='-') {tb[i,j]=NA } 
  #}
 tb[,j] = as.numeric( tb[,j])
 tb[is.na(tb[,j]),j] = 0
 if( max(tb[,j])==0 ) { empty.columns = c(empty.columns, j)}
}
str(tb) 
tb2 = tb[, - empty.columns]
#tb2 = tb2[, -"Course.total"]
#tb2 = tb2[, - grep('Spring', names(tb2))]
#tb2 = tb2[, - grep('spring', names(tb2))]
tb2 = tb2[, -grep("Quiz.Retake..Fall.2014.Exam.1..part.2..online.part", names(tb2))]
names(tb2)
exam1 = c("Quiz.Exam1.Part1..Fall.2014" ,                                    
          "Assignment.exam1..part2..calculation.questions..fall.2014",
          "Quiz.Fall.2014.Exam.1..part.2..online.part"                )        
exam2= c("Quiz.Exam.2..closed.book.section..Fall.2014..Thursday",             
        "Quiz.Exam2..open.book.section..Fall.2014..Tuesday")

report= tb2[,1:2]
report$Exam1 = apply( tb2[,exam1], 1, sum)
report$Exam2 = apply( tb2[,exam2], 1, sum)

practical = "Assignment.Practical.Exam..microscope.and.morphology..Sep.29..2014"
report$practical = tb2[,practical]/20

scale = c("Quiz.Lab.assignment..Scale.of.Microbes",                    
"Quiz.scale.of.microbes..lab.report")
report$scale= apply( tb2[, scale],1, max)

misc= c("Quiz.DePaepeTaddei.Reading.Assignment" ,                                           
        "Quiz.Lab.assignment..E.coli.genome.studies")

tb2[1:5, misc]
report$misc= apply( tb2[, misc],1, sum)
report$ch1 = tb2[, grep("Chapter.1",names(tb2))]
report$ch2 = tb2[, grep("chapter.2",names(tb2))]
report$ch3= apply( tb2[, grep("Chapter.3",names(tb2))],1, max)
report$ch4= apply( tb2[, grep("Chapter.4",names(tb2))],1, max)
report$ch5= apply( tb2[, grep("Chapter.5",names(tb2))],1, max)
report$ch5= apply( tb2[, grep("ch6",names(tb2))],1, max)
report$ch7= apply( tb2[, grep("ch7",names(tb2))],1, max)
report$ch8= apply( tb2[, grep("ch8",names(tb2))],1, max)
names(tb2)[grep("Quiz", names(tb2))]

assignAndLab =c("scale","misc","ch1","ch2","ch3","ch4","ch5","ch7","ch8")
report$assignAndLab = apply( report[,assignAndLab], 1, sum)
maxS = apply( report[, assignAndLab], 2, max)
report$assignAndLab = 15*report$assignAndLab / sum(maxS)

report$highExam = apply(report[,c("Exam1","Exam2")], 1, max)
head(report)

midterm= c("highExam","practical","assignAndLab")
report$midterm= apply(report[,midterm], 1, sum) *100/70
head(report[,midterm])
hist( report$midterm )

grade2letter = function(x){
  if(x>94){    ret='A'
  }else if (x >90) {    ret='A-'
  }else if (x >87 ){    ret = 'B+'
  }else if (x > 84){    ret = 'B'
  }else if (x >80){    ret = 'B-'
  }else if (x > 76){  ret = 'C+'  
  }else if (x > 70){ ret = 'C'  
  }else if (x > 67){ ret = 'C-'
  }else if (x > 64){ ret = 'D+'
  }else if (x > 60){ ret = 'D'
  }else {   ret = 'F'
  }
  return (ret)
}
grade2letter(70); grade2letter(88)
report$letter = lapply(report$midterm,  grade2letter)

Thursday, September 25, 2014

Spelman Grade percentage score to letter grade

Grade scale, grade distribution. 


Grade Scale for letter grade
Grade                Percentage Score
A                                  94 - 100
A-                                90 - 93.9
B+                                87 – 89.9
B                                  84 – 86.9
B-                                 80 – 83.9
C+                                76 – 79.9
C                                  70 – 75.9
C-                                 67 – 69.9
D+                                64 – 66.9
D                                  60 – 63.9

F                                    0 - 59.9





grade2letter = function(x){
  if(x>94){    ret='A'
  }else if (x >90) {    ret='A-'
  }else if (x >87 ){    ret = 'B+'
  }else if (x > 84){    ret = 'B'
  }else if (x >80){    ret = 'B-'
  }else if (x > 76){  ret = 'C+'  
  }else if (x > 70){ ret = 'C'  
  }else if (x > 67){ ret = 'C-'
  }else if (x > 64){ ret = 'D+'
  }else if (x > 60){ ret = 'D'
  }else {   ret = 'F'
  }
  return (ret)

}

Sunday, April 20, 2014

Moodle, regrading

Sometimes, questions are unclear, or wrong choices were picked as correct answer. Regrading is need in this case. After reedit the questions, 'regrade' can be clicked to reassign the grades.

Monday, March 3, 2014

R code to analyze student grades

list.files()

tb = read.csv("bio233grades20140303.csv", colClasses=c(rep("character",4), rep("numeric",17)))
names(tb)
str(tb)

quizzes = c(10,13,19)
assignments = c(5:9,11,12,14)
practical=c(18)

tb2 = tb[,1:2]
tb2$exam1 = tb[,15] + tb[,16]
tb2$quizz = apply(tb[, quizzes], 1, sum)
tb2$assignments = apply(tb[, assignments], 1, sum)
tb2$practical = tb[,18]

tb3 = tb2
tb3$assignments = 15* tb2$assignments / max(tb2$assignments)
tb3$practical = tb2$practical*5/100

tb3$tot = apply(tb3[,3:6], 1, sum)*100/(50+5+5+15)
rownames(tb3)= tb3$last
summary(tb3)
tb4 = tb3[order(tb3$tot), ]

Tuesday, February 4, 2014

Moodle grade book, adjust item weight to calculate finale grade

1. Log into your Moodle course page. On the left,  click  a "Grades" icon. 


2. In the "Grader report" window, click the "Categories and items" tab. 

3. Click the 'full view'. 

4. You can adjust the 'Multiplicator' to give weights to each item. 

5. You can go back to the 'view' window to check the student grades, and make sure this what you want. 


6. Before do this, I suggest you to blind the "course total" from students. Make sure the changes are saved. 


Note: The weights are mostly going to change during the course. So, I would do this final grade calculation at least in late part of the semester.