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.
@@ -45,7 +45,8 @@ function attempts() {
45
45
  getUserAttemptStatsForActivity: getUserAttemptStatsForActivity.bind(this),
46
46
  getUserAttemptForActivity: getUserAttemptForActivity.bind(this),
47
47
  getUserFirstAttemptForActivity: getUserFirstAttemptForActivity.bind(this),
48
- getUserLastAttemptForActivity: getUserLastAttemptForActivity.bind(this)
48
+ getUserLastAttemptForActivity: getUserLastAttemptForActivity.bind(this),
49
+ updateUserAttemptForActivity: updateUserAttemptForActivity.bind(this)
49
50
  };
50
51
  }
51
52
 
@@ -114,7 +115,8 @@ function getUserAllAttemptsForActivity(options) {
114
115
  "assignmentid": "string",
115
116
  "itemcode":"string",
116
117
  "productcode": "string",
117
- "max_allowed":"string"
118
+ "max_allowed":"string",
119
+ "status": "string"
118
120
  }
119
121
  }
120
122
  */
@@ -340,3 +342,51 @@ function getUserLastAttemptForActivity(options) {
340
342
  }
341
343
  return dfd.promise;
342
344
  }
345
+
346
+ /*
347
+ options = {
348
+ userid: 'string', //mandatory
349
+ activityid: 'string', //mandatory
350
+ attemptid: 'string', //mandatory
351
+ body: { //mandatory
352
+ status: 'string'
353
+ }
354
+ }
355
+ */
356
+ function updateUserAttemptForActivity(options) {
357
+ var self = this;
358
+ var dfd = q.defer();
359
+ var err;
360
+
361
+ if(options && options.userid && options.activityid && options.attemptid && options.body) {
362
+ //Passed all validations, Construct API url
363
+ var url = self.config.DEFAULT_HOSTS.ATTEMPTS + self.config.ATTEMPTS_API_URLS.getUserAttemptForActivity;
364
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, userId: options.userid, activityId: options.activityid,
365
+ attemptId: options.attemptid });
366
+
367
+ var params = options.body;
368
+ //Setup request with URL and Params
369
+ var requestAPI = request.put(url)
370
+ .set('Content-Type', 'application/json')
371
+ .set('Accept', 'application/json')
372
+ .send(params);
373
+
374
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
375
+
376
+ requestAPI.end(function (err, response) {
377
+ if (err) {
378
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
379
+ dfd.reject(err);
380
+ }
381
+ else { dfd.resolve(response.body); }
382
+ });
383
+ }
384
+ else {
385
+ err = {};
386
+ err.message = err.description = 'Mandatory params - userid or activityid or attemptid or body ' +
387
+ 'not found in request options.';
388
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
389
+ dfd.reject(err);
390
+ }
391
+ return dfd.promise;
392
+ }
@@ -342,7 +342,8 @@ function joinInstituteSpace(options) {
342
342
  startdate: 'string',
343
343
  enddate: 'string',
344
344
  ...
345
- }
345
+ },
346
+ ext_data: {}
346
347
  }]
347
348
  }*/
348
349
  function provisionSpacesToStudent(options) {
@@ -574,6 +575,7 @@ function shadowProvision(options) {
574
575
  enddate: 'string',
575
576
  ...
576
577
  },
578
+ ext_data: {},
577
579
  audit: boolean
578
580
  }*/
579
581
  function entitleUserToProduct(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "comprodls-sdk",
3
3
  "description": "comproDLS SDK for JavaScript",
4
- "version": "2.44.0",
4
+ "version": "2.45.0",
5
5
  "author": {
6
6
  "name": "Compro Technologies Private Limited",
7
7
  "url": "http://www.comprotechnologies.com/"