diff --git a/api/ui/Rearranger.php b/api/ui/Rearranger.php index eea10167ab..db30024b65 100644 --- a/api/ui/Rearranger.php +++ b/api/ui/Rearranger.php @@ -61,8 +61,8 @@ public function searchInside ($subarray, $goal) { return false; } public function swap($array, $goal, $goalkey, $direction) { - echo "swap received '" . $direction . "' and this array: \n"; - print_r($array, false); + //echo "swap received '" . $direction . "' and this array: \n"; + //print_r($array, false); $temp = ''; $tempkey = 0; $counter = 0; @@ -86,8 +86,8 @@ public function swap($array, $goal, $goalkey, $direction) { $temp = ''; foreach ($array as $key => $element) { if ($temp != '') { // previous element in temp2 is the goal, $element is the one to be swapped - echo "Array before swap: \n"; - print_r($array, false); + //echo "Array before swap: \n"; + //print_r($array, false); $array[$goalkey] = $element; $array[$key] = $temp; echo "Array after swap: \n"; @@ -96,7 +96,7 @@ public function swap($array, $goal, $goalkey, $direction) { } // if element is at last position, $temp will be set but nothing is swapped, foreach is over else if ($key == $goalkey) { - echo "Found array containing the value at key: " . $key . "\n"; + //echo "Found array containing the value at key: " . $key . "\n"; $temp = $element; } } diff --git a/api/ui/results.php b/api/ui/results.php index bb93331ee7..ddb8b00c0a 100644 --- a/api/ui/results.php +++ b/api/ui/results.php @@ -84,8 +84,10 @@ public function get() { $arr = $system->getResultsAll(); $id = $this->get['uid']; $arr = json_decode($arr, true); + print_r($arr, false); $rearranger = new Rearranger(); $swapped_arr = $rearranger->seekAndSwap($arr, $id, 'down'); + print_r($swapped_arr, false); $system->setResultsAll(json_encode($swapped_arr)); break; default: