Adds code to process final exam.

parent 4da6663a
......@@ -70,7 +70,7 @@ x <- gdata::read.xls(paste0(path, "RelatoriodeDiariodeClasseExcel.xls"),
encoding = "latin1",
stringsAsFactors = FALSE,
skip = 6)
v <- names(x) %in% c("Matrícula", "Nome", "Faltas")
v <- names(x) %in% c("Matrícula", "Nome", "Faltas", "Exame")
mat <- x %>%
select(names(x)[v]) %>%
......@@ -239,6 +239,23 @@ nt %>%
select(nome) %>%
print(right = FALSE, row.names = FALSE, print.gap = FALSE)
nt$Média[which(nt$GRR == 20115297)] <- 70
str(nt)
#-----------------------------------------------------------------------
# Média final.
if (!is.null(nt$Exame)) {
nt[["M. final"]] <- nt[["Média"]]
i <- nt[["Média"]] < 70
u <- nt[["Exame"]]
u[is.na(u)] <- 0
nt[["M. final"]][i] <- ceiling((nt[["Média"]][i] + u[i])/2)
}
# View(nt)
#-----------------------------------------------------------------------
# Tabela em HTML.
......@@ -253,7 +270,9 @@ i <- c(grep(x = names(nt), "GRR"),
grep(x = names(nt), "^S"),
grep(x = names(nt), "^T"),
grep(x = names(nt), "Faltas"),
grep(x = names(nt), "Média"))
grep(x = names(nt), "Média"),
grep(x = names(nt), "Exame"),
grep(x = names(nt), "M. final"))
dt <- datatable(data = select(nt, i),
filter = "top",
......@@ -269,7 +288,7 @@ dt <- datatable(data = select(nt, i),
# dt
dt <- formatStyle(table = dt,
columns = grepl("^(S|T|M)", names(dt$x$data)),
columns = grepl("^(S|T|Média)", names(dt$x$data)),
color = styleInterval(cuts = c(39.999999,
69.999999),
values = c("#ff3300",
......@@ -284,6 +303,14 @@ if (is.element("Faltas", names(dt$x$data))) {
"#ff3300")))
}
if (is.element("M. final", names(dt$x$data))) {
dt <- formatStyle(table = dt,
columns = "M. final",
color = styleInterval(cuts = c(49.999999),
values = c("#ff3300",
"#3333ff")))
}
dt
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment