Skip to content

Commit 3b28012

Browse files
committed
Merge branch 'master' into kata_list
2 parents d212568 + fa20a31 commit 3b28012

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/mainService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ angular.module('app').service('mainService', function($http, $q, $sce) {
88
// this.user = {id: 4, github_id: "20197415", name: "Steven", email: null, picture_url: "https://avatars.githubusercontent.com/u/20197415?v=3", username: "Steven-Nagie"};
99
this.user = {};
1010

11+
//this.currentKataId = {}
12+
1113
// POST
1214
this.testExamples = (solution, examples) => {
1315
return $http({
@@ -30,7 +32,7 @@ angular.module('app').service('mainService', function($http, $q, $sce) {
3032
});
3133
};
3234

33-
this.setSolution = (solution, kataid) => {
35+
this.submitAnswer = (solution, kataid, userid) => {
3436
return $http({
3537
method: 'POST',
3638
url: `/api/solution/` + kataid,

src/components/training/trainingCtrl.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ angular.module('app').controller('trainingCtrl', function($scope, $state, mainSe
8181
// mainService.testSuite(solutions, $scope.kataid).then((response) => console.log(response));
8282
}
8383

84-
// this function needs to call the kata by id when the user selects train on the home page -getKataById
85-
86-
87-
// submit final solution once they have passed the testSuite using setSoluton funciton on the service
88-
84+
$scope.submitAnswer = (solution, kataid, userid) => {
85+
mainService.submitAnswer(solution, kataid, userid);
86+
}
8987

9088
});

0 commit comments

Comments
 (0)