original_string: private function prediction_info(\core_analytics\prediction $prediction) {
          global $OUTPUT;
  
          $predictionactions = $this->target->prediction_actions($prediction, true, true);
  
          // For FORMAT_PLAIN.
          $fullmessageplaintext  = '';
  
          // For FORMAT_HTML.
          $messageactions  = [];
          $insighturl = null;
          foreach ($predictionactions as $action) {
              $actionurl = $action->get_url();
              if (!$actionurl->get_param('forwardurl')) {
  
                  $actiondoneurl = new \moodle_url('/report/insights/done.php');
                  // Set the forward url to the 'done' script.
                  $actionurl->param('forwardurl', $actiondoneurl->out(false));
              }
  
              if (empty($insighturl)) {
                  // We use the primary action url as insight url so we log that the user followed the provided link.
                  $insighturl = $action->get_url();
              }
              $actiondata = (object)['url' => $action->get_url()->out(false), 'text' => $action->get_text()];
              $fullmessageplaintext .= get_string('insightinfomessageaction', 'analytics', $actiondata) . PHP_EOL;
              $messageactions[] = $actiondata;
          }
  
          $fullmessagehtml = $OUTPUT->render_from_template('core_analytics/insight_info_message_prediction',
              ['actions' => $messageactions]);
          return [$insighturl, $fullmessageplaintext, $fullmessagehtml];
      }
code: private function prediction_info(\core_analytics\prediction $prediction) {
          global $OUTPUT;
  
          $predictionactions = $this->target->prediction_actions($prediction, true, true);
  
          // For FORMAT_PLAIN.
          $fullmessageplaintext  = '';
  
          // For FORMAT_HTML.
          $messageactions  = [];
          $insighturl = null;
          foreach ($predictionactions as $action) {
              $actionurl = $action->get_url();
              if (!$actionurl->get_param('forwardurl')) {
  
                  $actiondoneurl = new \moodle_url('/report/insights/done.php');
                  // Set the forward url to the 'done' script.
                  $actionurl->param('forwardurl', $actiondoneurl->out(false));
              }
  
              if (empty($insighturl)) {
                  // We use the primary action url as insight url so we log that the user followed the provided link.
                  $insighturl = $action->get_url();
              }
              $actiondata = (object)['url' => $action->get_url()->out(false), 'text' => $action->get_text()];
              $fullmessageplaintext .= get_string('insightinfomessageaction', 'analytics', $actiondata) . PHP_EOL;
              $messageactions[] = $actiondata;
          }
  
          $fullmessagehtml = $OUTPUT->render_from_template('core_analytics/insight_info_message_prediction',
              ['actions' => $messageactions]);
          return [$insighturl, $fullmessageplaintext, $fullmessagehtml];
      }
code_tokens: private function prediction_info ( \ core_analytics \ prediction $ prediction ) { global $ OUTPUT ; $ predictionactions = $ this -> target -> prediction_actions ( $ prediction , true , true ) ; // For FORMAT_PLAIN. $ fullmessageplaintext = '' ; // For FORMAT_HTML. $ messageactions = [ ] ; $ insighturl = null ; foreach ( $ predictionactions as $ action ) { $ actionurl = $ action -> get_url ( ) ; if ( ! $ actionurl -> get_param ( 'forwardurl' ) ) { $ actiondoneurl = new \ moodle_url ( '/report/insights/done.php' ) ; // Set the forward url to the 'done' script. $ actionurl -> param ( 'forwardurl' , $ actiondoneurl -> out ( false ) ) ; } if ( empty ( $ insighturl ) ) { // We use the primary action url as insight url so we log that the user followed the provided link. $ insighturl = $ action -> get_url ( ) ; } $ actiondata = ( object ) [ 'url' => $ action -> get_url ( ) -> out ( false ) , 'text' => $ action -> get_text ( ) ] ; $ fullmessageplaintext .= get_string ( 'insightinfomessageaction' , 'analytics' , $ actiondata ) . PHP_EOL ; $ messageactions [ ] = $ actiondata ; } $ fullmessagehtml = $ OUTPUT -> render_from_template ( 'core_analytics/insight_info_message_prediction' , [ 'actions' => $ messageactions ] ) ; return [ $ insighturl , $ fullmessageplaintext , $ fullmessagehtml ] ; }
docstring: Extracts info from the prediction for display purposes.
  
  @param  \core_analytics\prediction $prediction
  @return array Three items array with formats [\moodle_url, string, string]
docstring_tokens: Extracts info from the prediction for display purposes .