{:uriI"file:///home/arnold/roqua/quby_engine/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee?type=application/javascript&pipeline=self&id=be361335307ed6709bda09151fb4779e6d56c29e7083191ef47ee1d6b37dcba0:ET:load_pathI":/home/arnold/roqua/quby_engine/app/assets/javascripts;T: filenameI"g/home/arnold/roqua/quby_engine/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee;T: nameI"'quby/backbone/logic/init_questions;T:logical_pathI"/quby/backbone/logic/init_questions.self.js;T:content_typeI"application/javascript;T: sourceI"4 (function() { Quby.Logic.InitQuestions = (function() { function InitQuestions(questionAttributes) { this.questions = new Quby.Collections.Questions; this.questionAttributes = questionAttributes; } InitQuestions.prototype.initializeQuestions = function() { _.each(this.questionAttributes, (function(_this) { return function(questionAttribute) { var options, question; options = _this.initializeOptions(questionAttribute.options); question = _this.initializeQuestion(questionAttribute, options); return _this.questions.add(question); }; })(this)); return this.questions; }; InitQuestions.prototype.initializeOptions = function(optionAttributes) { var options; options = new Quby.Collections.QuestionOptions; _.each(optionAttributes, (function(_this) { return function(attrs) { var element, option; option = new Quby.Models.QuestionOption({ key: attrs.key, showsQuestionsKeys: attrs.showsQuestions, hidesQuestionsKeys: attrs.hidesQuestions, startChosen: attrs.startChosen }); element = _this.initializeOptionViewElement(attrs.viewId); new Quby.Views.QuestionOptionView({ model: option, el: element }); return options.add(option); }; })(this)); return options; }; InitQuestions.prototype.initializeOptionViewElement = function(view_id) { return $("#" + view_id)[0]; }; InitQuestions.prototype.initializeQuestion = function(question, options) { var parentOption, parentQuestion; parentQuestion = this.questions.findWhere({ key: question.parentKey }); if (parentQuestion) { parentOption = parentQuestion.get("options").findWhere({ key: question.parentOptionKey }); } return new Quby.Models.Question({ key: question.key, viewSelector: question.viewSelector, options: options, type: question.type, defaultInvisible: question.defaultInvisible, parentQuestion: parentQuestion, parentOption: parentOption, deselectable: question.deselectable }); }; return InitQuestions; })(); }).call(this); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"ufile-digest:///home/arnold/roqua/quby_engine/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%4Sfte 6Z3OM: lengthi4 :dependencies_digest"% ,FU!3!wIˈSxNB d:idI"Ebe361335307ed6709bda09151fb4779e6d56c29e7083191ef47ee1d6b37dcba0;F: mtimel+&p^