mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-12 08:38:10 +00:00
ENH: Converted any string values for method to corresponding QuestHandler.Method values
This commit is contained in:
parent
fd0030a8b1
commit
cbf475723a
@ -88,6 +88,28 @@ export class QuestHandler extends TrialHandler
|
|||||||
this._estimateQuestValue();
|
this._estimateQuestValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for the method attribute.
|
||||||
|
*
|
||||||
|
* @param {mixed} method - the method value, PsychoPy-style values ("mean", "median",
|
||||||
|
* "quantile") are converted to their respective QuestHandler.Method values
|
||||||
|
* @param {boolean} log - whether or not to log the change of seed
|
||||||
|
*/
|
||||||
|
setMethod(method, log)
|
||||||
|
{
|
||||||
|
let methodMapping = {
|
||||||
|
"quantile": QuestHandler.Method.QUANTILE,
|
||||||
|
"mean": QuestHandler.Method.MEAN,
|
||||||
|
"mode": QuestHandler.Method.MODE
|
||||||
|
};
|
||||||
|
// If method is a key in methodMapping, convert method to corresponding value
|
||||||
|
if (methodMapping.hasOwnProperty(method))
|
||||||
|
{
|
||||||
|
method = methodMapping[method];
|
||||||
|
}
|
||||||
|
this._setAttribute("method", method, log);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a response and update the PDF.
|
* Add a response and update the PDF.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user