original_string: protected function count_hints_on_form($formdata, $withparts) {
          if (!empty($formdata->hint)) {
              $numhints = max(array_keys($formdata->hint)) + 1;
          } else {
              $numhints = 0;
          }
  
          if ($withparts) {
              if (!empty($formdata->hintclearwrong)) {
                  $numclears = max(array_keys($formdata->hintclearwrong)) + 1;
              } else {
                  $numclears = 0;
              }
              if (!empty($formdata->hintshownumcorrect)) {
                  $numshows = max(array_keys($formdata->hintshownumcorrect)) + 1;
              } else {
                  $numshows = 0;
              }
              $numhints = max($numhints, $numclears, $numshows);
          }
          return $numhints;
      }
code: protected function count_hints_on_form($formdata, $withparts) {
          if (!empty($formdata->hint)) {
              $numhints = max(array_keys($formdata->hint)) + 1;
          } else {
              $numhints = 0;
          }
  
          if ($withparts) {
              if (!empty($formdata->hintclearwrong)) {
                  $numclears = max(array_keys($formdata->hintclearwrong)) + 1;
              } else {
                  $numclears = 0;
              }
              if (!empty($formdata->hintshownumcorrect)) {
                  $numshows = max(array_keys($formdata->hintshownumcorrect)) + 1;
              } else {
                  $numshows = 0;
              }
              $numhints = max($numhints, $numclears, $numshows);
          }
          return $numhints;
      }
code_tokens: protected function count_hints_on_form ( $ formdata , $ withparts ) { if ( ! empty ( $ formdata -> hint ) ) { $ numhints = max ( array_keys ( $ formdata -> hint ) ) + 1 ; } else { $ numhints = 0 ; } if ( $ withparts ) { if ( ! empty ( $ formdata -> hintclearwrong ) ) { $ numclears = max ( array_keys ( $ formdata -> hintclearwrong ) ) + 1 ; } else { $ numclears = 0 ; } if ( ! empty ( $ formdata -> hintshownumcorrect ) ) { $ numshows = max ( array_keys ( $ formdata -> hintshownumcorrect ) ) + 1 ; } else { $ numshows = 0 ; } $ numhints = max ( $ numhints , $ numclears , $ numshows ) ; } return $ numhints ; }
docstring: Count number of hints on the form.
  Overload if you use custom hint controls.
  @param object $formdata the data from the form.
  @param bool $withparts whether to take into account clearwrong and shownumcorrect options.
  @return int count of hints on the form.
docstring_tokens: Count number of hints on the form . Overload if you use custom hint controls .