Created
June 23, 2016 19:42
-
-
Save chepe263/ba5c6af6b18a7f5eb746aa6017f6b856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
xModalidad = "1"; | |
</script> | |
<script src="<%=ResolveUrl("asset/main.js") %>"></script> | |
<link rel="Stylesheet" href="<%=ResolveUrl("asset/main.css") %>" /> | |
<div id="clockContainer"> | |
<i class="fa fa-clock-o"></i> <span id="lblSegundos"></span> | |
</div> | |
<div ng-app="app" > | |
<div id="tTablero" class="moda-<%=Me.Modalidad %>" ng-controller="mainController"> | |
<span class="el digit"> | |
{{ num1 }} | |
</span> | |
<span class="el symbol"> | |
{{ sign1 }} | |
</span> | |
<span class="el digit"> | |
{{ num2 }} | |
</span> | |
<span class="el symbol"> | |
{{ sign2 }} | |
</span> | |
<span class="el digit"> | |
{{ num3 }} | |
</span> | |
<span class="el symbol"> | |
{{ sign3 }} | |
</span> | |
<span class="el digit"> | |
{{ num4 }} | |
</span> | |
<span> | |
= | |
</span> | |
<span class="el digit"> | |
{{ result }} | |
</span> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular | |
.module('app', []) | |
.controller('mainController', ['$scope', '$window', function ($scope, $window) { | |
$scope.minNumber = 2; | |
$scope.maxNumber = 9; | |
$scope.num1 = 1; | |
$scope.num2 = 1; | |
$scope.num3 = 1; | |
$scope.num4 = 1; | |
$scope.sign1 = ''; | |
$scope.sign2 = ''; | |
$scope.sign3 = ''; | |
$scope.signs = ['', '+', '-', '*', '/']; | |
$scope.wholeQuestion = ''; | |
$scope.result = ''; | |
if ($window.xModalidad == 'MtOperadorCorrecto1') { | |
$scope.signs = ['', '+', '-']; | |
} | |
if ($window.xModalidad == 'MtOperadorCorrecto2') { | |
$scope.signs = ['', '*', '/']; | |
} | |
$scope.buildQuestion = function () { | |
$scope.num1 = ConsolaUtilidad.funciones.numeroAleatorio($scope.minNumber, $scope.maxNumber); | |
$scope.num2 = ConsolaUtilidad.funciones.numeroAleatorio($scope.minNumber, $scope.maxNumber); | |
$scope.num3 = ConsolaUtilidad.funciones.numeroAleatorio($scope.minNumber, $scope.maxNumber); | |
$scope.num4 = ConsolaUtilidad.funciones.numeroAleatorio($scope.minNumber, $scope.maxNumber); | |
ConsolaUtilidad.funciones.desordenar2($scope.signs); | |
$scope.sign1 = $scope.signs[0]; | |
ConsolaUtilidad.funciones.desordenar2($scope.signs); | |
$scope.sign2 = $scope.signs[1]; | |
ConsolaUtilidad.funciones.desordenar2($scope.signs); | |
$scope.sign3 = $scope.signs[0]; | |
$scope.wholeQuestion = $scope.num1 + $scope.sign1 + $scope.num2 + $scope.sign2 + $scope.num3 + $scope.sign3 + $scope.num4; | |
$scope.result = eval($scope.wholeQuestion); | |
} | |
$scope.buildQuestion(); | |
}]);//endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment