Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 4409 | Rev 4429 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 4409 Rev 4413
Línea 147... Línea 147...
147
            $('[data-toggle="tooltip"]').tooltip();
147
            $('[data-toggle="tooltip"]').tooltip();
148
        },
148
        },
149
        /**
149
        /**
150
         * Add element to section array
150
         * Add element to section array
151
         */
151
         */
152
        this.addSection = function(name, text, value) {
152
        this.addSection = function(name, text) {
153
            var d = new Date();
153
            var d = new Date();
154
            var slug = 'section' + d.getTime();
154
            var slug = 'section' + d.getTime();
155
            var position = 0;
155
            var position = 0;
156
            $.each(this.sections, function(index, section) {
156
            $.each(this.sections, function(index, section) {
157
                if (position < section.position) {
157
                if (position < section.position) {
Línea 171... Línea 171...
171
            this.sections.push(section);
171
            this.sections.push(section);
172
        },
172
        },
173
         /**
173
         /**
174
         * Edit element to section array
174
         * Edit element to section array
175
         */
175
         */
176
        this.editSection = function(slug, name, text, value) {
176
        this.editSection = function(slug, name, text) {
177
            var renderTable = false;
177
            var renderTable = false;
178
            for (i = 0; i < this.sections.length; i++) {
178
            for (i = 0; i < this.sections.length; i++) {
179
                if (slug == this.sections[i].slug_section) {
179
                if (slug == this.sections[i].slug_section) {
180
                    this.sections[i].name = name;
180
                    this.sections[i].name = name;
181
                    this.sections[i].text = text;
181
                    this.sections[i].text = text;
Línea 205... Línea 205...
205
            }
205
            }
206
        },
206
        },
207
         /**
207
         /**
208
         * Add element to question array
208
         * Add element to question array
209
         */
209
         */
210
        this.addQuestion = function(slug_section, text, value, type, maxlength, multiline, range) {
210
        this.addQuestion = function(slug_section, text, type, maxlength, multiline, range) {
211
            var d = new Date();
211
            var d = new Date();
212
            var slug_question = 'question' + d.getTime();
212
            var slug_question = 'question' + d.getTime();
213
            var position = 0;
213
            var position = 0;
214
            var renderTable = false;
214
            var renderTable = false;
215
            for (i = 0; i < this.sections.length; i++) {
215
            for (i = 0; i < this.sections.length; i++) {
Línea 243... Línea 243...
243
            }
243
            }
244
        },
244
        },
245
         /**
245
         /**
246
         * Add element to question array
246
         * Add element to question array
247
         */
247
         */
248
        this.editQuestion = function(slug_section, slug_question, text, value, type, maxlength, multiline, range) {
248
        this.editQuestion = function(slug_section, slug_question, text, type, maxlength, multiline, range) {
249
            var renderTable = false;
249
            var renderTable = false;
250
            for (i = 0; i < this.sections.length; i++) {
250
            for (i = 0; i < this.sections.length; i++) {
251
                if (slug_section == this.sections[i].slug_section) {
251
                if (slug_section == this.sections[i].slug_section) {
252
                    for (j = 0; j < this.sections[i].questions.length; j++) {
252
                    for (j = 0; j < this.sections[i].questions.length; j++) {
253
                        if (slug_question == this.sections[i].questions[j].slug_question) {
253
                        if (slug_question == this.sections[i].questions[j].slug_question) {
254
                            this.sections[i].questions[j].text = text,
254
                            this.sections[i].questions[j].text = text,
255
                              //  this.sections[i].questions[j].value = value,
255
                             //  this.sections[i].questions[j].value = value,
256
                                this.sections[i].questions[j].type = type;
256
                                this.sections[i].questions[j].type = type;
257
                            if (type == 'open') {
257
                            if (type == 'open') {
258
                                this.sections[i].questions[j].maxlength = maxlength;
258
                                this.sections[i].questions[j].maxlength = maxlength;
259
                                this.sections[i].questions[j].multiline = multiline;
259
                                this.sections[i].questions[j].multiline = multiline;
260
                                this.sections[i].questions[j].options = [];
260
                                this.sections[i].questions[j].options = [];
Línea 311... Línea 311...
311
            }
311
            }
312
        },
312
        },
313
        /**
313
        /**
314
         * Add element to option array
314
         * Add element to option array
315
         */
315
         */
316
        this.addOption = function(slug_section, slug_question, text, correct, value) {
316
        this.addOption = function(slug_section, slug_question, text, correct) {
317
            var d = new Date();
317
            var d = new Date();
318
            var slug_option = 'option' + d.getTime();
318
            var slug_option = 'option' + d.getTime();
319
            var position = 0;
319
            var position = 0;
320
            var renderTable = false;
320
            var renderTable = false;
321
            for (i = 0; i < this.sections.length; i++) {
321
            for (i = 0; i < this.sections.length; i++) {
Línea 352... Línea 352...
352
            }
352
            }
353
        },
353
        },
354
        /**
354
        /**
355
         * Edit element to option array
355
         * Edit element to option array
356
         */
356
         */
357
        this.editOption = function(slug_section, slug_question, option_slug, text, correct, value) {
357
        this.editOption = function(slug_section, slug_question, option_slug, text, correct) {
358
            var renderTable = false;
358
            var renderTable = false;
359
            for (i = 0; i < this.sections.length; i++) {
359
            for (i = 0; i < this.sections.length; i++) {
360
                if (slug_section == this.sections[i].slug_section) {
360
                if (slug_section == this.sections[i].slug_section) {
361
                    for (j = 0; j < this.sections[i].questions.length; j++) {
361
                    for (j = 0; j < this.sections[i].questions.length; j++) {
362
                        if (slug_question == this.sections[i].questions[j].slug_question) {
362
                        if (slug_question == this.sections[i].questions[j].slug_question) {