-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcourse-solutions.qmd
More file actions
108 lines (88 loc) · 2.47 KB
/
course-solutions.qmd
File metadata and controls
108 lines (88 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
title: "Activity Solutions"
execute:
message: false
warning: false
echo: false
from: markdown+emoji
editor_options:
chunk_output_type: console
---
Activities are graded for completion! It is your responsibility and should be a part of your learning habit to review your activities for correctness. Solutions are posted roughly *3 days after* the due date.
```{r}
#library(tidyverse)
library(dplyr)
library(purrr)
library(gt)
library(stringr)
library(lubridate)
today_ymd <- Sys.Date()
today <- format(today_ymd,"%a %b %d")
agenda_final <- read.csv("documents/agenda_final.csv") %>%
mutate(time_due = today_ymd - as.Date(due_ymd))
E1 <- agenda_final %>%
filter(str_detect(Topic, "Exam 1")) %>%
pull(date_ymd)
E2 <- agenda_final %>%
filter(str_detect(Topic, "Exam 2")) %>%
pull(date_ymd)
E3 <- agenda_final %>%
filter(str_detect(Topic, "Exam 3")) %>%
pull(date_ymd)
```
```{r}
agenda_final2 <- agenda_final %>%
mutate(exam_date = case_when(
due_ymd < E1 ~ E1,
due_ymd < E2 ~ E2,
due_ymd < E3 ~ E3
))
agenda_final2 <- agenda_final2 %>%
mutate(show = case_when(
str_detect(Solutions, "Practice Exam") & time_due > -7 ~ 1,
time_due >= 3 ~ 1,
as.Date(exam_date) - today_ymd <= 4 ~ 1,
TRUE ~ 0
) )
```
```{r}
agenda_show <- agenda_final2 %>%
filter(show == 1)
```
```{r}
# solution video not working rn
agenda_show %>%
select(Solutions, Solution_video) %>%
as.data.frame() %>%
filter(Solutions != "") %>%
mutate(Solution_video = ifelse(Solution_video == "", "[]()", Solution_video)) %>%
gt() %>%
fmt_markdown(columns = c(Solutions, Solution_video) )%>%
cols_align(align = "left") %>%
tab_options(column_labels.hidden = TRUE,
table.align = "left",
table_body.border.top.color = "white",
table_body.border.bottom.color = "white",
table_body.hlines.color = "white",
table.width = pct(100))
```
```{r}
# agenda_show %>%
# select(Solutions) %>%
# #t() %>%
# as.data.frame() %>%
# filter(Solutions != "") %>%
# gt() %>%
# fmt_markdown(columns = c(Solutions) )%>%
# cols_align(align = "left") %>%
# tab_options(column_labels.hidden = TRUE,
# table.align = "left",
# table_body.border.top.color = "white",
# table_body.border.bottom.color = "white",
# table_body.hlines.color = "white",
# table.width = pct(100))
```
<br><br>
```{r echo = FALSE}
knitr::knit_exit()
```