Skip to content

Tool to monitor Google Form responses collected in a Google Sheet

Notifications You must be signed in to change notification settings

Sage-Bionetworks-Challenges/BraTs-Validate-Users

 
 

Repository files navigation

BraTs-Validate-Users

A tool that monitors Google Form responses collected in a Google Sheet. It will look for new submissions at a set cadence (default, 5 minutes), and will check the following:

  • Does the provided Synapse username exist?
  • Is the user registered for the challenge?

Note

Not currently super user-friendly for non-R users.

Getting Started

  • Clone the repo

    git clone https://github.com/Sage-Bionetworks-Challenges/BraTs-Validate-Users.git
  • Install Miniconda

    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh
    rm Miniconda3-latest-Linux-x86_64.sh

    Restart the terminal to apply the changes.

  • Initiate a Conda environment

    conda env create -f environment.yml
    conda activate brats-tool
  • Install the required libraries

    Rscript requirements.R
  • Set up your configurations for the user validation. Update config_example.R and save as config.R. After updating, set the file to read-only.

    cp config_example.R config.R
    vim config.R
    chmod 400 config.R

Usage

Important

When running for the first time, use Rstudio (or other interactive IDEs) to initiate google authentication in order to access to the Google Form. The googlesheet4 package is used to read Google Sheet, (TODO: change to use service_credential.json).

  1. Open the setup.R file in the Rstudio
  2. Press Control/Command + A to select entire script
  3. Press Control/Command + enter to run all the codes
  4. Press 1 in the console when it asks for permission to pop up browser window. Please sign in your google account which has access to the google sheet and complete the authentication.

Note

If you get an error similar to:

Error in normalizePath(conda, winslash = "/", mustWork = TRUE) :
   path[1]=".../bin/conda env": No such file or directory

Try downgrading your version of reticulate to 1.24:

require(devtools)
install_version("reticulate", version = "1.24")

If not the first time, run the following code to test if the setup works. If so, run the last command.

Rscript setup.R

Start monitoring new submissions from the google form

Rscript runMonitor.R

About

Tool to monitor Google Form responses collected in a Google Sheet

Resources

Stars

Watchers

Forks

Languages

  • R 100.0%