Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Влад Якуб
Added: Oct 2, 2019 4:00 PM
Modified: Oct 2, 2019 4:11 PM
Views: 2
Tags: no tags
  1. if (in_array($qnum, [10,12,11,13,14,15 ])) {
  2.     $cols = $qconf['cols'];
  3.     $newCols = [];
  4.  
  5.     if (Rvar::get("q{$qnum}_cols_order")) {
  6.         $order = explode(',', Rvar::get("q{$qnum}_cols_order"));
  7.     } else {
  8.         $order = array_keys($qconf['cols']);
  9.  
  10.         shuffle($order);
  11.  
  12.         Rvar::set("q{$qnum}_cols_order", implode(',', $order));
  13.     }
  14.  
  15.     foreach ($order as $col) {
  16.         $newCols[$col] = $cols[$col];
  17.     }
  18.  
  19.     if (isset($cols[98])) {
  20.         unset($newCols[98]);
  21.         $newCols[98] = $cols[98];
  22.     }
  23.  
  24.     if (isset($cols[99])) {
  25.         unset($newCols[99]);
  26.         $newCols[99] = $cols[99];
  27.     }
  28.  
  29.     $qconf['cols'] = $newCols;
  30. }
  31.