PreviewExam.Controller.js 808 Bytes
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
'use strict'

angular.module('EXAM').controller('PreviewExam', ['$scope', '$http', '$sce', '$filter', 'GETLANG', function($scope, $http, $sce, $filter, GETLANG){
  // console.log($('input[name="exam"]').val())
  // $scope.exam = JSON.parse($('input[name="exam"]').val())
  $scope.exam = {}
  $scope.lang = getLang()

  $scope.swlang = GETLANG

  $scope.getPathAudio = function(audname){
    return 'UPLOAD/AUDIO/'+audname
  }

  $scope.getPathVideo = function(videourl){
    return $sce.trustAsResourceUrl(videourl)
  }

  $scope.setExam = function(obj){
    console.log(obj)
    $scope.exam = obj
  }
}])
.directive('question', function(){
  return {
    restrict: 'E',
    scope: {
      obj: '=obj',
      level: '=level'
    },
    controller: 'Question',
    templateUrl: 'preview.question.html'
  }
})