Create M.A.S.A Version 1.0

This commit is contained in:
Reynaldo Reyes
2016-04-11 00:05:59 -04:30
parent 7fff896e43
commit 1ee3577fe4
60 changed files with 1673 additions and 2137 deletions

View File

@@ -0,0 +1,49 @@
(function(){
'use strict';
angular
.module('app.reports')
.controller('StudentReportCtrl', StudentReportCtrl)
StudentReportCtrl.$inject =
['$scope', '$rootScope', '$state', 'professors', '$modal', 'selectedCourse', 'selectedSection', 'selectedStudent'];
function StudentReportCtrl($scope, $rootScope, $state, professors, $modal, selectedCourse, selectedSection, selectedStudent) {
var vm = this;
var professorid = $rootScope.professorId;
vm.section = [];
vm.professor = null;
professors.get({ id: professorid },
function (successResult){
vm.professor = successResult;
angular.forEach (vm.professor.courses[selectedCourse.index].sections,
function (value, key){
if (value._id == selectedSection._id ) {
selectedSection.index = key;
vm.students = value.students;
vm.section = value;
}
});
},
function (){
console.log("Error al obtener los datos.");
});
vm.studentReports = function (index) {
selectedStudent._id = vm.students[index]._id;
$state.go('studentAssist');
};
vm.back = function (index) {
$state.go('sectionReport');
};
$scope.ok = function () {
$scope.modalInstance.dismiss('cancel');
};
$scope.cancel = function () {
$scope.modalInstance.dismiss('cancel');
};
};
})();