comprodls-sdk 2.44.0 → 2.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3869,7 +3869,8 @@ function attempts() {
3869
3869
  getUserAttemptStatsForActivity: getUserAttemptStatsForActivity.bind(this),
3870
3870
  getUserAttemptForActivity: getUserAttemptForActivity.bind(this),
3871
3871
  getUserFirstAttemptForActivity: getUserFirstAttemptForActivity.bind(this),
3872
- getUserLastAttemptForActivity: getUserLastAttemptForActivity.bind(this)
3872
+ getUserLastAttemptForActivity: getUserLastAttemptForActivity.bind(this),
3873
+ updateUserAttemptForActivity: updateUserAttemptForActivity.bind(this)
3873
3874
  };
3874
3875
  }
3875
3876
 
@@ -3938,7 +3939,8 @@ function getUserAllAttemptsForActivity(options) {
3938
3939
  "assignmentid": "string",
3939
3940
  "itemcode":"string",
3940
3941
  "productcode": "string",
3941
- "max_allowed":"string"
3942
+ "max_allowed":"string",
3943
+ "status": "string"
3942
3944
  }
3943
3945
  }
3944
3946
  */
@@ -4164,6 +4166,54 @@ function getUserLastAttemptForActivity(options) {
4164
4166
  }
4165
4167
  return dfd.promise;
4166
4168
  }
4169
+
4170
+ /*
4171
+ options = {
4172
+ userid: 'string', //mandatory
4173
+ activityid: 'string', //mandatory
4174
+ attemptid: 'string', //mandatory
4175
+ body: { //mandatory
4176
+ status: 'string'
4177
+ }
4178
+ }
4179
+ */
4180
+ function updateUserAttemptForActivity(options) {
4181
+ var self = this;
4182
+ var dfd = q.defer();
4183
+ var err;
4184
+
4185
+ if(options && options.userid && options.activityid && options.attemptid && options.body) {
4186
+ //Passed all validations, Construct API url
4187
+ var url = self.config.DEFAULT_HOSTS.ATTEMPTS + self.config.ATTEMPTS_API_URLS.getUserAttemptForActivity;
4188
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, userId: options.userid, activityId: options.activityid,
4189
+ attemptId: options.attemptid });
4190
+
4191
+ var params = options.body;
4192
+ //Setup request with URL and Params
4193
+ var requestAPI = request.put(url)
4194
+ .set('Content-Type', 'application/json')
4195
+ .set('Accept', 'application/json')
4196
+ .send(params);
4197
+
4198
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
4199
+
4200
+ requestAPI.end(function (err, response) {
4201
+ if (err) {
4202
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
4203
+ dfd.reject(err);
4204
+ }
4205
+ else { dfd.resolve(response.body); }
4206
+ });
4207
+ }
4208
+ else {
4209
+ err = {};
4210
+ err.message = err.description = 'Mandatory params - userid or activityid or attemptid or body ' +
4211
+ 'not found in request options.';
4212
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
4213
+ dfd.reject(err);
4214
+ }
4215
+ return dfd.promise;
4216
+ }
4167
4217
 
4168
4218
  },{"../../helpers":3,"q":58,"superagent":88}],16:[function(require,module,exports){
4169
4219
  /*************************************************************************
@@ -13394,7 +13444,8 @@ function joinInstituteSpace(options) {
13394
13444
  startdate: 'string',
13395
13445
  enddate: 'string',
13396
13446
  ...
13397
- }
13447
+ },
13448
+ ext_data: {}
13398
13449
  }]
13399
13450
  }*/
13400
13451
  function provisionSpacesToStudent(options) {
@@ -13626,6 +13677,7 @@ function shadowProvision(options) {
13626
13677
  enddate: 'string',
13627
13678
  ...
13628
13679
  },
13680
+ ext_data: {},
13629
13681
  audit: boolean
13630
13682
  }*/
13631
13683
  function entitleUserToProduct(options) {