Designing logic for updating and handling new/old variables

This commit is contained in:
vzhang03 2024-06-07 17:09:15 -04:00
parent 75241514b7
commit b08ca36107
2 changed files with 21 additions and 0 deletions

View File

@ -245,6 +245,16 @@ export class VariablesMap {
}
}
checkDescription(field_name, var_name, updated_var): boolean {
if (field_name === "description") {
// check if description is a dict or a string
// if it is a string check if it's equal, if it isn't return true
// if it is a dict then let it pass
}
return false;
}
/**
* Allows you to delete a variable by key/name. Returns console error if not found.
*

View File

@ -281,6 +281,9 @@ export default class JsPsychMetadata {
console.log("does not contain var: " + variable + " of type plugin: " + pluginType);
const type = typeof value;
// should check type in order to see if need to see with levels -- if numeric type is not it
// do need to update levels? -- write in levels logic ot the VariablesMap
const new_var = {
type: "PropertyValue",
name: variable,
@ -293,5 +296,13 @@ export default class JsPsychMetadata {
private generateUpdate(variable, pluginType) {
console.log("contains var: " + variable, " of type plugin: " + pluginType);
// fill in with logic on how to update the plugin -- will need to think about levels
// need to call the other UPDATEVARIABLE logic -- where if it is just a description can probably add it to the thing
// how to check levels
}
private getPluginInfo(pluginType) {
// fill in with logic on how to call plugin api and unpkg
}
}