AnswerSingleChoice.Controller.js 407 Bytes
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13
'use strict'

angular.module('EXAM').controller('AnswerSingleChoice', ['$scope', '$http', function($scope, $http){
  $scope.question = new Question()
  
  $scope.addSingleChoice = function(obj){
    $scope.question.addSingleChoice(obj, Math.max.apply(Math, obj.map(function(result){ return result.id })))
  }

  $scope.deleteArray = function(obj, index){
    $scope.question.deleteArray(obj, index)
  }
}])