-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.R
44 lines (31 loc) · 1.12 KB
/
server.R
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
function(input, output, session) {
renderSurvey()
observeEvent(input$submit, {
posit_board <- board_connect()
previous <- posit_board |>
pin_read("renatadiaz/presub_responses")
# Obtain and and append submitted results
response <- getSurveyData(custom_id = input$email,
include_dependencies = FALSE)
timestamp <- data.frame(
subject_id = input$email,
question_id = "timestamp",
question_type = "time",
response = as.character(Sys.time())
)
response <- bind_rows(response, timestamp)
response <- response |>
mutate(response_id = max(previous$response_id) + 1)
updated <- bind_rows(previous, response)
# Write back to pin
posit_board |>
pin_write(updated, "renatadiaz/presub_responses")
# Show submission message
showModal(
modalDialog(
title = "Thank you. We'll be in touch shortly with next steps",
"Please reach out to Jessica Guo ([email protected]) or Renata Diaz ([email protected]) with any questions. "
)
)
})
}