Skip to content

Commit

Permalink
Correções
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMenezes committed Mar 19, 2013
1 parent c4a507e commit a42307f
Show file tree
Hide file tree
Showing 5 changed files with 1,987 additions and 301 deletions.
45 changes: 40 additions & 5 deletions US15 - analise_US3.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ diferencaTimeStampAula = function(dados) {
}





sessaoDeCadaSubmissao = function(dados, limiar) {
tableSession = data.frame(matricula=c(),turma=c(),data.hora = c(),status = c(),nota = c(), turma.pratica = c(), timestamp = c(), classe = c(),
session=c(), timeSession=c(), lastSubmission=c())
Expand Down Expand Up @@ -78,6 +75,45 @@ sessaoDeCadaSubmissao = function(dados, limiar) {
}


sessaoDeCadaSubmissaoAula = function(dados) {
tableSession = data.frame(matricula=c(),turma=c(),data.hora = c(),status = c(),nota = c(), turma.pratica = c(), timestamp = c(), classe = c(),
session=c(), timeSession=c(), lastSubmission=c())
dados$session = NA
amountSubmission = 0
timeSession = 0
session = 1
matricula = dados[1,"matricula"]
aula = dados[1,"timestampAula"]
for(i in 1:length(dados$matricula)) {
if((dados[i,"timestampAula"] == aula) & matricula == dados[i, "matricula"]) {
dados$session[i] = session
amountSubmission = amountSubmission+1
timeSession = timeSession+dados[i,"diferenca"]
}
if(matricula != dados[i, "matricula"]) {
tableSession = rbind(tableSession,data.frame(matricula,dados[i-1,"turma"],dados[i-1,"data.hora"],dados[i-1,"status"],dados[i-1,"nota"],
dados[i-1,"turma.pratica"],dados[i-1,"timestamp"],dados[i-1,"classe"],session, timeSession, amountSubmission) )
matricula = dados[i, "matricula"]
aula = dados[i,"timestampAula"]
session = 1
dados$session[i] = session
timeSession = 0
amountSubmission = 1
}
if((dados[i,"timestampAula"] != aula) & matricula == dados[i, "matricula"]) {
tableSession = rbind(tableSession, data.frame(matricula,dados[i-1,"turma"],dados[i-1,"data.hora"],dados[i-1,"status"],dados[i-1,"nota"],
dados[i-1,"turma.pratica"],dados[i-1,"timestamp"],dados[i-1,"classe"],session, timeSession, amountSubmission))
aula = dados[i,"timestampAula"]
session = session+1
dados$session[i] = session
timeSession = 0
amountSubmission = 1
}
}
return(tableSession)
}


############################################################################
#Em aula
############################################################################
Expand All @@ -89,8 +125,7 @@ submissoes.aula <- submissoes.aula[order(submissoes.aula$timestamp,decreasing =
tabela.aula <- diferencaTimeStampAula(submissoes.aula)

tabela = tabela.aula
limiar.aula = 7200
tabelaSessaoAula = sessaoDeCadaSubmissao(tabela, limiar.aula)
tabelaSessaoAula = sessaoDeCadaSubmissaoAula(tabela)


#Tabela com matricula, sess?o, tempo da sess?o, data da ultima submiss?o da sess?o
Expand Down
4 changes: 2 additions & 2 deletions US15 - analise_US9.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require(nortest)
require(ggplot2)

#leitura dos dados.aula
dados.aula <- read.csv("dados/tableSessionLength.csv",header=T)
dados.aula <- read.csv("dados/TableSessionLengthEmAula.csv",header=T)

dados.aula.numSessoes <- with(dados.aula,aggregate(session,list(matricula),FUN=max))
colnames(dados.aula.numSessoes) <- c("matricula","num.sessoes")
Expand Down Expand Up @@ -66,7 +66,7 @@ dev.off()
######################


dados.fora <- read.csv("dados/tableSessionLength.csv",header=T)
dados.fora <- read.csv("dados/TableSessionLengthForadeAula.csv",header=T)
dados.fora.numSessoes <- with(dados.fora,aggregate(session,list(matricula),FUN=max))
colnames(dados.fora.numSessoes) <- c("matricula","num.sessoes")
dados.fora.tempoEstudo <- with(dados.fora,aggregate(timeSession/3600,list(matricula),FUN=sum))
Expand Down
Loading

0 comments on commit a42307f

Please sign in to comment.