original_string: protected function analyse_responses_for_questions($questions, $qubaids, $whichtries, $progress = null, $done = array()) {
          $countquestions = count($questions);
          if (!$countquestions) {
              return array();
          }
          if ($progress === null) {
              $progress = new \core\progress\none();
          }
          $progress->start_progress('', $countquestions, $countquestions);
          foreach ($questions as $question) {
              $progress->increment_progress();
              if (question_bank::get_qtype($question->qtype, false)->can_analyse_responses()  && !isset($done[$question->id])) {
                  $responesstats = new \core_question\statistics\responses\analyser($question, $whichtries);
                  if ($responesstats->get_last_analysed_time($qubaids, $whichtries) === false) {
                      $responesstats->calculate($qubaids, $whichtries);
                  }
              }
              $done[$question->id] = 1;
          }
          $progress->end_progress();
          return $done;
      }
code: protected function analyse_responses_for_questions($questions, $qubaids, $whichtries, $progress = null, $done = array()) {
          $countquestions = count($questions);
          if (!$countquestions) {
              return array();
          }
          if ($progress === null) {
              $progress = new \core\progress\none();
          }
          $progress->start_progress('', $countquestions, $countquestions);
          foreach ($questions as $question) {
              $progress->increment_progress();
              if (question_bank::get_qtype($question->qtype, false)->can_analyse_responses()  && !isset($done[$question->id])) {
                  $responesstats = new \core_question\statistics\responses\analyser($question, $whichtries);
                  if ($responesstats->get_last_analysed_time($qubaids, $whichtries) === false) {
                      $responesstats->calculate($qubaids, $whichtries);
                  }
              }
              $done[$question->id] = 1;
          }
          $progress->end_progress();
          return $done;
      }
code_tokens: protected function analyse_responses_for_questions ( $ questions , $ qubaids , $ whichtries , $ progress = null , $ done = array ( ) ) { $ countquestions = count ( $ questions ) ; if ( ! $ countquestions ) { return array ( ) ; } if ( $ progress === null ) { $ progress = new \ core \ progress \ none ( ) ; } $ progress -> start_progress ( '' , $ countquestions , $ countquestions ) ; foreach ( $ questions as $ question ) { $ progress -> increment_progress ( ) ; if ( question_bank :: get_qtype ( $ question -> qtype , false ) -> can_analyse_responses ( ) && ! isset ( $ done [ $ question -> id ] ) ) { $ responesstats = new \ core_question \ statistics \ responses \ analyser ( $ question , $ whichtries ) ; if ( $ responesstats -> get_last_analysed_time ( $ qubaids , $ whichtries ) === false ) { $ responesstats -> calculate ( $ qubaids , $ whichtries ) ; } } $ done [ $ question -> id ] = 1 ; } $ progress -> end_progress ( ) ; return $ done ; }
docstring: Analyse responses for an array of questions or sub questions.
  
  @param object[] $questions  as returned by self::load_and_initialise_questions_for_calculations.
  @param qubaid_condition $qubaids the question usages whose responses to analyse.
  @param string $whichtries which tries to analyse \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
  @param null|\core\progress\base $progress Used to indicate progress of task.
  @param int[] $done array keys are ids of questions that have been analysed before calling method.
  @return array array keys are ids of questions that were analysed after this method call.
docstring_tokens: Analyse responses for an array of questions or sub questions .