original_string: public static function scale_used($scaleid, $workshopid=null) {
          global $DB;
  
          $conditions['grade'] = -$scaleid;
          if (!is_null($workshopid)) {
              $conditions['workshopid'] = $workshopid;
          }
          return $DB->record_exists('workshopform_accumulative', $conditions);
      }
code: public static function scale_used($scaleid, $workshopid=null) {
          global $DB;
  
          $conditions['grade'] = -$scaleid;
          if (!is_null($workshopid)) {
              $conditions['workshopid'] = $workshopid;
          }
          return $DB->record_exists('workshopform_accumulative', $conditions);
      }
code_tokens: public static function scale_used ( $ scaleid , $ workshopid = null ) { global $ DB ; $ conditions [ 'grade' ] = - $ scaleid ; if ( ! is_null ( $ workshopid ) ) { $ conditions [ 'workshopid' ] = $ workshopid ; } return $ DB -> record_exists ( 'workshopform_accumulative' , $ conditions ) ; }
docstring: Is a given scale used by the instance of workshop?
  
  @param int $scaleid id of the scale to check
  @param int|null $workshopid id of workshop instance to check, checks all in case of null
  @return bool
docstring_tokens: Is a given scale used by the instance of workshop?