(function(){"use strict";function i(n){[{url:"/",config:{templateUrl:"/ng/modules/accreditation/views/information.html",controller:"InformationController"}},{url:"/questionnaire",config:{templateUrl:"/ng/modules/accreditation/views/questionnaire.html",controller:"QuestionnaireController"}}].forEach(function(t){n.when(t.url,t.config)});n.otherwise({redirectTo:"/"})}var t=angular.module("app"),n;t.config(["$routeProvider",i]);n=angular.module("appControllers",[]);n.controller("InformationController",["$scope","$location",function(n,t){n.currentSubjectIndex=0;n.subjects=["INTRODUCTION","ABOUT weedmaster DST","RISK ASSESSMENT","USE RATES AND TIMING","APPLICATION","HERBICIDE RESISTANCE MANAGEMENT","SELF-ASSESSMENT SURVEY","AUDITS","ADVERSE EVENTS AND REPORTS",];n.gotoSubject=function(t){n.currentSubjectIndex=t};n.gotoPrevious=function(){n.currentSubjectIndex--};n.gotoNext=function(){n.currentSubjectIndex++};n.gotoQuestionnaire=function(){t.path("/questionnaire/")}}]);n.controller("QuestionnaireController",["$scope","$resource",function(n,t){var r=t("/Api/MemberAccreditation/GetQuestions"),i;n.questions=r.query(function(){n.answers=new Array(n.questions.length)});n.currentQuestionIndex=0;n.submitAnswerClick=function(t){n.questions[t].chosenAnswer&&(n.answers[t]=n.questions[t].chosenAnswer,n.currentQuestionIndex++);n.currentQuestionIndex>n.questions.length-1&&(n.showResults=!0,i())};n.gotoQuestion=function(t){n.result!=null&&n.result.IsSuccess||(n.showResults=!1,n.currentQuestionIndex=t)};n.result=null;i=function(){var r=t("/Api/MemberAccreditation/SubmitAnswers"),i;n.result=null;i=new r({Answers:n.answers});i.$save(function(t){t.IsSuccess&&(window.location.href="/Member/Dashboard?IsAccredited=true");n.result=t})}}])})()