private static function is_allowed_field_set($toolconfig, $instanceconfig, $fields) {
        $isallowedstate = [];
        foreach ($fields as $key => $field) {
            $allowed = self::ALWAYS_INCLUDE_FIELD == $toolconfig->{$field};
            if (!$allowed) {
                if (self::DELEGATE_TO_INSTRUCTOR == $toolconfig->{$field} && !is_null($instanceconfig)) {
                    $allowed = $instanceconfig->{$field} == self::INSTRUCTOR_INCLUDED;
                }
            }
            $isallowedstate[$key] = $allowed;
        }
        return $isallowedstate;
    }