'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'
  }
})