Quellcode durchsuchen

Testy fix test form field names

Piotr Labudda vor 11 Jahren
Ursprung
Commit
0b2899d056
1 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen
  1. 7 2
      SE/procesy/testy.php

+ 7 - 2
SE/procesy/testy.php

@@ -2110,10 +2110,11 @@ function tree_callback__show_test_item_from_CRM_PROCES(&$r, &$tree) {
 				$odpowiedziOut = array();
 				for ($i = 0; $i < 5; $i++) {
 					$odpOut = new stdClass();
+					$odpOut->questionFormFldName = "ODP_{$p->ID}";
 					$odpOut->questionFldName = "ODP_{$i}";
 					if (!empty($p->{$odpOut->questionFldName})) {
 						$p->otwarte = false;
-						$odpOut->answearFldName = "{$odpOut->questionFldName}_ODP_{$i}";
+						$odpOut->answearFldName = "{$odpOut->questionFormFldName}_ODP_{$i}";
 						$odpOut->answearLabel = $p->{$odpOut->questionFldName};
 						$odpOut->answears = array('', 'TAK', 'NIE');
 						$odpOut->userAnswear = $tree->get_param($odpOut->answearFldName);
@@ -2123,7 +2124,7 @@ function tree_callback__show_test_item_from_CRM_PROCES(&$r, &$tree) {
 
 				if ($p->otwarte) {
 					$p->questionFldName = "ODP_{$p->ID}";
-					$p->userAnswear = $tree->get_param($p->questionFldName);
+					$p->userAnswear = $tree->get_param($odpOut->questionFldName);
 				} else {
 					$p->odpowiedzi = $odpowiedziOut;
 				}
@@ -2131,6 +2132,10 @@ function tree_callback__show_test_item_from_CRM_PROCES(&$r, &$tree) {
 				$pytaniaOut[] = $p;
 			}
 		}
+		if('1'==V::get('DBG_ODP', '', $_GET) && !empty($pytaniaOut)) {
+			echo'<pre>';print_r($tree);echo'</pre>';
+			echo'<pre>';print_r($pytaniaOut);echo'</pre>';
+		}
 	}
 
 	?>