Hi,
I fully agree with @holch, but if you want to do this, here an option.
To count the DKs (BTW I renamed these long QuestionCodes and set all DKs to '99')
{sum(countif('99',that.Q2a.NAOK,that.Q2c.NAOK),intval(Q2b_99.NAOK=="Y"))}
To show this with something like a popup you may use a bootstrap alert.
[url]
getbootstrap.com/docs/5.3/components/alerts/
[/url]
But this is up to you.
Mabe something like this
Code:
<div class="alert alert-warning" role="alert"><strong>Achtung! </strong>Sie haben {QRes} Mal mit "Don't know" geantwortet.</div>
<div class="alert alert-success" role="alert"><strong>Sehr gut! </strong>Sie haben nur {QRes} Mal mit "Don't know" geantwortet.</div>
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
$('.question-text .alert-success', thisQuestion).hide();
$('.question-text .alert-warning', thisQuestion).hide();
var wert='{QRes}';
if (wert>2) {
$('.question-text .alert-warning', thisQuestion).show();
} else {
$('.question-text .alert-success', thisQuestion).show();
}
setTimeout(function () {
$('.question-text .alert-success', thisQuestion).fadeOut(500);
$('.question-text .alert-warning', thisQuestion).fadeOut(500);
}, 5000);
});
</script>
And I won't discuss this further in English.
Joffm
BTW:
Can't you revise your conditions?
With numerical codes instead of text it is much shorter:
Qinviteincentive: Qinvitation.NAOK != 'Y
Qage: Qinvitation.NAOK != 'N' or Qinviteincentive.NAOK != 'N'
Demographics: Qage.NAOK >1