From eb22b94969f64dfd69cf92827cb2d11a75a15d2b Mon Sep 17 00:00:00 2001 From: Becky Gilbert Date: Mon, 6 May 2024 13:54:41 -0700 Subject: [PATCH] minor edits to JSdoc comments --- packages/data/src/api.ts | 24 ++++++++++++------------ packages/data/src/index.ts | 2 +- packages/lookit-initjspsych/src/index.ts | 2 +- packages/surveys/src/consent.ts | 4 ++-- packages/surveys/src/exit.ts | 4 ++-- packages/surveys/src/utils.ts | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/data/src/api.ts b/packages/data/src/api.ts index a5a84957..42a944a3 100644 --- a/packages/data/src/api.ts +++ b/packages/data/src/api.ts @@ -13,7 +13,7 @@ const CONFIG = { ...getUuids() }; const promises: ApiPromise[] = []; /** - * Collect all API calls into an array to be checked with finish(). + * Collect all API call promises into an array to be checked with finish(). * * @param promise - Promise generated by API calls. * @returns Provided promise. @@ -26,56 +26,56 @@ const deposit = (promise: T) => { /** * Checks to see if all API calls have completed. * - * @returns A Promise, when completed, confirms all API calls have completed. + * @returns A Promise that, if/when resolved, confirms that all API calls have completed. */ export const finish = () => { return Promise.all(promises); }; /** - * Gets Child. + * Gets the Child object for this study session from the lookit-api. * - * @returns API Promise containing Child. + * @returns API Promise containing the Child object. */ export const retrieveChild = () => { return deposit(get(`children/${CONFIG.child}/`)); }; /** - * Get a list of past Sessions for this Study and Child. + * Gets a list of all past Session (response) objects for this Study and Child from the lookit-api. * * @param uuid - Current Response UUID. - * @returns Promise containing list of Past Sessions. + * @returns Promise containing list of all Past Session objects. */ export const retrievePastSessions = (uuid: string) => { return deposit(get(`past-sessions/${uuid}/`)); }; /** - * Gets Study. + * Gets the Study object from the lookit-api. * - * @returns API Promise containing Study. + * @returns API Promise containing the Study object. */ export const retrieveStudy = () => { return deposit(get(`studies/${CONFIG.study}/`)); }; /** - * Gets Response (or Session) of the provided UUID. + * Gets Response (Session) for the provided response UUID. * * @param uuid - Response UUID. - * @returns Promise containing Response. + * @returns Promise containing the Response object. */ export const retrieveResponse = (uuid: string) => { return deposit(get(`responses/${uuid}/`)); }; /** - * Update Response. + * Updates an existing Response object in the lookit-api. * * @param uuid - Response UUID. * @param data - Object containing fields to be updated. - * @returns Promise containing updated Response. + * @returns Promise containing the updated Response object. */ export const updateResponse = (uuid: string, data: ResponseAttrsUpdate) => { return deposit( diff --git a/packages/data/src/index.ts b/packages/data/src/index.ts index 1f041648..1a14d47b 100644 --- a/packages/data/src/index.ts +++ b/packages/data/src/index.ts @@ -22,7 +22,7 @@ declare global { } /** - * Load data from API that would be used by researchers and jsPsych. + * Load data from API that is needed for saving the experiment data, and that might be needed by researchers and jsPsych. * * @param response_uuid - Response UUID. */ diff --git a/packages/lookit-initjspsych/src/index.ts b/packages/lookit-initjspsych/src/index.ts index e10059d8..9188044c 100644 --- a/packages/lookit-initjspsych/src/index.ts +++ b/packages/lookit-initjspsych/src/index.ts @@ -18,7 +18,7 @@ const lookitInitJsPsych = (responseUuid: string) => { const origJsPsychRun = jsPsych.run; /** - * Overriding default jsPsych run function. With will allow us to + * Overriding default jsPsych run function. This will allow us to * check/alter the timeline before running an experiment. * * @param timeline - List of jsPsych trials. diff --git a/packages/surveys/src/consent.ts b/packages/surveys/src/consent.ts index 350ea9eb..6ccbf9aa 100644 --- a/packages/surveys/src/consent.ts +++ b/packages/surveys/src/consent.ts @@ -13,8 +13,8 @@ type Trial = TrialType; export class ConsentSurveyPlugin extends SurveyPlugin { public static readonly info = info; /** - * Used custom consent survey function adds functionality before runing user's - * survey function. + * Custom consent survey function adds functionality before creating a + * survey based on the user-defined survey JSON/function. * * @param display_element - Trial display element. * @param trial - Info parameters. diff --git a/packages/surveys/src/exit.ts b/packages/surveys/src/exit.ts index 934dde0b..ebdd181d 100644 --- a/packages/surveys/src/exit.ts +++ b/packages/surveys/src/exit.ts @@ -49,7 +49,7 @@ const showDatabraryOptions = (trial: Trial) => { }; /** - * Include paranthetical example in withdrawl language. + * Include parenthetical example in withdrawal language. * * @param trial - Info parameters. */ @@ -113,7 +113,7 @@ const privateLevelOnly = (trial: Trial) => { * Process all survey parameter functions. * * @param trial - Info parameters. - * @returns Survey JSON string. + * @returns Survey JSON. */ const surveyParameters = (trial: Trial) => { [ diff --git a/packages/surveys/src/utils.ts b/packages/surveys/src/utils.ts index bb7dbf6c..b4360829 100644 --- a/packages/surveys/src/utils.ts +++ b/packages/surveys/src/utils.ts @@ -49,8 +49,8 @@ export const exitSurveyFunction = (survey: Model) => { /** * Survey function used by Consent Survey. Adds markdown support through - * "textMarkdownSurveyFunction". On complete. This will mark in the Response - * that consent survey has been completed. + * "textMarkdownSurveyFunction". On complete, this will mark in the Response + * that consent was completed, and that the consent was through a survey (rather than video). * * @param userfn - Survey function provided by user. * @returns Survey model.