var examApp = angular.module('exam-App', ['ckeditor']);
examApp.run(['examService', function(examService) {
    examService.getExamDatafromServer();

}]);
examApp.filter('answers', [function() {
    return function(question, answers) {
        var related_answers = [];
        angular.forEach(answers, function(answer, key) {
            if (question.question_ID == answer.question_ID) {
                this.push(answer);
            }
        }, related_answers);
        return related_answers;
    };
}]);
examApp.filter('paragraph', [function() {
    return function(question, paragraphs) {
        var related_paragraph = false;
        angular.forEach(paragraphs, function(paragraph, key) {
            if (question.paragraph_ID == paragraph.question_resource_ID) {
                related_paragraph = paragraph;
            }
        });
        return related_paragraph;
    };
}]);