Drag and Drop Question – Create logic with custom script

0

I have a drag and drop question with the last option being “Other”. I would like to have a follow up, Write-in for “What is the Other option you selected”.

I have tried using this example to show the page but have had no success – the page does not unhide, I jump to the next question:

// First hide the script page and the follow up question

sgapiHidePage(31,true); // script page
sgapiHidePage(30,true); // follow up question

// Then after the drag and drop question (ID:889) I find out if the Other (sku 13229 greater than 0) option was used and then show the follow up question on page 30:

%%rankings = sgapiGetValue(889);

foreach (%%rankings as %%key => %%value){
  if (%%value => ‘1’){
    if (%%key == ‘13229’){
    %%pageid = ’30’;
    }
  }
}

sgapiHidePage(%%pageid,false);

 

Any help here greatly appreciated.

Thanks so much,

Roger

Roger answered
    0

    I have it working with the following:

     

    sgapiHidePage(28,true); // follow up question for 889

     

    %%rankings = sgapiGetValue(889);
    //%%output .= sgapiPrint_R(%%rankings);

    foreach (%%rankings as %%key => %%value){
      if (%%value >= ‘1’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘2’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘3’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘4’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘5’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘6’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
      if (%%value >= ‘7’){
        if (%%key == ‘13229’){
        sgapiHidePage(28,false);
      }
    }
    }

    Roger answered
      ×

      Login

      Question stats

      • Active
      • Views357 times
      • Answers1 answer
      • Followers1 follower