|
@@ -67,7 +67,19 @@
|
67
|
67
|
<p class="help-block"><strong>Manually add</strong> bullets or numbering.</p>
|
68
|
68
|
{{ Form::textarea('subcriteria', '', array('class' => 'form-control', 'rows'=>3, 'aria-labelledby'=>'subcriteria')) }}
|
69
|
69
|
</div>
|
70
|
|
-
|
|
70
|
+ <div class="form-group">
|
|
71
|
+ {{ Form::label('maximum_score', 'Maximum Score') }}
|
|
72
|
+ {{ Form::text('maximum_score', '1', array('class' => 'form-control', 'id'=>'maximum_score', 'oninput'=>'addOptions("Num_scale", "maximum_score", "Scales")')) }}
|
|
73
|
+ </div>
|
|
74
|
+ <div class="form-group">
|
|
75
|
+ {{ Form::label('scales', 'Number of Scales') }}
|
|
76
|
+ <select id="Num_scale" name="scales" class="form-control selectpicker" onchange='numberOfScales("Num_scale", "Scales")'>
|
|
77
|
+
|
|
78
|
+ </select>
|
|
79
|
+ </div>
|
|
80
|
+ <div id='Scales' data-value="0">
|
|
81
|
+
|
|
82
|
+ </div>
|
71
|
83
|
|
72
|
84
|
|
73
|
85
|
<div class="form-group">
|
|
@@ -200,6 +212,21 @@
|
200
|
212
|
<p class="help-block"><strong>Manually add</strong> bullets or numbering.</p>
|
201
|
213
|
{{ Form::textarea('subcriteria', '', array('class' => 'form-control', 'rows'=>3, 'id' => 'criterion_subcriteria')) }}
|
202
|
214
|
</div>
|
|
215
|
+ <div class="form-group">
|
|
216
|
+ {{ Form::label('assoc_maximum_score', 'Maximum Score') }}
|
|
217
|
+ {{ Form::text('assoc_maximum_score', '', array('class' => 'form-control', 'id'=>'assoc_maximum_score', 'oninput'=>'addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales")')) }}
|
|
218
|
+ </div>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+ <div class="form-group">
|
|
222
|
+ {{ Form::label('scales', 'Number of Scales') }}
|
|
223
|
+ <select id="Num_assoc_scale" class="form-control selectpicker" onchange='numberOfAssoc("Num_assoc_scale", "Assoc_Scales")'>
|
|
224
|
+
|
|
225
|
+ </select>
|
|
226
|
+ </div>
|
|
227
|
+ <div id='Assoc_Scales' data-value="0">
|
|
228
|
+
|
|
229
|
+ </div>
|
203
|
230
|
|
204
|
231
|
|
205
|
232
|
|
|
@@ -232,9 +259,109 @@
|
232
|
259
|
var counter = 1;
|
233
|
260
|
var counterObj = 1;
|
234
|
261
|
var outcomeString = 'OutcomeGroup_';
|
|
262
|
+
|
|
263
|
+ $(document).ready(function() {
|
|
264
|
+ addOptions('Num_scale', 'maximum_score', 'Scales');
|
|
265
|
+ numberOfScales('Num_scale', 'Scales');
|
|
266
|
+ });
|
|
267
|
+
|
|
268
|
+ function addOptions(select, max, scaleDiv) {
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+ var maxscore = parseInt($('#' + max).val())
|
|
272
|
+ options = '<option value = "1"> 1</option>';
|
|
273
|
+ selectedValue = 1;
|
|
274
|
+ valueBefore = 0;
|
|
275
|
+ for (var i = 2; i <= 20; i++) {
|
|
276
|
+ if(maxscore%i==0){
|
|
277
|
+ options += '<option value="' + i.toString() + '">' + i.toString() + '</option>';
|
|
278
|
+
|
|
279
|
+ }
|
|
280
|
+
|
|
281
|
+ }
|
|
282
|
+
|
|
283
|
+ var previousvalue = parseInt($('#' + select).val());
|
|
284
|
+ $('#' + select).html(options);
|
|
285
|
+ $('#' + select).val(previousvalue);
|
|
286
|
+ $('#' + select).selectpicker('refresh');
|
|
287
|
+ }
|
|
288
|
+
|
|
289
|
+ function numberOfAssoc(string, Scales) {
|
|
290
|
+ var maximum = $('#assoc_maximum_score').val();
|
|
291
|
+ var amountOfScale = parseInt($('#' + string).val());
|
|
292
|
+ var dataValue = parseInt($('#' + Scales).attr('data-value'));
|
|
293
|
+ //add
|
|
294
|
+ if (dataValue < amountOfScale) {
|
|
295
|
+
|
|
296
|
+ fullDiv = '';
|
|
297
|
+
|
|
298
|
+ for (var i = dataValue; i < amountOfScale; i++) {
|
|
299
|
+ div = '<div id="assoc_eval' + i.toString() + Scales + '">' +
|
|
300
|
+ '<div class ="form-group">' +
|
|
301
|
+ '<label for ="descripcion' + i.toString() + '">Descripción de evaluación</label>' +
|
|
302
|
+ '<textarea class="form-control" rows="2" aria-labelledby="descripcion' + i.toString() + '" name="assoc_scales[]" cols="50" ></textarea></div></div>';
|
|
303
|
+ fullDiv += div;
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+ }
|
|
307
|
+
|
|
308
|
+ $('#' + Scales).append(fullDiv);
|
|
309
|
+ $('#' + Scales).attr('data-value', amountOfScale);
|
|
310
|
+ } else {
|
|
311
|
+ for (var i = dataValue; i > amountOfScale; i--) {
|
|
312
|
+ $('#assoc_eval' + (i - 1).toString()).remove();
|
|
313
|
+ }
|
|
314
|
+ }
|
|
315
|
+ $('#' + Scales).attr('data-value', amountOfScale);
|
|
316
|
+
|
|
317
|
+ }
|
235
|
318
|
|
|
319
|
+ function numberOfScales(string, Scales) {
|
|
320
|
+ var maximum = parseInt($('#maximum_score').val());
|
|
321
|
+ var amountOfScale = parseInt($('#' + string).val());
|
|
322
|
+ var dataValue = parseInt($('#' + Scales).attr('data-value'));
|
|
323
|
+ var division = maximum/amountOfScale;
|
|
324
|
+ //add
|
|
325
|
+
|
|
326
|
+
|
236
|
327
|
|
237
|
328
|
|
|
329
|
+ fullDiv = '';
|
|
330
|
+ if(division ==1){
|
|
331
|
+ for (var i = 0; i < amountOfScale; i++) {
|
|
332
|
+ div = '<div id="eval' + i.toString() + Scales + '">' +
|
|
333
|
+ '<div class ="form-group">' +
|
|
334
|
+ '<label id = "label_for_des'+i.toString()+'" for ="descripcion' + i.toString() + '">Scale Description ('+(i+1)+')</label>' +
|
|
335
|
+ '<textarea class="form-control" rows="2" aria-labelledby="descripcion' + i.toString() + '" name="' + Scales + '[]" cols="50" ></textarea></div></div>';
|
|
336
|
+ fullDiv += div;
|
|
337
|
+ }
|
|
338
|
+ }
|
|
339
|
+ else if(division==maximum){
|
|
340
|
+
|
|
341
|
+ div = '<div id="eval' + 0 + Scales + '">' +
|
|
342
|
+ '<div class ="form-group">' +
|
|
343
|
+ '<label id = "label_for_des'+0+'" for ="descripcion' + 0 + '">Scale Description ('+1+' - '+maximum+')</label>' +
|
|
344
|
+ '<textarea class="form-control" rows="2" aria-labelledby="descripcion' + 0 + '" name="' + Scales + '[]" cols="50" ></textarea></div></div>';
|
|
345
|
+ fullDiv += div;
|
|
346
|
+ }
|
|
347
|
+
|
|
348
|
+ else{
|
|
349
|
+ for (var i = 0; i < amountOfScale; i++) {
|
|
350
|
+ div = '<div id="eval' + i.toString() + Scales + '">' +
|
|
351
|
+ '<div class ="form-group">' +
|
|
352
|
+ '<label id = "label_for_des'+i.toString()+'" for ="descripcion' + i.toString() + '">Scale Description ('+(1+(i*division))+' - '+((1+i)*division)+')</label>' +
|
|
353
|
+ '<textarea class="form-control" rows="2" aria-labelledby="descripcion' + i.toString() + '" name="' + Scales + '[]" cols="50" ></textarea></div></div>';
|
|
354
|
+ fullDiv += div;
|
|
355
|
+ }
|
|
356
|
+ }
|
|
357
|
+
|
|
358
|
+ $('#' + Scales).html(fullDiv);
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+ $('#' + Scales).attr('data-value', amountOfScale);
|
|
362
|
+
|
|
363
|
+ }
|
|
364
|
+
|
238
|
365
|
$('.filterSection').hide();
|
239
|
366
|
$('.filterButton').on('click', function()
|
240
|
367
|
{
|