How can I display the total questions no and answers number?

Hello,

Suppose, I have 4 questions. When anyone answers 3 questions, it will display 3/4 . Now when all questions will be answered, it will be displayed 4/4.
Is it possible to display?
number ques

Note:

  1. All questions are not mandatory.
  2. It is not a repeatable (looped) questionnaire.

Thanks in Advanced

Assuming you know the total number of questions (4) [because this is tricky to calculate dynamically], you can determined the number of questions answered by:

number(${q1}!='') + number(${q2}!='') + number(${q3}!='') + ...

How it works: ${q1}!='' returns a boolean value true if the question is not empty - ie was answered - otherwise false. The XPath number() function converts true/false to 1/0, hence you add up all the non-null questions.

Have a play with this: count.xls (5.5 KB)

2 Likes

Excellent. It works perfectly. Thanks a lot Mr @Xiphware. You and your team are really awesome.