original_string: public static function convert_flat_itemids_to_array($itemids) {
          $items = array();
  
          // We just have one single item id.
          if (is_int($itemids)) {
              $itemid = clean_param($itemids, PARAM_INT);
              $items[$itemid] = 1;
          } else {
              // Few grade items.
              $items = array_flip(explode(',', $itemids));
              foreach ($items as $itemid => $value) {
                  $itemid = clean_param($itemid, PARAM_INT);
                  $items[$itemid] = 1;
              }
          }
          return $items;
      }
code: public static function convert_flat_itemids_to_array($itemids) {
          $items = array();
  
          // We just have one single item id.
          if (is_int($itemids)) {
              $itemid = clean_param($itemids, PARAM_INT);
              $items[$itemid] = 1;
          } else {
              // Few grade items.
              $items = array_flip(explode(',', $itemids));
              foreach ($items as $itemid => $value) {
                  $itemid = clean_param($itemid, PARAM_INT);
                  $items[$itemid] = 1;
              }
          }
          return $items;
      }
code_tokens: public static function convert_flat_itemids_to_array ( $ itemids ) { $ items = array ( ) ; // We just have one single item id. if ( is_int ( $ itemids ) ) { $ itemid = clean_param ( $ itemids , PARAM_INT ) ; $ items [ $ itemid ] = 1 ; } else { // Few grade items. $ items = array_flip ( explode ( ',' , $ itemids ) ) ; foreach ( $ items as $ itemid => $ value ) { $ itemid = clean_param ( $ itemid , PARAM_INT ) ; $ items [ $ itemid ] = 1 ; } } return $ items ; }
docstring: Convert the item ids parameter into the required array to grade exporting class.
  
  In order to export, the array key must be the grade item id and all values must be one.
  
  @param string $itemids can be a single item id or many item ids comma separated.
  @return array $items correctly formatted array.
docstring_tokens: Convert the item ids parameter into the required array to grade exporting class .