original_string: public function load_cached($qubaids, $whichtries) {
          global $DB;
  
          $timemodified = time() - self::TIME_TO_CACHE;
          // Variable name 'analyses' is the plural of 'analysis'.
          $responseanalyses = $DB->get_records_select('question_response_analysis',
                                              'hashcode = ? AND whichtries = ? AND questionid = ? AND timemodified > ?',
                                              array($qubaids->get_hash_code(), $whichtries, $this->questiondata->id, $timemodified));
          if (!$responseanalyses) {
              return false;
          }
  
          $analysisids = array();
          foreach ($responseanalyses as $responseanalysis) {
              $analysisforsubpart = $this->analysis->get_analysis_for_subpart($responseanalysis->variant, $responseanalysis->subqid);
              $class = $analysisforsubpart->get_response_class($responseanalysis->aid);
              $class->add_response($responseanalysis->response, $responseanalysis->credit);
              $analysisids[] = $responseanalysis->id;
          }
          list($sql, $params) = $DB->get_in_or_equal($analysisids);
          $counts = $DB->get_records_select('question_response_count', "analysisid {$sql}", $params);
          foreach ($counts as $count) {
              $responseanalysis = $responseanalyses[$count->analysisid];
              $analysisforsubpart = $this->analysis->get_analysis_for_subpart($responseanalysis->variant, $responseanalysis->subqid);
              $class = $analysisforsubpart->get_response_class($responseanalysis->aid);
              $class->set_response_count($responseanalysis->response, $count->try, $count->rcount);
  
          }
          return $this->analysis;
      }
code: public function load_cached($qubaids, $whichtries) {
          global $DB;
  
          $timemodified = time() - self::TIME_TO_CACHE;
          // Variable name 'analyses' is the plural of 'analysis'.
          $responseanalyses = $DB->get_records_select('question_response_analysis',
                                              'hashcode = ? AND whichtries = ? AND questionid = ? AND timemodified > ?',
                                              array($qubaids->get_hash_code(), $whichtries, $this->questiondata->id, $timemodified));
          if (!$responseanalyses) {
              return false;
          }
  
          $analysisids = array();
          foreach ($responseanalyses as $responseanalysis) {
              $analysisforsubpart = $this->analysis->get_analysis_for_subpart($responseanalysis->variant, $responseanalysis->subqid);
              $class = $analysisforsubpart->get_response_class($responseanalysis->aid);
              $class->add_response($responseanalysis->response, $responseanalysis->credit);
              $analysisids[] = $responseanalysis->id;
          }
          list($sql, $params) = $DB->get_in_or_equal($analysisids);
          $counts = $DB->get_records_select('question_response_count', "analysisid {$sql}", $params);
          foreach ($counts as $count) {
              $responseanalysis = $responseanalyses[$count->analysisid];
              $analysisforsubpart = $this->analysis->get_analysis_for_subpart($responseanalysis->variant, $responseanalysis->subqid);
              $class = $analysisforsubpart->get_response_class($responseanalysis->aid);
              $class->set_response_count($responseanalysis->response, $count->try, $count->rcount);
  
          }
          return $this->analysis;
      }
code_tokens: public function load_cached ( $ qubaids , $ whichtries ) { global $ DB ; $ timemodified = time ( ) - self :: TIME_TO_CACHE ; // Variable name 'analyses' is the plural of 'analysis'. $ responseanalyses = $ DB -> get_records_select ( 'question_response_analysis' , 'hashcode = ? AND whichtries = ? AND questionid = ? AND timemodified > ?' , array ( $ qubaids -> get_hash_code ( ) , $ whichtries , $ this -> questiondata -> id , $ timemodified ) ) ; if ( ! $ responseanalyses ) { return false ; } $ analysisids = array ( ) ; foreach ( $ responseanalyses as $ responseanalysis ) { $ analysisforsubpart = $ this -> analysis -> get_analysis_for_subpart ( $ responseanalysis -> variant , $ responseanalysis -> subqid ) ; $ class = $ analysisforsubpart -> get_response_class ( $ responseanalysis -> aid ) ; $ class -> add_response ( $ responseanalysis -> response , $ responseanalysis -> credit ) ; $ analysisids [ ] = $ responseanalysis -> id ; } list ( $ sql , $ params ) = $ DB -> get_in_or_equal ( $ analysisids ) ; $ counts = $ DB -> get_records_select ( 'question_response_count' , "analysisid {$sql}" , $ params ) ; foreach ( $ counts as $ count ) { $ responseanalysis = $ responseanalyses [ $ count -> analysisid ] ; $ analysisforsubpart = $ this -> analysis -> get_analysis_for_subpart ( $ responseanalysis -> variant , $ responseanalysis -> subqid ) ; $ class = $ analysisforsubpart -> get_response_class ( $ responseanalysis -> aid ) ; $ class -> set_response_count ( $ responseanalysis -> response , $ count -> try , $ count -> rcount ) ; } return $ this -> analysis ; }
docstring: Retrieve the computed response analysis from the question_response_analysis table.
  
  @param \qubaid_condition $qubaids    load the analysis of which question usages?
  @param string            $whichtries load the analysis of which tries?
  @return analysis_for_question|boolean analysis or false if no cached analysis found.
docstring_tokens: Retrieve the computed response analysis from the question_response_analysis table .