"use strict"; angular.module("vocabulary") .service("standardsAndCorrelationsService", [ function(){ var activeStandardCategory = null; var usStates = { 0: {value: '', display: 'Select a U.S. State'}, 1: {value: 'AL', display: 'Alabama'}, 2: {value: 'AK', display : 'Alaska'}, 3: {value: 'AZ', display: 'Arizona'}, 4: {value: 'AR', display: 'Arkansas'}, 5: {value: 'CA', display: 'California'}, 6: {value: 'CO', display: 'Colorado'}, 7: {value: 'CT' , display: 'Connecticut'}, 8: {value: 'DE', display: 'Delaware'}, 9: {value: 'DC', display: 'District Of Columbia'}, 10: {value: 'FL' , display: 'Florida'}, 11: {value: 'GA', display : 'Georgia'}, 12: {value: 'HI' , display: 'Hawaii'}, 13: {value: 'ID' , display: 'Idaho'}, 14: {value: 'IL', display : 'Illinois'}, 15: {value: 'IN', display : 'Indiana'}, 16: {value: 'IA', display : 'Iowa'}, 17: {value: 'KS', display: 'Kansas'}, 18: {value: 'KY', display : 'Kentucky'}, 19: {value: 'LA', display : 'Louisiana'}, 20: {value: 'ME', display : 'Maine'}, 21: {value: 'MD', display: 'Maryland'}, 22: {value: 'MA', display : 'Massachusetts'}, 23: {value: 'MI', display : 'Michigan'}, 24: {value: 'MN', display: 'Minnesota'}, 25: {value: 'MS', display : 'Mississippi'}, 26: {value: 'MO', display : 'Missouri'}, 27: {value: 'MT', display : 'Montana'}, 28: {value: 'NE', display : 'Nebraska'}, 29: {value: 'NV', display : 'Nevada'}, 30: {value: 'NH', display : 'New Hampshire'}, 31: {value: 'NJ', display : 'New Jersey'}, 32: {value: 'NM', display : 'New Mexico'}, 33: {value: 'NY', display: 'New York'}, 34: {value: 'NC', display : 'North Carolina'}, 35: {value: 'ND', display : 'North Dakota'}, 36: {value: 'OH', display : 'Ohio'}, 37: {value: 'OK', display : 'Oklahoma'}, 38: {value: 'OR', display : 'Oregon'}, 39: {value: 'PA', display : 'Pennsylvania'}, 40: {value: 'RI', display : 'Rhode Island'}, 41: {value: 'SC', display : 'South Carolina'}, 42: {value: 'SD', display : 'South Dakota'}, 43: {value: 'TN', display : 'Tennessee'}, 44: {value: 'TX', display : 'Texas'}, 45: {value: 'UT', display : 'Utah'}, 46: {value: 'VT', display : 'Vermont'}, 47: {value: 'VA', display : 'Virginia'}, 48: {value: 'WA', display : 'Washington'}, 49: {value: 'WV', display : 'West Virginia'}, 50: {value: 'WI', display : 'Wisconsin'}, 51: {value: 'WY', display : 'Wyoming'} }; var statesWithStandards = { "FL" : { 0: {value: 'fl', display: 'Language Arts Florida Standards (LAFS)'}, 1: {value: 'flalts', display : "Florida Access Points - ELA"} } }; var subjectType = { 'LA': 'Language+Arts', 'EL': 'English+Language+Learners' }; var caStates = { 0 : { value: '', display: 'Select a Canadian Province'}, 1 : { value: 'AB' , display: 'Alberta'}, 2: { value: 'ACCS', display: 'Atlantic Canada Curriculum Standards'}, 3: { value: 'BC', display : 'British Columbia'}, 4: { value: 'MB' , display: 'Manitoba'}, 5: { value: 'ON' , display: 'Ontario'}, 6: { value: 'QC', display : 'Quebec'}, 7: { value: 'SK', display: 'Saskatchewan'} }; var auStates = { 0 : {value: '', display: 'Select an Australian Region' }, 1: {value: 'ACARAS', display: 'Australian National Curriculum (ACARA)'}, 2: { value: 'ACT', display: 'Australian Capital Territory'}, 3: { value: 'NSW' , display: 'New South Wales'}, 4: { value: 'NTA' , display: 'Northern Territory'}, 5: { value: 'QLD' , display: 'Queensland'}, 6: { value: 'SAU' , display: 'South Australia'}, 7: { value: 'TAS' , display: 'Tasmania'}, 8: {value: 'VIC' , display: 'Victoria'}, 9: { value: 'WAU' , display: 'Western Australia'} }; var non_cef_grade_list = { 0: {value: 'K-6', display: 'Grades K-6'}, 1: { value: 'K', display: 'Kindergarten'}, 2: { value: '1', display: 'Grade 1'}, 3: {value: '2', display: 'Grade 2'}, 4: {value: '3', display: 'Grade 3'}, 5: {value: '4', display: 'Grade 4'}, 6: {value: '5', display: 'Grade 5'}, 7: {value: '6', display: 'Grade 6'} }; var cef_gradeList = { 0: {value: 'A-C', display: 'Levels A1-C1'}, 1: {value: 'A1', display: 'Level A1'}, 2: {value: 'A2', display: 'Level A2'}, 3: {value: 'B1', display: 'Level B1'}, 4: {value: 'B2', display: 'Level B2'}, 5: {value: 'C1', display: 'Level C1'} }; function getStatesForCountry(country){ var statesToReturn = null; if(country === 'au'){ statesToReturn = auStates; }else if(country === 'ca'){ statesToReturn = caStates; }else if(country === 'us'){ statesToReturn = usStates; } return statesToReturn; } function getGradeListForCountry(country){ var gradeListToReturn = null; if(country === 'cef'){ gradeListToReturn = cef_gradeList; } else{ gradeListToReturn = non_cef_grade_list; } return gradeListToReturn; } function getGradeListForStandard(standard){ var gradeListToReturn = null; if(standard === 'CEFR' || standard === 'CEF'){ gradeListToReturn = cef_gradeList; } else{ gradeListToReturn = non_cef_grade_list; } return gradeListToReturn; } function getRequestUrl(gradeValue, stateValue, subjectValue){ var urlOptions = { function: 'listStandards', grade: gradeValue, course: 'vocabulary', bShowAllStandards: 'false', state: stateValue.toLowerCase() }; urlOptions['subject'] = subjectType[subjectValue]; urlOptions['filter[]'] = 'Product~(VOCABULARY+A-Z)'; return window.clg.edgateController.getRequestURL(urlOptions); } function getStandardsListForState(state){ var standardsListToReturn = null; if(statesWithStandards[state]){ standardsListToReturn = statesWithStandards[state]; } return standardsListToReturn; } function getActiveStandardsCategory(){ return activeStandardCategory; } function setActiveStandardsCategory(activeCategoryValue){ activeStandardCategory = activeCategoryValue; } return{ getGradeListForCountry: getGradeListForCountry, getGradeListForStandard: getGradeListForStandard, getStatesForCountry: getStatesForCountry, getStandardsListForState: getStandardsListForState, getRequestUrl: getRequestUrl, getActiveStandardsCategory: getActiveStandardsCategory, setActiveStandardsCategory: setActiveStandardsCategory } }]);