UNPKG

unserver-unify

Version:

37 lines (36 loc) 1.18 kB
angular.module('bamboo.course').controller('ErrorFullPreviewCtrl', function($stateParams, ApiService, ExamService, loginService, $scope, CourseApi, $rootScope) { var self = this; this.lid = this.courseId = $stateParams.cid; // save the current course id this.typename = ApiService.typename; this.uid = loginService.user._id; self.questions = []; self.name = "Full Error Paper"; $scope.typelist = ApiService.typelist; $scope.levelList = ApiService.levelList; CourseApi.getKnowledges(self.courseId, function(list) { console.log(list); self.Knowledges = $scope.Knowledges = list; }); this.search = $rootScope.errorBankSearch || {}; console.log(this.search); this.showPaper = function() { var info = { action: "getErrorPaperWithQuery", //"getuserfullerrorpaper", cid: self.lid, uid: self.uid, search: self.search }; console.log(info); ExamService.examApi(info, function(data) { console.log(data); if (!data) { return; } self.questions = data.qstList; }); } self.showPaper(); this.print = function() { window.print(); } });