Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ifQExistsCheckCat(Question,loopCat,innerQ,cat,IOM)
- '------------------------------------
- 'Version: 01
- 'Last modified on: 13/07/2018
- 'Last modified by: Denislav.Angelov@ipsos.com
- '------------------------------------
- 'Description:
- 'This function is designed to check:
- ' - If the desired question exists.
- ' - If certain categories exists for this question.
- ' - If certain answer is selected in the desired question.
- '------------------------------------
- ifQExistsCheckCat = false
- Question = cText(Question)
- 'Check if question exists. If it doesn't exists print message in Output.
- if not(isnullObject(FindItem(IOM.Questions,Question))) then
- 'Check question type.
- select case Question.QuestionDataType
- case 0 '<-- Loop
- 'Check if the seleceted categorie (loopCat) exists on this question.
- If not(isnullObject(FindItem(IOM.Questions,Question + "[" + cText(loopCat)+ "]" ))) then
- 'Checks if the question contains a certain answer (cat).
- if cat then
- if IOM.Questions[Question + "[" + cText(loopCat) + "]" ].Item[innerQ] * ccategorical(cat) then
- ifQExistsCheckCat = true
- exit function
- end if
- else
- ifQExistsCheckCat = true
- exit function
- end if
- End If
- case 1 to 3 '<-- Categorical,Text,Long
- if cat then
- 'Checks if the question contains a certain answer (cat).
- if Question * cat then
- ifQExistsCheckCat = true
- exit function
- end if
- else
- ifQExistsCheckCat = true
- exit function
- end if
- case else
- debug.MsgBox("Invalid question type.")
- end select
- else
- debug.Log(Question+" : the question does not exist in metadata")
- end if
- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement