"use strict"; angular.module("vocabulary") .service("assignVocabLessonService", ["customAssignmentApi", "lessonTypeService", "$http", function (customAssignmentApi, lessonTypeService, $http) { function assignVocabLesson(lessonData, studentIds) { var lessonId = lessonData.type === lessonTypeService.USER_DEFINED ? lessonData.id : lessonData.premadeId; var data = { subjectId: 7, lesson : { lessonType: lessonData.type, lessonId: lessonId }, name: lessonData.name, studentIds: studentIds }; return customAssignmentApi.create(data); } function getStudentResourceLimit(studentIDsAsDelimitedString) { return $http.get("/api/resources/getAssignedResourceCount/" + studentIDsAsDelimitedString); } function getAssignableWordMinimum() { return 5; } return { assignVocabLesson: assignVocabLesson, getStudentResourceLimit: getStudentResourceLimit, getAssignableWordMinimum: getAssignableWordMinimum }; }]);