Skip to content

Commit fbc6d60

Browse files
committed
Adding to and editing slides
1 parent 35d1ca1 commit fbc6d60

35 files changed

+215
-101
lines changed

index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Please fill out this survey:
8282
if (Sys.getenv("QUALTRICS_API_KEY") != "") {
8383
data.raw <- fetch_survey(surveyID = QUALTRICS_SURVEY, verbose = TRUE)
8484
data <- data.raw |>
85-
filter(Status != "Survey Preview") |>
8685
filter(consent == "Yes") |>
86+
filter(Status != "Survey Preview") |>
8787
filter(StartDate > QUALTRICS_STIME & EndDate < QUALTRICS_ETIME) |>
8888
# renaming variables
8989
select(StartDate,EndDate,Status,Finished,RecordedDate,ResponseId,consent,age_1,gender,education,num_tabs_1,name_confidential,number_confidential)

presentation/.ipynb_checkpoints/00-introduction-checkpoint.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Quick tutorial on preserving survey data
2+
3+
In this presentation we'll show you how to process and preserve survey data.
4+
5+
We'll use an API to retrieve the data, show you how to clean and strip the data of confidential information and non-consenting responses in order to create a publishable dataset.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Quick tutorial on preserving survey data
2+
3+
We've created a short survey for demonstration that you can fill out if you want to contribute your own responses.

presentation/.ipynb_checkpoints/01-goal-checkpoint.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Goals
2+
- [ ] Create a survey in Qualtrics for data collection.
3+
- [ ] Load the latest responses from the server using an API token.
4+
- [ ] Clean and process the data to remove non-consenting responses and any confidential data.
5+
- [ ] Create and publish usable data that does not reveal any confidential data.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
## Creating a survey in Qualtrics
22

3+
You'll typically have access to a Qualtrics account through your university or organization. Then it is easy to construct a survey using the web tool.
4+
35
![](images/qualtrics-edit.png)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
## Survey responses in Qualtrics
22

3+
Responses can be easily checked at a glance in the `Data and Analytics` tab. You can download data directly from this page, but to make sure you are always using the most up to date data, downloading directly via an API token is a more efficient way to access your data.
4+
35
![](images/qualtricsc-data)
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Loading data from Qualtrics using API
1+
## Loading data from Qualtrics using an API
22

3-
In order to always be analyzing the most up to data survey responses, we can load the data directly from the web using a Qualtrics API:
3+
In order to always be analyzing the most up to date survey responses, load the data directly from the web using a Qualtrics API. Here is some initial set up:
44

55
```{.R}
66
# qualtrics URL components
@@ -12,8 +12,4 @@ QUALTRICS_SURVEY <- "second part of survey URL, usually starts with SV"
1212
QUALTRICS_STIME <- ymd_hms("2025-07-01 00:00:01")
1313
QUALTRICS_ETIME <- ymd_hms("2025-08-26 23:59:00")
1414
15-
if (!dir.exists(here::here("data"))) {
16-
dir.create(here::here("data"))
17-
}
18-
1915
```

presentation/.ipynb_checkpoints/21-API-key-checkpoint.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
An API token is assigned to your Qualtrics account and is used to request data from a survey.
44

5-
The API token is stored as a secret in Github using environmental variables:
5+
You can set it directly in your R code:
66

7-
```plaintext
8-
echo "QUALTRICS_API_KEY=${{ secrets.QUALTRICS_API_KEY }}" >> $GITHUB_ENV
7+
``` {.R}
8+
Sys.setenv(QUALTRICS_API_KEY = "your-token")
99
```
10+
However, this token is your secret token and you don't want this appearing in your published code.
1011

11-
Then, in your publishable R code, you can simply refer to "`QUALTRICS_API_KEY`" in your code so as to not give away your API token.
12-
13-
Let's see how this works in the next slide:
12+
We'll revisit in later slides how to fix this issue for sharable code.

0 commit comments

Comments
 (0)