To install and load the package use:
remotes::install_github("saramortara/tRiviascoRe") library(tRiviascoRe)
devtools::load_all()
library(tidyr) library(dplyr) library(readr) library(gsheet)
A Google form with multiple choice questions. All questions must have unique names
A reference data frame with two or three columns: question_name
, correct_answer
and round
(optional)
The answers from the google form
ref_url <- "https://docs.google.com/spreadsheets/d/1uCPz4XFWUGd20-fVgXjIo59eWp31AREzTlXCuEN8Vn0/edit#gid=0" ref <- read_csv(construct_download_url(ref_url)) # Score points vector score <- c(2, 3, 5, 10)
url1 <- "https://docs.google.com/spreadsheets/d/1JqthtHHCFat1NdUUzM-9kyS-Vi789GFHywPu0eJ_5UE/edit#gid=1753062260" r1 <- read_csv(construct_download_url(url1)) res1 <- score_trivia(r1, n_round = 1, score = score[1], ref) res1
url2 <- "https://docs.google.com/spreadsheets/d/1H3V2DpZHbtY-TtOmyTVLWJXUEiPgMVdDisJGTQ2deB4/edit#gid=464947112" r2 <- read_csv(construct_download_url(url2)) res2 <- score_trivia(r2, n_round = 2, score = score[2], ref) res2
url3 <- "https://docs.google.com/spreadsheets/d/1blvK5r3WGHQbatNeqFt3H0nIVXPXYpaS_CYY6IiMRsU/edit?usp=sharing" r3 <- read_csv(construct_download_url(url3)) res3 <- score_trivia(r3, n_round = 3, score = score[3], ref) res3
url4 <- "https://docs.google.com/spreadsheets/d/1FavTAbTzBqDXnBJTIjeKMY8bhLzUF8Kx9NSIgMczCuI/edit?usp=sharing" r4 <- read_csv(construct_download_url(url4)) res4 <- score_trivia(r4, n_round = 4, score = score[4], ref) res4
score_list <- list(res1, res2, res3, res4) res <- bind_rows(score_list) rank_teams(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.