JSFiddle - React, Tailwind, and code Playground
HTML
<div class="q1 question">
<form>
<input type="radio" name="q1" value="1">1
<input type="radio" name="q1" value="2">2
<input type="radio" name="q1" value="3">3
<input type="radio" name="q2" value="4">4</form>
</div>
<div class="q2 question">
<form>
<input type="radio" name="q2" value="1">1
<input type="radio" name="q2" value="2">2
<input type="radio" name="q2" value="3">3
<input type="radio" name="q2" value="4">4</form>
</div>
<div class="result"></div>
JavaScript
var $inputs = $('.question input[type=radio]').on('change', function () {
var total = 0;
$inputs.filter(':checked').each(function() {
total += +this.value;
})
$('.result').text(total);
});