Commit f653d175 authored by Kevin Robert's avatar Kevin Robert
Browse files

UNAPLLYREC-7 : Ajustement des questions ouvertes pour homogénéiser le...

UNAPLLYREC-7 : Ajustement des questions ouvertes pour homogénéiser le fonctionnement avec les autres items.
parent b350f857
......@@ -61,6 +61,15 @@ public class OpenQuestion extends Item implements ExportableItem {
return shortLabel;
}
@Override
public void validate() {
super.validate();
this.question = this.question.trim();
if (StringUtils.isBlank(this.shortLabel)) {
this.shortLabel = this.question;
}
}
@Override
public String getExportQuestionReference() {
return reference;
......
import { Component } from 'vue-property-decorator';
import { mixins } from 'vue-class-component';
import {Component} from 'vue-property-decorator';
import {mixins} from 'vue-class-component';
import ItemMixin from '@/components/screen-item/items/item-edit.mixin';
import OaInput from '@/components/forms/input/oa-input.vue';
import OaCheckbox from "@/components/forms/checkbox/oa-checkbox.vue";
import OaLabel from "@/components/forms/label/oa-label.vue";
@Component({
components: {
OaInput,
OaLabel,
OaCheckbox
}
})
......
<template>
<div>
<oa-input :label="$t('screen.item.openquestion.label')" :value="item.question" required="true" @update="editItem({ question: $event })" />
<oa-label :label="$t('screen.item.openquestion.label')" required="true" />
<textarea
:value="item.question"
@change="editItem({ question: $event.target.value })"
required="true"
class="w-full px-6 py-4 mb-8 text-lg transition bg-white border rounded-md outline-none ring-inset focus:ring"
/>
<oa-checkbox
:label="$t('screen.item.common.required')"
:value="item.required"
......
<template>
<!-- La barre d’outil permettant d’ajouter un contenu-->
<div class="flex items-start mb-6 bottom-4 p-2">
<oa-button
variant="icon"
icon-name="order-bool-ascending"
@click="addNewItem('radio')"
:title="$t('screen.toolbar.buttons.radio')"
></oa-button>
<oa-button
variant="icon"
icon-name="order-bool-ascending-variant"
@click="addNewItem('checkbox')"
:title="$t('screen.toolbar.buttons.checkbox')"
></oa-button>
<oa-button
variant="icon"
icon-name="form-textbox"
@click="addNewItem('openquestion')"
:title="$t('screen.toolbar.buttons.openquestion')"
></oa-button>
<oa-button variant="icon" icon-name="text-box" @click="addNewItem('message')" :title="$t('screen.toolbar.buttons.message')"></oa-button>
<oa-button variant="icon" icon-name="image" @click="addNewItem('picture')" :title="$t('screen.toolbar.buttons.picture')"></oa-button>
<oa-button
variant="icon"
icon-name="gesture-tap-button"
@click="addNewItem('button')"
:title="$t('screen.toolbar.buttons.button')"
></oa-button>
<div class="flex items-start mb-6 bottom-4 p-2 space-x-5">
<div>
<oa-button
variant="icon"
icon-name="order-bool-ascending"
@click="addNewItem('radio')"
:title="$t('screen.toolbar.buttons.radio')"
></oa-button>
<oa-button
variant="icon"
icon-name="order-bool-ascending-variant"
@click="addNewItem('checkbox')"
:title="$t('screen.toolbar.buttons.checkbox')"
></oa-button>
<oa-button
variant="icon"
icon-name="form-textbox"
@click="addNewItem('openquestion')"
:title="$t('screen.toolbar.buttons.openquestion')"
></oa-button>
</div>
<div>
<oa-button variant="icon" icon-name="text-box" @click="addNewItem('message')" :title="$t('screen.toolbar.buttons.message')"></oa-button>
<oa-button variant="icon" icon-name="image" @click="addNewItem('picture')" :title="$t('screen.toolbar.buttons.picture')"></oa-button>
<oa-button
variant="icon"
icon-name="gesture-tap-button"
@click="addNewItem('button')"
:title="$t('screen.toolbar.buttons.button')"
></oa-button>
</div>
</div>
</template>
......
<template>
<div>
<fieldset id="question-0" class="form__fieldset">
<fieldset class="form__fieldset">
<legend class="form__legend">{{ item.question }}<span v-if="item.required"> (*)</span></legend>
<textarea @change="updateAnswer" :value="item.answer"></textarea>
<textarea @change="updateAnswer" :value="item.answer" rows="4" cols="50"></textarea>
</fieldset>
</div>
</template>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment