original_string: public function check_word_count($submissiontext) {
          global $OUTPUT;
  
          $wordlimitenabled = $this->get_config('wordlimitenabled');
          $wordlimit = $this->get_config('wordlimit');
  
          if ($wordlimitenabled == 0) {
              return null;
          }
  
          // Count words and compare to limit.
          $wordcount = count_words($submissiontext);
          if ($wordcount <= $wordlimit) {
              return null;
          } else {
              $errormsg = get_string('wordlimitexceeded', 'assignsubmission_onlinetext',
                      array('limit' => $wordlimit, 'count' => $wordcount));
              return $OUTPUT->error_text($errormsg);
          }
      }
code: public function check_word_count($submissiontext) {
          global $OUTPUT;
  
          $wordlimitenabled = $this->get_config('wordlimitenabled');
          $wordlimit = $this->get_config('wordlimit');
  
          if ($wordlimitenabled == 0) {
              return null;
          }
  
          // Count words and compare to limit.
          $wordcount = count_words($submissiontext);
          if ($wordcount <= $wordlimit) {
              return null;
          } else {
              $errormsg = get_string('wordlimitexceeded', 'assignsubmission_onlinetext',
                      array('limit' => $wordlimit, 'count' => $wordcount));
              return $OUTPUT->error_text($errormsg);
          }
      }
code_tokens: public function check_word_count ( $ submissiontext ) { global $ OUTPUT ; $ wordlimitenabled = $ this -> get_config ( 'wordlimitenabled' ) ; $ wordlimit = $ this -> get_config ( 'wordlimit' ) ; if ( $ wordlimitenabled == 0 ) { return null ; } // Count words and compare to limit. $ wordcount = count_words ( $ submissiontext ) ; if ( $ wordcount <= $ wordlimit ) { return null ; } else { $ errormsg = get_string ( 'wordlimitexceeded' , 'assignsubmission_onlinetext' , array ( 'limit' => $ wordlimit , 'count' => $ wordcount ) ) ; return $ OUTPUT -> error_text ( $ errormsg ) ; } }
docstring: Compare word count of onlinetext submission to word limit, and return result.
  
  @param string $submissiontext Onlinetext submission text from editor
  @return string Error message if limit is enabled and exceeded, otherwise null
docstring_tokens: Compare word count of onlinetext submission to word limit and return result .