MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / updateScore

Function updateScore

lib/ltiOutcomes.js:48–64  ·  view source on GitHub ↗
(ai_id, client, callback)

Source from the content-addressed store, hash-verified

46 * @param {function} callback - A callback(err) function.
47 */
48var updateScore = function(ai_id, client, callback) {
49 if (ai_id == null) return callback(null);
50
51 if (client == null) {
52 sqldb.getClient(function(err, client, done) {
53 if (ERR(err, callback)) return;
54 _updateScoreWithClient(ai_id, client, function(err) {
55 // Might not be enough error catching?
56 if (ERR(err, callback)) return;
57 done(null);
58 callback(null);
59 });
60 });
61 } else {
62 _updateScoreWithClient(ai_id, client, callback);
63 }
64};
65
66/**
67 * Internal function helper for updateScore, assumes sql-db client.

Callers 1

ltiOutcomes.jsFile · 0.85

Calls 3

callbackFunction · 0.85
_updateScoreWithClientFunction · 0.85
doneFunction · 0.50

Tested by

no test coverage detected