This section is designed to collapse and expand in its default mode. It will close when the user selects "No" and open/close when the user selects "Yes".
I am looking to modify it so that it only closes when the user picks "No" and reopens only when the user chooses "Yes". If the user selects "Yes" again, it should remain in the open state.
jQuery('.btn-active').click(function(e) {
jQuery('.collapse').collapse('hide');
});
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<div class="container">
<div class="row">
<div class="col-12">
<div class="btn-group btn-group-toggle d-flex btn-active " data-toggle="buttons">
<label class="btn btn-primary w-100 active" data-toggle="collapse" data-target="#expolicy">
<input type="radio" name="options" id="option1" autocomplete="off"> Yes
</label>
<label class="btn btn-primary w-100">
<input type="radio" name="options" id="option2" autocomplete="off"> No
</label>
</div>
</div>
<div class="col-12">
<div class="collapse show" id="expolicy">
This is the collapsible content. It will only close when "No" is selected and reopen when "Yes" is chosen. It remains open by default.
</div>
</div>
</div>
</div>