Skip to content

Quiz implementation TODO list #1

@larnsce

Description

@larnsce

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

  • Create RStudio/Posit account:
  • Review pricing and limits:
    • Free tier: 25 active hours/month, 5 apps
    • Starter ($9/month): 100 hours/month, 10 apps
    • Basic ($39/month): 500 hours/month, 25 apps
    • Choose appropriate plan for your class size

1.2 Google Account Setup

  • Create/use Google account for data collection:
    • Use institutional Google account if available
    • Or create dedicated account (e.g., ds4owd.quiz@gmail.com)
    • Enable 2-factor authentication for security
  • Set up Google Sheets API access:
    • Go to Google Cloud Console (console.cloud.google.com)
    • Create new project or use existing
    • Enable Google Sheets API
    • Create service account and download JSON key
    • Share Google Sheets with service account email

1.3 R Environment Setup

  • Install required R packages:
    install.packages(c(
      "rsconnect",      # For deploying to shinyapps.io
      "learnr",         # Interactive tutorials
      "gradethis",      # Exercise checking
      "googlesheets4",  # Google Sheets integration
      "learnrhash",     # Submission hashing
      "tidyverse",      # Data manipulation
      "gapminder",      # Sample data
      "gt",             # Tables
      "shiny",          # Web framework
      "DT"              # Interactive tables
    ))
  • Configure rsconnect:
    # Get tokens from shinyapps.io account
    rsconnect::setAccountInfo(
      name = "your-account-name",
      token = "your-token", 
      secret = "your-secret"
    )

Phase 2: Google Sheets Data Collection Setup

2.1 Create Data Collection Spreadsheet

  • Create main submissions spreadsheet:
    • Create new Google Sheet named "DS4OWD Module 1 Submissions"
    • Set up columns: timestamp, student_name, student_email, exercise_id,
      correct, code_submitted, attempt_number, session_id
    • Format timestamp column as datetime
    • Share with service account email (view + edit permissions)
  • Create student roster sheet (optional):
    • Add tab for enrolled students
    • Columns: student_name, student_email, student_id, enrolled_date
    • Import class roster if available

2.2 Configure Google Sheets Authentication

  • Set up authentication in tutorial:
    # 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 sheet
    sheet_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 URL
      sheet_id <- "your-google-sheet-id-here"
      
      # Create log entry
      log_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 attempts
        if(!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 checked
            code_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 functionality
    rmarkdown::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
  • Create deployment script:
    # deploy.R
    library(rsconnect)
    
    # Deploy the tutorial
    rsconnect::deployApp(
      appDir = ".",
      appFiles = c("md-01-quiz.Rmd", ".secrets/"),
      appName = "ds4owd-module1-quiz",
      account = "your-account-name",
      forceUpdate = TRUE
    )

4.3 Deploy to Shinyapps.io

  • Deploy tutorial:
    # Run deployment script
    source("deploy.R")
  • Test deployed version:
    • Visit deployed URL
    • Complete full tutorial as test student
    • Verify submissions appear in Google Sheets
    • Test on different browsers/devices
    • Check mobile responsiveness

Phase 5: Student Access and Instructions

5.1 Create Student Instructions

  • Write clear instructions for students:
    # Module 1 Interactive Quiz Instructions
    
    ## Before You Begin
    1. 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 Quiz
    1. 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 exercise
    completion_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 progress
    student_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
      )

7.2 Generate Grades

  • Create grading rubric:
    • MCQ questions: 1 point each (10 total)
    • Coding exercises: 1 point each (5 total)
    • Total: 15 points possible
    • Consider partial credit for coding exercises
  • Calculate final grades:
    # Generate gradebook export
    gradebook <- student_progress %>%
      mutate(
        points_earned = total_correct,
        points_possible = 15,
        percentage = (points_earned / points_possible) * 100,
        letter_grade = case_when(
          percentage >= 90 ~ "A",
          percentage >= 80 ~ "B", 
          percentage >= 70 ~ "C",
          percentage >= 60 ~ "D",
          TRUE ~ "F"
        )
      )
    
    # Export for LMS
    write_csv(gradebook, "module1_grades.csv")

Phase 8: Maintenance and Improvements

8.1 Regular Maintenance

  • Weekly tasks:
    • Check shinyapps.io usage (avoid hitting limits)
    • Monitor Google Sheets for issues
    • Backup submission data locally
    • Review student feedback/questions
  • After each semester:
    • Archive old submission data
    • Update tutorial content based on feedback
    • Review and improve questions
    • Update package versions

8.2 Continuous Improvement

  • Collect student feedback:
    • Add feedback form to end of tutorial
    • Analyze common error patterns
    • Improve hints and explanations
    • Add more practice exercises if needed
  • Instructor feedback:
    • Track time spent on grading
    • Note common student issues
    • Document lessons learned

Success Metrics

Quantitative Metrics

  • Completion rates:
    • Target: >85% of enrolled students complete quiz
    • >90% of students who start complete all sections
  • Technical performance:
    • <5 seconds initial load time
    • <1% technical failure rate
    • 100% data capture rate
  • Academic performance:
    • Average score >75%
    • <10% students need to retake

Qualitative Metrics

  • Student satisfaction:
    • Easy to use interface
    • Clear instructions
    • Helpful feedback on exercises
  • Instructor efficiency:
    • Automated grading saves time
    • Easy to monitor student progress
    • Clear analytics for improvement

Timeline and Budget

Timeline (Small Classes)

  • Phase 1: 1 week (Account setup)
  • Phase 2: 1 week (Google Sheets setup)
  • Phase 3: 1-2 weeks (Tutorial modification)
  • Phase 4: 1 week (Testing and deployment)
  • Phase 5: 1 week (Student instructions)
  • Phase 6: 1 week (Launch and monitoring)
  • Phase 7: 1 week (Grading)
  • Phase 8: Ongoing

Total Setup Time: 6-8 weeks
Ongoing Time: 2-3 hours per semester

Budget (Small Classes)

  • Shinyapps.io: $0-39/month depending on usage
  • Google Workspace: $0 (free tier sufficient)
  • Domain: $0 (using shinyapps.io subdomain)
  • Development time: 20-30 hours initial setup
  • Maintenance: 2-3 hours per semester

Total Annual Cost: $0-468 (mostly labor)


Troubleshooting Common Issues

Technical Issues

  • Tutorial won't load:
    • Check shinyapps.io status page
    • Verify package versions are compatible
    • Check deployment logs
  • Google Sheets not updating:
    • Verify authentication is working
    • Check API quotas not exceeded
    • Ensure sheet permissions are correct
  • Students can't access:
    • Check URL is correct
    • Verify app is deployed and active
    • Test on different browsers

Content Issues

  • Exercises not working:
    • Check gradethis syntax
    • Verify solution code is correct
    • Test locally before deployment
  • Hints not helpful:
    • Add progressive hints
    • Include common error explanations
    • Link to relevant documentation

This streamlined approach is perfect for small classes, providing professional-grade interactive quizzes with minimal technical overhead and cost.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions