kobotoolbox / kpi

kpi is the server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
133 stars 181 forks source link

"block of X questions" shows wrong count #1881

Open magicznyleszek opened 6 years ago

magicznyleszek commented 6 years ago

It happens because version doesn't match summary.

E.g. it says "block of 5 questions" but with "expand details" it shows only 4:

screen shot 2018-07-22 at 14 46 17

This is content JSON:

{
  "settings": {},
  "translations": [null],
  "choices": [{
    "$autovalue": "red",
    "list_name": "sz9bm13",
    "$kuid": "ZXhtOWymW",
    "name": "red",
    "label": ["Red"]
  }, {
    "$autovalue": "green",
    "list_name": "sz9bm13",
    "$kuid": "WPNQwothD",
    "name": "green",
    "label": ["Green"]
  }, {
    "$autovalue": "blue",
    "list_name": "sz9bm13",
    "$kuid": "2e4xTvBvr",
    "name": "blue",
    "label": ["Blue"]
  }, {
    "$autovalue": "option_1",
    "list_name": "yh5ue29",
    "$kuid": "YyQhcFOl3",
    "name": "option_1",
    "label": ["Because"]
  }, {
    "$autovalue": "option_2",
    "list_name": "yh5ue29",
    "$kuid": "zzJ5cP1sO",
    "name": "option_2",
    "label": ["Why not"]
  }, {
    "$autovalue": "here",
    "list_name": "aq0rf55",
    "$kuid": "xDOMqxYsl",
    "name": "here",
    "label": ["Here"]
  }, {
    "$autovalue": "there",
    "list_name": "aq0rf55",
    "$kuid": "1Q8xnpy0S",
    "name": "there",
    "label": ["There"]
  }, {
    "$autovalue": "nowhere",
    "list_name": "aq0rf55",
    "$kuid": "gMj7nNE4o",
    "name": "nowhere",
    "label": ["Nowhere"]
  }],
  "survey": [{
    "$autoname": "start",
    "$kuid": "LJMdkWIuJ",
    "type": "start",
    "name": "start"
  }, {
    "$autoname": "end",
    "$kuid": "Ww8HZy2xD",
    "type": "end",
    "name": "end"
  }, {
    "select_from_list_name": "sz9bm13",
    "name": "What_is_your_fav_channel",
    "$autoname": "What_is_your_fav_channel",
    "required": false,
    "label": ["What is your fav channel?"],
    "$kuid": "wItSeRiQF",
    "type": "select_multiple"
  }, {
    "select_from_list_name": "yh5ue29",
    "relevant": "selected(${What_is_your_fav_channel}, 'red') or selected(${What_is_your_fav_channel}, 'green') or selected(${What_is_your_fav_channel}, 'blue')",
    "name": "Why",
    "$autoname": "Why",
    "required": false,
    "label": ["Why?"],
    "$kuid": "IyzScL9cY",
    "type": "select_one"
  }, {
    "select_from_list_name": "aq0rf55",
    "relevant": "${Why} = 'option_1' and selected(${What_is_your_fav_channel}, 'red')",
    "name": "Where",
    "$autoname": "Where",
    "required": false,
    "label": ["Where?"],
    "$kuid": "JJO6yb275",
    "type": "select_one"
  }, {
    "relevant": "${Where} != 'nowhere'",
    "name": "Decimal",
    "$autoname": "Decimal",
    "required": false,
    "label": ["Decimal?"],
    "$kuid": "CwRjPeXN6",
    "type": "decimal"
  }, {
    "name": "__version__",
    "calculation": "'vejxVSXsC3vXxqAFR2U72h'",
    "$autoname": "__version__",
    "required": false,
    "$kuid": "IS8qeHuPw",
    "type": "calculate"
  }],
  "translated": ["label"],
  "schema": "1"
}
joshuaberetta commented 3 years ago

Related to #3356