<commit_before>var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

XLF.Model.SkipLogicFactory = (function() {
    SkipLogicFactory.prototype.create_operator = function(type, symbol, id) {
        var operator;
        switch (type) {
            case 'text':
                operator = new XLF.TextOperator(symbol);
                break;
            case 'basic':
                operator = new XLF.SkipLogicOperator(symbol);
                break;
            case 'existence':
                operator = new XLF.ExistenceSkipLogicOperator(symbol);
                break;
            case 'select_multiple':
                operator = new XLF.SelectMultipleSkipLogicOperator(symbol);
                break;
            case 'empty':
                return new XLF.EmptyOperator();
        }
        operator.set('id', id);
        return operator;
    };

    SkipLogicFactory.prototype.create_criterion_model = function() {
        return new XLF.SkipLogicCriterion(this, this.survey);
    };

    SkipLogicFactory.prototype.create_response_model = function(type) {
        var model;
        model = null;
        switch (type) {
            case 'integer':
                model = new XLF.Model.IntegerResponseModel;
                break;
            case 'decimal':
                model = new XLF.Model.DecimalResponseModel;
                break;
            default:
                model = new XLF.Model.ResponseModel;
        }
        return model.set('type', type);
    };

    function SkipLogicFactory(survey) {
        this.survey = survey;
    }

    return SkipLogicFactory;

})();

XLF.SkipLogicCriterion = (function(_super) {
    __extends(SkipLogicCriterion, _super);

    SkipLogicCriterion.prototype.serialize = function() {
        var response_model;
        response_model = this.get('response_value');
        if ((response_model != null) && (this.get('operator') != null) && (this.get('question_cid') != null) && response_model.isValid() !== false) {
            this._get_question().finalize();
            return this.get('operator').serialize(this._get_question().get('name').get('value'), response_model.get('value'));
        } else {
            return '';
        }
    };

    SkipLogicCriterion.prototype._get_question = function() {
        return this.survey.rows.get(this.get('question_cid'));
    };

    SkipLogicCriterion.prototype.change_question = function(cid) {<commit_msg>#754 - user can't save form after deleting question that is bound to skip logic clause<commit_after>var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

XLF.Model.SkipLogicFactory = (function() {
    SkipLogicFactory.prototype.create_operator = function(type, symbol, id) {
        var operator;
        switch (type) {
            case 'text':
                operator = new XLF.TextOperator(symbol);
                break;
            case 'basic':
                operator = new XLF.SkipLogicOperator(symbol);
                break;
            case 'existence':
                operator = new XLF.ExistenceSkipLogicOperator(symbol);
                break;
            case 'select_multiple':
                operator = new XLF.SelectMultipleSkipLogicOperator(symbol);
                break;
            case 'empty':
                return new XLF.EmptyOperator();
        }
        operator.set('id', id);
        return operator;
    };

    SkipLogicFactory.prototype.create_criterion_model = function() {
        return new XLF.SkipLogicCriterion(this, this.survey);
    };

    SkipLogicFactory.prototype.create_response_model = function(type) {
        var model;
        model = null;
        switch (type) {
            case 'integer':
                model = new XLF.Model.IntegerResponseModel;
                break;
            case 'decimal':
                model = new XLF.Model.DecimalResponseModel;
                break;
            default:
                model = new XLF.Model.ResponseModel;
        }
        return model.set('type', type);
    };

    function SkipLogicFactory(survey) {
        this.survey = survey;
    }

    return SkipLogicFactory;

})();

XLF.SkipLogicCriterion = (function(_super) {
    __extends(SkipLogicCriterion, _super);

    SkipLogicCriterion.prototype.serialize = function() {
        var response_model;
        response_model = this.get('response_value');
        if ((response_model != null) && (this.get('operator') != null) && (this.get('question_cid') != null) && response_model.isValid() !== false && this._get_question() !== undefined) {
            this._get_question().finalize();
            return this.get('operator').serialize(this._get_question().get('name').get('value'), response_model.get('value'));
        } else {
            return '';
        }
    };

    SkipLogicCriterion.prototype._get_question = function() {
        return this.survey.rows.get(this.get('question_cid'));
    };

    SkipLogicCriterion.prototype.change_question = function(cid) {
{'fraction_non_alphanumeric': 0.12566615093690905, 'fraction_numerical': 0.0012033694344163659, 'mean_word_length': 2.2907239819004523, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3750348', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1594, 'n_words': 344}