Browse Source

Atualizado a tamanho da coluna dos pares para 2000 caracteres

Igor 6 năm trước cách đây
mục cha
commit
bb2013f7d8
2 tập tin đã thay đổi với 16 bổ sung4 xóa
  1. 1 1
      db/install.xml
  2. 15 3
      view.php

+ 1 - 1
db/install.xml

@@ -45,7 +45,7 @@
         <FIELD NAME="peso5" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso4" NEXT="peso6"/>
         <FIELD NAME="peso6" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso5" NEXT="pares"/>
 
-        <FIELD NAME="pares" TYPE="text" LENGHT="500" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="peso6" NEXT="cmid"/>
+        <FIELD NAME="pares" TYPE="text" LENGHT="2000" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="peso6" NEXT="cmid"/>
 
         <FIELD NAME="cmid" TYPE="text" LENGHT="200" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="pares" NEXT="course"/>
         <FIELD NAME="course" TYPE="text" LENGHT="200" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="cm_id" NEXT="user"/>

+ 15 - 3
view.php

@@ -112,8 +112,6 @@ echo $OUTPUT->heading('Responda ao questionário');
 
 <script type="text/javascript">
 
-  console.log('testando...');
-
 // Create a set of parallel arrays for each of the scales
 var scale      = new Array();
 var left       = new Array();
@@ -121,6 +119,8 @@ var right      = new Array();
 var def        = new Array();
 var NUM_SCALES = 6;
 
+var pairs_reg = '';
+
 // á á
 // ã ã
 // í í
@@ -307,6 +307,11 @@ function setPairLabels () {
   var pair1 = scale[indexes[0]];
   var pair2 = scale[indexes[1]];
 
+  if (pair_num > 0) {
+    pairs_reg += ', '
+  }
+  pairs_reg += '{' + pair1 + ' x ' + pair2 + '}';
+
   document.getElementById('pair1').value = pair1;
   document.getElementById('pair2').value = pair2;
 
@@ -321,6 +326,8 @@ function buttonPair1 () {
   indexes = pair[pair_num].split(" ");
   results_tally[indexes[0]]++; // register the winning item (just to total amount)
 
+  pairs_reg += ' = ' + scale[indexes[0]];
+
   nextPair();
   return true;
   }
@@ -331,6 +338,9 @@ function buttonPair2 () {
   var indexes = new Array();
   indexes = pair[pair_num].split(" ");
   results_tally[indexes[1]]++; // register the winning item (just to total amount)
+
+  pairs_reg += ' = ' + scale[indexes[1]];
+
   nextPair();
   return true;
   }
@@ -377,7 +387,9 @@ function getResultsHTML () {
   result += "</table>\n<br/>";
   result += "Total = " + results_overall + "<br/>\n";
 
-  $.post("<?php echo "view.php?id=".$cm->id ?>", { scale: results_rating, calc: results_tally, peso: results_weight}, function(d) { });
+  pairs_reg = '{ ' + pairs_reg + ' }';
+
+  $.post("<?php echo "view.php?id=".$cm->id ?>", { scale: results_rating, calc: results_tally, peso: results_weight, pares: pairs_reg}, function(d) { });
 
   result = "<p>Obrigado por responder.</p>" + result;
   // result = "Obrigado por responder.";