UNPKG

unserver-unify

Version:

26 lines (23 loc) 843 B
angular.module('bamboo.course').controller('QuestionPreviewDlgCtrl', function($scope, ExamService, ApiService, qid, regexHelper) { var _self = this; var info = { id: qid, action: "getquestion" }; ExamService.examApi(info, function(data) { var fullquestion = data; data.content = data.content && data.content.replace(/[\x00-\x1F\x7F-\x9F]/g, ""); data.content = regexHelper.clearHtmlStrStyle(data.content); fullquestion=ExamService.convertV1Question(fullquestion); $scope.q = data; console.log(fullquestion); }); this.typename = {}; angular.forEach(ApiService.typelist, function(val, index) { _self.typename[val.type] = val.text; }) _self.levelDict = ApiService.levelDict; this.numToLetters = function(num) { return String.fromCharCode(65 + num); }; });