original_string: protected function prepare_data_from_recordset($assessments) {
          $data = array();    // to be returned
          foreach ($assessments as $a) {
              $id = $a->assessmentid; // just an abbreviation
              if (!isset($data[$id])) {
                  $data[$id] = new stdclass();
                  $data[$id]->assessmentid = $a->assessmentid;
                  $data[$id]->weight       = $a->assessmentweight;
                  $data[$id]->reviewerid   = $a->reviewerid;
                  $data[$id]->gradinggrade = $a->gradinggrade;
                  $data[$id]->submissionid = $a->submissionid;
                  $data[$id]->dimgrades    = array();
              }
              $data[$id]->dimgrades[$a->dimensionid] = $a->grade;
          }
          return $data;
      }
code: protected function prepare_data_from_recordset($assessments) {
          $data = array();    // to be returned
          foreach ($assessments as $a) {
              $id = $a->assessmentid; // just an abbreviation
              if (!isset($data[$id])) {
                  $data[$id] = new stdclass();
                  $data[$id]->assessmentid = $a->assessmentid;
                  $data[$id]->weight       = $a->assessmentweight;
                  $data[$id]->reviewerid   = $a->reviewerid;
                  $data[$id]->gradinggrade = $a->gradinggrade;
                  $data[$id]->submissionid = $a->submissionid;
                  $data[$id]->dimgrades    = array();
              }
              $data[$id]->dimgrades[$a->dimensionid] = $a->grade;
          }
          return $data;
      }
code_tokens: protected function prepare_data_from_recordset ( $ assessments ) { $ data = array ( ) ; // to be returned foreach ( $ assessments as $ a ) { $ id = $ a -> assessmentid ; // just an abbreviation if ( ! isset ( $ data [ $ id ] ) ) { $ data [ $ id ] = new stdclass ( ) ; $ data [ $ id ] -> assessmentid = $ a -> assessmentid ; $ data [ $ id ] -> weight = $ a -> assessmentweight ; $ data [ $ id ] -> reviewerid = $ a -> reviewerid ; $ data [ $ id ] -> gradinggrade = $ a -> gradinggrade ; $ data [ $ id ] -> submissionid = $ a -> submissionid ; $ data [ $ id ] -> dimgrades = array ( ) ; } $ data [ $ id ] -> dimgrades [ $ a -> dimensionid ] = $ a -> grade ; } return $ data ; }
docstring: Prepares a structure of assessments and given grades
  
  @param array $assessments batch of recordset items as returned by the grading strategy
  @return array
docstring_tokens: Prepares a structure of assessments and given grades