<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#assign uiLabelMap = Static["org.ofbiz.base.util.UtilProperties"].getResourceBundleMap("CommonUiLabels", locale)>

${survey.description?if_exists}


<#list surveyQuestionAndAppls as surveyQuestionAndAppl> <#-- special formatting for select boxes --> <#assign align = "left"> <#if (surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN" || surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION")> <#assign align = "right"> <#-- get an answer from the answerMap --> <#if surveyAnswers?has_content> <#assign answer = surveyAnswers.get(surveyQuestionAndAppl.surveyQuestionId)?if_exists> <#-- get the question results --> <#if surveyResults?has_content> <#assign results = surveyResults.get(surveyQuestionAndAppl.surveyQuestionId)?if_exists> <#-- seperator options --> <#if surveyQuestionAndAppl.surveyQuestionTypeId == "SEPERATOR_TEXT"> <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "SEPERATOR_LINE"> <#else> <#-- standard question options -->
${surveyQuestionAndAppl.question?if_exists}

<#assign answerString = "answers"> <#if (results._total?default(0) == 1)> <#assign answerString = "answer">
${surveyQuestionAndAppl.question?if_exists} (${results._total?default(0)?string.number} ${answerString})
<#if surveyQuestionAndAppl.hint?has_content>
${surveyQuestionAndAppl.hint}
  <#if surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN"> <#assign selectedOption = (answer.booleanResponse)?default("Y")>
<#if "Y" == selectedOption>==> ${uiLabelMap.CommonY}<#if "Y" == selectedOption> [${results._yes_total?default(0)?string("#")} / ${results._yes_percent?default(0)?string("#")}%]
<#if "N" == selectedOption>==> N<#if "N" == selectedOption> [${results._no_total?default(0)?string("#")} / ${results._no_percent?default(0)?string("#")}%]
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXTAREA">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_SHORT">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_LONG">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "EMAIL">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "URL">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "DATE">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "CREDIT_CARD">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "GIFT_CARD">
${(answer.textResponse)?if_exists}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_CURRENCY">
${answer.currencyResponse?number?default(0)}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_FLOAT">
${answer.floatResponse?number?default(0)?string("#")}
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_LONG">
${answer.numericResponse?number?default(0)?string("#")} [${uiLabelMap.CommonTally}: ${results._tally?default(0)?string("#")} / ${uiLabelMap.CommonAverage}: ${results._average?default(0)?string("#")}]
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "PASSWORD">
[${uiLabelMap.CommonNotShown}]
<#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "CONTENT"> <#if answer.contentId?has_content> <#assign content = answer.getRelatedOne("Content")> ${answer.contentId} - ${content.contentName?if_exists} <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION"> <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", sequenceSort)?if_exists> <#assign selectedOption = (answer.surveyOptionSeqId)?default("_NA_")> <#if options?has_content> <#list options as option> <#assign optionResults = results.get(option.surveyOptionSeqId)?if_exists>
<#if option.surveyOptionSeqId == selectedOption>==>  ${option.description?if_exists} <#if option.surveyOptionSeqId == selectedOption>  [${optionResults._total?default(0)?string("#")} / ${optionResults._percent?default(0?string("#"))}%]
<#else>
${uiLabelMap.EcommerceUnsupportedQuestionType}: ${surveyQuestionAndAppl.surveyQuestionTypeId}