original_string: private function get_completion_detail($mod) {
          global $OUTPUT;
          $strings = [];
          switch ($mod->completion) {
              case COMPLETION_TRACKING_NONE:
                  $strings['string'] = get_string('none');
                  break;
  
              case COMPLETION_TRACKING_MANUAL:
                  $strings['string'] = get_string('manual', 'completion');
                  $strings['icon'] = $OUTPUT->pix_icon('i/completion-manual-y', get_string('completion_manual', 'completion'));
                  break;
  
              case COMPLETION_TRACKING_AUTOMATIC:
                  $strings['string'] = get_string('withconditions', 'completion');
                  $strings['icon'] = $OUTPUT->pix_icon('i/completion-auto-y', get_string('completion_automatic', 'completion'));
                  break;
  
              default:
                  $strings['string'] = get_string('none');
                  break;
          }
  
          // Get the descriptions for all the active completion rules for the module.
          if ($ruledescriptions = $this->get_completion_active_rule_descriptions($mod)) {
              foreach ($ruledescriptions as $ruledescription) {
                  $strings['string'] .= \html_writer::empty_tag('br') . $ruledescription;
              }
          }
          return $strings;
      }
code: private function get_completion_detail($mod) {
          global $OUTPUT;
          $strings = [];
          switch ($mod->completion) {
              case COMPLETION_TRACKING_NONE:
                  $strings['string'] = get_string('none');
                  break;
  
              case COMPLETION_TRACKING_MANUAL:
                  $strings['string'] = get_string('manual', 'completion');
                  $strings['icon'] = $OUTPUT->pix_icon('i/completion-manual-y', get_string('completion_manual', 'completion'));
                  break;
  
              case COMPLETION_TRACKING_AUTOMATIC:
                  $strings['string'] = get_string('withconditions', 'completion');
                  $strings['icon'] = $OUTPUT->pix_icon('i/completion-auto-y', get_string('completion_automatic', 'completion'));
                  break;
  
              default:
                  $strings['string'] = get_string('none');
                  break;
          }
  
          // Get the descriptions for all the active completion rules for the module.
          if ($ruledescriptions = $this->get_completion_active_rule_descriptions($mod)) {
              foreach ($ruledescriptions as $ruledescription) {
                  $strings['string'] .= \html_writer::empty_tag('br') . $ruledescription;
              }
          }
          return $strings;
      }
code_tokens: private function get_completion_detail ( $ mod ) { global $ OUTPUT ; $ strings = [ ] ; switch ( $ mod -> completion ) { case COMPLETION_TRACKING_NONE : $ strings [ 'string' ] = get_string ( 'none' ) ; break ; case COMPLETION_TRACKING_MANUAL : $ strings [ 'string' ] = get_string ( 'manual' , 'completion' ) ; $ strings [ 'icon' ] = $ OUTPUT -> pix_icon ( 'i/completion-manual-y' , get_string ( 'completion_manual' , 'completion' ) ) ; break ; case COMPLETION_TRACKING_AUTOMATIC : $ strings [ 'string' ] = get_string ( 'withconditions' , 'completion' ) ; $ strings [ 'icon' ] = $ OUTPUT -> pix_icon ( 'i/completion-auto-y' , get_string ( 'completion_automatic' , 'completion' ) ) ; break ; default : $ strings [ 'string' ] = get_string ( 'none' ) ; break ; } // Get the descriptions for all the active completion rules for the module. if ( $ ruledescriptions = $ this -> get_completion_active_rule_descriptions ( $ mod ) ) { foreach ( $ ruledescriptions as $ ruledescription ) { $ strings [ 'string' ] .= \ html_writer :: empty_tag ( 'br' ) . $ ruledescription ; } } return $ strings ; }
docstring: Get completion information on the selected module or module type
  
  @param cm_info|stdClass $mod either instance of cm_info (with 'customcompletionrules' in customdata) or
  object with fields ->completion, ->completionview, ->completionexpected, ->completionusegrade
  and ->customdata['customcompletionrules']
  @return array
docstring_tokens: Get completion information on the selected module or module type