You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detailed step-by-step todo list for implementing learnr tutorials for small classes using Shinyapps.io with Google Sheets logging and learnrhash for submission tracking.
# In setup chunk of learnr tutorial
library(googlesheets4)
# Use service account authentication
gs4_auth(path="path-to-service-account-key.json")
# Or use cached token approach for shinyapps.io
gs4_auth(cache=".secrets", email="your-email@gmail.com")
Test connection:
# Test writing to sheetsheet_id<-"your-google-sheet-id"test_data<-data.frame(
timestamp= Sys.time(),
test_field="connection_test"
)
sheet_append(sheet_id, test_data)
2.3 Create Logging Functions
Implement submission logging function:
log_submission<-function(student_name, student_email, exercise_id,
correct, code_submitted, attempt_number=1) {
# Sheet ID from your Google Sheet URLsheet_id<-"your-google-sheet-id-here"# Create log entrylog_entry<-data.frame(
timestamp= Sys.time(),
student_name=student_name,
student_email=student_email,
exercise_id=exercise_id,
correct=correct,
code_submitted=code_submitted,
attempt_number=attempt_number,
session_id= paste0("session_", format(Sys.time(), "%Y%m%d_%H%M%S")),
stringsAsFactors=FALSE
)
# Append to Google Sheet
tryCatch({
sheet_append(sheet_id, log_entry)
}, error=function(e) {
# Log errors locally as backup
cat("Error logging to Google Sheets:", e$message, "\n",
file="submission_errors.log", append=TRUE)
})
}
Phase 3: Tutorial Modification for Data Collection
3.1 Add Student Information Collection
Create student info UI at start of tutorial:
# Add to beginning of tutorial
div(id="student-info-form",
h3("Student Information"),
p("Please enter your information to begin the quiz:"),
textInput("student_name", "Full Name:",
placeholder="First Last"),
textInput("student_email", "Email Address:",
placeholder="student@university.edu"),
textInput("student_id", "Student ID (optional):",
placeholder="12345678"),
actionButton("start_quiz", "Start Quiz", class="btn-primary"),
br(), br()
)
3.2 Integrate Submission Tracking
Add event tracking to exercises:
# Modify existing exercises to include logging# Add this after each exercise check
observe({
if(!is.null(input$student_email) &&input$student_email!="") {
# Log exercise attemptsif(!is.null(input$`exercise-name-code-editor`)) {
log_submission(
student_name=input$student_name,
student_email=input$student_email,
exercise_id="exercise-name",
correct=FALSE, # Will be updated when checkedcode_submitted=input$`exercise-name-code-editor`,
attempt_number=1
)
}
}
})
3.3 Add learnrhash Integration
Add submission hash generation:
# At end of tutorial
div(
h3("Generate Submission Hash"),
p("Complete all exercises above, then click below to generate your submission hash:"),
encoder_ui("hash_encoder"),
br(),
div(id="submission-instructions",
h4("Submission Instructions:"),
tags$ol(
tags$li("Copy the hash code above"),
tags$li("Submit it via [your LMS/email/form]"),
tags$li("Include your name and student ID in submission")
)
)
)
# Server logic for hash encoder
encoder_logic("hash_encoder")
Phase 4: Testing and Deployment
4.1 Local Testing
Test tutorial locally:
# Run tutorial locally to test all functionalityrmarkdown::run("md-01-quiz.Rmd")
Test all features:
Student information collection works
All MCQ questions function properly
All coding exercises provide feedback
Google Sheets logging works
learnrhash generation works
Error handling doesn't break tutorial
4.2 Prepare for Deployment
Handle authentication files:
# For Google Sheets authentication on shinyapps.io# Use cached authentication approach:# Run this locally first:
gs4_auth(cache=".secrets", email="your-email@gmail.com")
# This creates .secrets folder with cached tokens# Include .secrets folder in deployment
# Module 1 Interactive Quiz Instructions## Before You Begin1. Ensure you have a stable internet connection
2. Allow 30-45 minutes to complete the quiz
3. Have your student ID ready
## How to Take the Quiz1. Click the quiz link: [your-app-url]2. Enter your full name and email address
3. Work through all three sections
4. Generate your submission hash at the end
5. Submit the hash via [Canvas/email/form]## Technical Requirements- Modern web browser (Chrome, Firefox, Safari, Edge)
- JavaScript enabled
- Cookies enabled
## Getting Help- Technical issues: email instructor
- Content questions: review Module 1 materials
5.2 Set Up Submission Collection
Choose submission method:
Option A: LMS assignment (Canvas, Moodle, etc.)
Option B: Google Form
Option C: Email submission
Option D: GitHub issue template
Create submission form (if using Google Forms):
Form fields:
- Student Name (required)
- Student Email (required)
- Student ID (required)
- Submission Hash (required, long text)
- Comments/Issues (optional)
Phase 6: Launch and Monitoring
6.1 Soft Launch
Test with small group first:
Invite 3-5 volunteer students
Monitor for any issues
Gather feedback on user experience
Make necessary adjustments
Check data collection:
Verify submissions appearing in Google Sheets
Check submission hashes are valid
Test grading workflow
6.2 Full Launch
Announce to class:
Send email with instructions and deadline
Post announcement in LMS
Provide direct link to quiz
Set clear deadline and expectations
Monitor during active period:
Check shinyapps.io usage dashboard
Monitor Google Sheets for submissions
Respond to student questions quickly
Watch for technical issues
Phase 7: Data Analysis and Grading
7.1 Collect and Analyze Submissions
Download submission data:
# Read data from Google Sheets
library(googlesheets4)
submissions<- read_sheet("your-sheet-id")
# Basic analysis
library(dplyr)
# Completion rates by exercisecompletion_by_exercise<-submissions %>%
group_by(exercise_id) %>%
summarise(
total_attempts= n(),
unique_students= n_distinct(student_email),
success_rate= mean(correct, na.rm=TRUE)
)
# Student progressstudent_progress<-submissions %>%
group_by(student_email) %>%
summarise(
exercises_attempted= n_distinct(exercise_id),
total_correct= sum(correct, na.rm=TRUE),
completion_rate=exercises_attempted/15# 15 total questions
)
Small Classes Implementation Todo List
Overview
Detailed step-by-step todo list for implementing learnr tutorials for small classes using Shinyapps.io with Google Sheets logging and learnrhash for submission tracking.
Phase 1: Account Setup and Prerequisites
1.1 Shinyapps.io Account Setup
1.2 Google Account Setup
1.3 R Environment Setup
Phase 2: Google Sheets Data Collection Setup
2.1 Create Data Collection Spreadsheet
correct, code_submitted, attempt_number, session_id
2.2 Configure Google Sheets Authentication
2.3 Create Logging Functions
Phase 3: Tutorial Modification for Data Collection
3.1 Add Student Information Collection
3.2 Integrate Submission Tracking
3.3 Add learnrhash Integration
Phase 4: Testing and Deployment
4.1 Local Testing
4.2 Prepare for Deployment
4.3 Deploy to Shinyapps.io
Phase 5: Student Access and Instructions
5.1 Create Student Instructions
5.2 Set Up Submission Collection
Phase 6: Launch and Monitoring
6.1 Soft Launch
6.2 Full Launch
Phase 7: Data Analysis and Grading
7.1 Collect and Analyze Submissions
7.2 Generate Grades
Phase 8: Maintenance and Improvements
8.1 Regular Maintenance
8.2 Continuous Improvement
Success Metrics
Quantitative Metrics
Qualitative Metrics
Timeline and Budget
Timeline (Small Classes)
Total Setup Time: 6-8 weeks
Ongoing Time: 2-3 hours per semester
Budget (Small Classes)
Total Annual Cost: $0-468 (mostly labor)
Troubleshooting Common Issues
Technical Issues
Content Issues
This streamlined approach is perfect for small classes, providing professional-grade interactive quizzes with minimal technical overhead and cost.