View source: R/update_teach_links.R
update_teach_links | R Documentation |
Searches lesson's google drive folder to populate the 'TeachMatLinks' tab of the lesson's 'meta/teach-it_.gsheet' file. Merges these detected file names and links with manually added "extLink" links to learning resources hosted elsewhere. 90% of this algorithm uses drive_ functions, so it's rather slow. It does save a state of files (see step 7 in details) using the virtualized path, though. This is used to skip updating if all files are up to date.
update_teach_links(
WD = "?",
rebuild = NULL,
rm_missing = TRUE,
clean = FALSE,
ignore = ".txt$"
)
WD |
a local virtualized path to a lesson folder where Google Drive (Web) path will be extracted from front matter. Easiest is to pass "?" which will invoke |
rebuild |
deprecated!! if T, rebuild everything; overrides checks of last modified times before updating links and teach-it.gsheet; default= NULL |
rm_missing |
logical; do you want to automatically remove records that are missing (and for which no link was found during crawl of Google Drive folder?); default= TRUE; if FALSE, the link will be left blank |
clean |
logical; do you want to ignore all info on the teach-it.gsheet and only import inferred info from crawled google drive project files? THIS WILL OVERWRITE MANUALLY ENTERED TITLES; default=FALSE |
ignore |
regex expression to remove certain filetypes (e.g. txt files); default= ".txt$" |
It's a hybrid lookup system that requires Google Drive for Desktop to be setup with permission to GP-Studio shared drive and a web connection. Steps:
Find WD working directory corresponding to the chosen lesson
Access the cloud version of the project folder by finding the 'GdriveDirID' in meta/front-matter.yml.
Search through web folders, compiling information from folder and naming structure in 'teaching-materials' folder.
Get Gdrive links for downloads, classroom- and remote- lessons, and assessments.
Merge results with manually entered titles and such in 'meta/teach-it.gsheet TeachMatLinks tab'
Save 'meta/teach-it.gsheet'
Save teach-it_state.RDS that stores info about the teaching-materials folder at the time of the last update. compile_lesson()
uses get_state()
to check if the current state is identical to the state at the time of the last update to skip this update_teach_links call.
Other Google Drive Functions:
drive_contents()
,
drive_copy_missing_files()
,
drive_cp_dir()
,
drive_find_path()
,
drive_get_info()
,
drive_inSync()
,
drive_new_from_template()
,
drive_open()
,
init_lesson_meta()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.