Functions in Hype xAPI
HypeXAPI
HypeXAPI.sendStatementByDictonary
2min
this function sends a statement based on a configuration object the object must at least contain a verb and object, but can also contain an agent, result, context, parent activity, grouping activity, and context activity this function will resolve all the keys in the config object and send the statement to use this function, you must first create a config object and populate it with the necessary values the config object must at least contain a verb and object you can also optionally include an agent, result, context, parent activity, grouping activity, and context activity once the config object has been populated, you can call the function and pass it the config object the function will resolve all the keys in the object and send the statement the function will search for keys in the lookup, and resolve them if they are found if not, the function will check if the variables necessary to create an actor have been provided if they have, the function will create an xapi actor object if not, the function will use the default actor the function will then check if an xapi statement has already been created if it has, the function will send the statement if not, the function will check if the necessary values to build an xapi statement have been provided if they have, the function will construct and send the statement if not, the function will return an error the config object can contain the following keys object key description element this is the element that will be used to get the xapi config from the attributes agent this is the agent that will be used in the statement verb this is the verb that will be used in the statement result this is the object that will be used in the statement context this is the context that will be used in the statement parent activity this is the parent activity that will be used in the statement grouping activity this is the grouping activity that will be used in the statement context activity this is the context activity that will be used in the statement verb id this is the verb id that will be used in the statement verb name this is the verb name that will be used in the statement object id this is the object id that will be used in the statement object name this is the object name that will be used in the statement object desc this is the object description that will be used in the statement debug this is a flag to indicate if the statement should be sent in debug mode