Advanced Programming

eRaay’s “Advanced Programming” module extends survey functionality by allowing developers to leverage JavaScript/jQuery and provides several built-in functions. These functions, detailed in the programmer’s guide, are primarily found in the custom.js file and are designed to implement custom functionality and dynamic survey behaviors.

Key built-in functions include:

  • Init(): Automatically called when the survey page loads for initialization logic.
  • AfterPiping(questionNo): Triggered after piping is applied, useful for updating elements based on piped options.
  • RandomizeQuestion(): Randomizes a sequence of consecutive questions.
  • ManagePrevBtnClick(): (If implemented) Triggered when the “Previous” button is clicked for specific logic or data rollback.
  • ManageNextBtnClick(questionNo, result): Triggered when the “Next” button is clicked, allowing for validations or navigation control.
  • PopulateSurveyInfo(): (Optional) Used to auto-fill survey-level data.
  • PresetValues(objThisInfo): Preselects values in questions based on external or pre-uploaded data.
  • ApplyCustomQuota(result, queNumber): Called before the “Next” button proceeds to validate quota limits based on custom logic.

Additionally, the guide details numerous predefined functions for specific functionalities such as:

  • Ranking: enableDragDropRanking, manageRankDisplay, validateRankSequence, clickRankHandler.
  • Randomization: randomizeMatrixRows, randomizeOptionsPreserveOrder, RandomizeQuestionSet.
  • Input Validation: IsNumeric, IsAlpha, validateCodeMapping, validateSequentialRanking.
  • Matrix Operations: calculateColumnTotal, getMatrixRowValues, getMatrixColumnValues, getMatrixCellValue, customizeMatrixQuestion, customizeMatrixQuestionInCell.

Checkbox Management: updateOptionToNota.

These functions provide a robust toolkit for survey programmers to extend eRaay’s capabilities beyond its standard features.
For more details, you can refer to the eRaay Survey Programmers Guide

Can't find an Answer?