Commit fa9a03ff82c0a4e8dc89d6b865b3331fbb168ff1
1 parent
a567ba42
ui
Showing
2 changed files
with
11 additions
and
42 deletions
400-SOURCECODE/AIAHTML5.API/Controllers/LabExercises.cs deleted
1 | -using System; | ||
2 | -using System.Collections.Generic; | ||
3 | -using System.Linq; | ||
4 | -using System.Web; | ||
5 | -using System; | ||
6 | -using System.Threading.Tasks; | ||
7 | -using MongoDB.Bson; | ||
8 | -using MongoDB.Driver; | ||
9 | -using AIAHTML5.API.Properties; | ||
10 | -using MongoDB.Driver.Builders; | ||
11 | - | ||
12 | -namespace AIAHTML5.API.Models | ||
13 | -{ | ||
14 | - public class LabExercises | ||
15 | - { | ||
16 | - public int Attemptnumber { get; set; } | ||
17 | - public string labExerciseCode { get; set; } | ||
18 | - public string Answer { get; set; } | ||
19 | - public int Question { get; set; } | ||
20 | - public int Score { get; set; } | ||
21 | - | ||
22 | - | ||
23 | - public void UpdateUserLabExercise(Users objUser) | ||
24 | - { | ||
25 | - var client = new MongoClient(); | ||
26 | - var db = client.GetDatabase(Settings.Default.database); | ||
27 | - | ||
28 | - var collection = db.GetCollection<BsonDocument>("Users"); | ||
29 | - | ||
30 | - collection.UpdateOne( | ||
31 | - Builders<BsonDocument>.Filter.Eq("loginId", objUser.loginId), | ||
32 | - Builders<BsonDocument>.Update.Set("LabExerciseAttempt", objUser.labExerciseAttempt)); | ||
33 | - | ||
34 | - | ||
35 | - } | ||
36 | - } | ||
37 | -} | ||
38 | \ No newline at end of file | 0 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
@@ -399,12 +399,18 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location | @@ -399,12 +399,18 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location | ||
399 | LabExerciseService.saveLabExerciseAttempt($scope.labExerciseAttempt) | 399 | LabExerciseService.saveLabExerciseAttempt($scope.labExerciseAttempt) |
400 | .then( | 400 | .then( |
401 | function (result) { | 401 | function (result) { |
402 | - alert("Successfully updated"); | 402 | + //saved successfully. |
403 | + $rootScope.errorMessage = result; | ||
404 | + $("#messageModal").modal('show'); | ||
403 | }, | 405 | }, |
404 | - function (error) { | ||
405 | - console.log(' Error in authentication = ' + error.statusText); | ||
406 | - alert("Error"); | ||
407 | - }); | 406 | + function (error) { |
407 | + console.log(' Error in saving lab exercise = ' + error.statusText); | ||
408 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | ||
409 | + $rootScope.isVisibleLogin = true; | ||
410 | + $rootScope.errorMessage = error; | ||
411 | + $("#messageModal").modal('show'); | ||
412 | + } | ||
413 | + ) | ||
408 | }; | 414 | }; |
409 | 415 | ||
410 | 416 |