{#if show} {#if question} {#key question.id} {question.header} {#if questions.length > 1} {questionIndex + 1}/{questions.length} {/if} {question.question} {#each question.options || [] as option, optionIndex} selectOption(question, option, optionIndex)} > {option.label} {option.description} {#if optionIndex === 0} {$i18n.t('Recommended')} {/if} {/each} {#if questionAllowsOther(question)} {$i18n.t('Other')} selectOther(question)} on:input={(event) => updateOther(question, (event.currentTarget as HTMLInputElement).value)} on:keydown={(event) => { if (event.key === 'Enter') { event.preventDefault(); advance(); } }} /> {/if} {/key} {/if} {$i18n.t('Cancel')} (questionIndex -= 1)} > {$i18n.t('Previous')} {#if questionIndex < questions.length - 1} (questionIndex += 1)} > {$i18n.t('Next')} {:else} submit()} > {$i18n.t('Submit answers')} {/if} {/if}