<commit_before>/* exported restApiFactory */
'use strict';

function restApiFactory($resource) {
    return {
        createSurveyDraftApi: function (id) {
            var customMethods = {};
            id = id === 'new' ? null : id;
            if (id) {
                customMethods = {
                    save: { method: 'PUT' }
                };
            }

            return $resource('/api/survey_drafts/:id', { id: id || 0 }, customMethods);
        },
        create_question_api: function () {
            var info_list_items = [
                { label: 'Currently, what is your main priority or concern?', type: 'Select Many'},
                { label: 'If you have a dispute in your community, to whom do you take it first?', type: 'Select Many' },
                { label: 'Why do you take it first to that person or institution?', type: 'Select Many' },
                {
                    label: 'If needed, what kind of documentation do you have prove your access or interest to this land? (READ RESPONSES)',
                    type: 'Select Many',
                    responses: ['Title deed', 'Tribal certificate', 'Rental Agreement (lease)', 'Letter or document']
                },
                { label: 'What type of crops does your household sell, if any?', type: 'Select Many' },
                { label: 'During the war, did someone take over all or part of your house plot?', type: 'Select Many' },
                { label: 'During the war, did someone take over all or part of your household farm land?', type: 'Select Many' },
                { label: 'Since the end of the war in 2003, did someone take over all or part of your house plot?', type: 'Select Many' },
                { label: 'What what describe your access to this land? (READ RESPONSES)', type: 'Select Many' },
            ];

            return {
                query: function (fn) {
                    return fn(info_list_items);<commit_msg>fixes survey_draft creation angular issue<commit_after>/* exported restApiFactory */
'use strict';

function restApiFactory($resource) {
    return {
        createSurveyDraftApi: function (id) {
            var customMethods = {};
            id = id === 'new' ? null : id;
            if (id === null) {
                return $resource('/api/survey_drafts', {}, {
                    save: { method: 'POST' }
                });
            } else {
                return $resource('/api/survey_drafts/:id', { id: id }, {
                    save: { method: 'PATCH' }
                });
            }

        },
        create_question_api: function () {
            var info_list_items = [
                { label: 'Currently, what is your main priority or concern?', type: 'Select Many'},
                { label: 'If you have a dispute in your community, to whom do you take it first?', type: 'Select Many' },
                { label: 'Why do you take it first to that person or institution?', type: 'Select Many' },
                {
                    label: 'If needed, what kind of documentation do you have prove your access or interest to this land? (READ RESPONSES)',
                    type: 'Select Many',
                    responses: ['Title deed', 'Tribal certificate', 'Rental Agreement (lease)', 'Letter or document']
                },
                { label: 'What type of crops does your household sell, if any?', type: 'Select Many' },
                { label: 'During the war, did someone take over all or part of your house plot?', type: 'Select Many' },
                { label: 'During the war, did someone take over all or part of your household farm land?', type: 'Select Many' },
                { label: 'Since the end of the war in 2003, did someone take over all or part of your house plot?', type: 'Select Many' },
                { label: 'What what describe your access to this land? (READ RESPONSES)', type: 'Select Many' },
            ];

            return {
                query: function (fn) {
                    return fn(info_list_items);
{'fraction_non_alphanumeric': 0.10795454545454546, 'fraction_numerical': 0.002223320158102767, 'mean_word_length': 1.7866483138334481, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6811348', 'n_tokens_mistral': 1058, 'n_tokens_neox': 993, 'n_words': 423}