/**
  * Analyse the data from one question attempt.
  * @param question_attempt $qa the data to analyse.
  */
 protected function add_data_from_one_attempt(question_attempt $qa)
 {
     $blankresponse = question_classified_response::no_response();
     $partresponses = $qa->classify_response();
     foreach ($partresponses as $subpartid => $partresponse) {
         if (!isset($this->responses[$subpartid][$partresponse->responseclassid][$partresponse->response])) {
             $resp = new stdClass();
             $resp->count = 0;
             if (!is_null($partresponse->fraction)) {
                 $resp->fraction = $partresponse->fraction;
             } else {
                 $resp->fraction = $this->responseclasses[$subpartid][$partresponse->responseclassid]->fraction;
             }
             $this->responses[$subpartid][$partresponse->responseclassid][$partresponse->response] = $resp;
         }
         $this->responses[$subpartid][$partresponse->responseclassid][$partresponse->response]->count += 1;
     }
 }