Skip to content
Extraits de code Groupes Projets
Valider f6fcfdee rédigé par Brieuc Dubois's avatar Brieuc Dubois
Parcourir les fichiers

Dev

parent 1f81fe50
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!21Dev
Affichage de
avec 36 ajouts et 8 suppressions
......@@ -222,6 +222,7 @@ class SurveyGroup(Base):
id = Column(Integer, primary_key=True, index=True)
title = Column(String)
demo = Column(String, default=False)
questions = relationship(
"SurveyQuestion", secondary="survey_group_questions", backref="group"
)
......
......@@ -245,12 +245,14 @@ class SurveyQuestion(BaseModel):
class SurveyGroupCreate(BaseModel):
id: int | None = None
title: str
demo: bool
questions: list[SurveyQuestionCreate] = []
class SurveyGroup(BaseModel):
id: int
title: str
demo: bool
questions: list[SurveyQuestion]
......
......@@ -105,6 +105,7 @@
"NonUni": "Non-university degree",
"Bachelor": "Bachelor's degree",
"Master": "Master's degree or above"
}
},
"example": "Sample"
}
}
......@@ -219,7 +219,8 @@
"NonUni": "Diplôme non universitaire",
"Bachelor": "Bachelier",
"Master": "Master ou diplôme supérieur"
}
},
"example": "Exemple"
},
"users": {
"nickname": "Nom",
......
......@@ -5,12 +5,20 @@ export default class SurveyGroup {
private _id: number;
private _survey_id: number;
private _title: string;
private _demo: boolean;
private _questions: SurveyQuestion[];
constructor(id: number, survey_id: number, title: string, questions: SurveyQuestion[]) {
constructor(
id: number,
survey_id: number,
title: string,
demo: boolean,
questions: SurveyQuestion[]
) {
this._id = id;
this._survey_id = survey_id;
this._title = title;
this._demo = demo;
this._questions = questions;
}
......@@ -26,6 +34,10 @@ export default class SurveyGroup {
return this._title;
}
get demo(): boolean {
return this._demo;
}
get questions(): SurveyQuestion[] {
return this._questions;
}
......@@ -38,7 +50,7 @@ export default class SurveyGroup {
const questions = SurveyQuestion.parseAll(data.questions);
return new SurveyGroup(data.id, data.survey_id, data.title, questions);
return new SurveyGroup(data.id, data.survey_id, data.title, data.demo, questions);
}
static parseAll(data: any): SurveyGroup[] {
......
......@@ -194,7 +194,7 @@
>
<div class="rounded-full mx-2 chat-image size-12" title={message.user.nickname}>
<img
src={`https://gravatar.com/avatar/${user.emailHash}?d=identicon`}
src={`https://gravatar.com/avatar/${message.user.emailHash}?d=identicon`}
alt={user.nickname}
class="rounded-full border border-neutral-400 text-sm"
/>
......@@ -280,7 +280,9 @@
</button>
{/if}
<button
class="absolute bottom-0 left-[-3.5rem] invisible group-hover:visible h-full p-0"
class="absolute bottom-0 invisible group-hover:visible h-full p-0"
class:right-[-1.5rem]={!isSender}
class:left-[-3.5rem]={isSender}
onclick={() => (replyTo = message)}
>
<Icon src={ArrowUturnLeft} class="w-5 h-full text-gray-500 hover:text-gray-800" />
......@@ -296,7 +298,6 @@
{/if}
</div>
</div>
<div
class="absolute invisible rounded-xl border border-gray-400 bg-white divide-x"
bind:this={hightlight}
......
......@@ -96,6 +96,11 @@
async function sendGap() {
if (!gaps) return;
if (!currentGroup.demo) {
const gapTexts = gaps
.filter((part) => part.gap !== null)
.map((part) => part.gap)
.join('|');
const gapTexts = gaps
.filter((part) => part.gap !== null)
......@@ -232,7 +237,12 @@
</div>
</div>
{:else if step == 2}
{#if type == 'gap' && gaps}
{#if currentGroup.demo}
<div class="mx-auto mt-10 text-center">
<p class="text-center font-bold text-xl m-auto">{$t('surveys.example')}</p>
</div>
{/if}
{#if type == 'gap'}
<div class="mx-auto mt-16 center flex flex-col">
<div>
{#each gaps as part}
......
frontend/static/surveys/items/1000/1.jpeg

334 ko

frontend/static/surveys/items/1000/2.jpeg

267 ko

frontend/static/surveys/items/1000/3.jpeg

261 ko

frontend/static/surveys/items/1000/4.jpeg

318 ko

Fichier ajouté
frontend/static/surveys/items/1001/1.jpeg

50 ko

frontend/static/surveys/items/1001/2.jpeg

51,4 ko

frontend/static/surveys/items/1001/3.jpeg

50,1 ko

frontend/static/surveys/items/1001/4.jpeg

51 ko

Fichier ajouté
frontend/static/surveys/items/1002/1.jpeg

45,9 ko

frontend/static/surveys/items/1002/2.jpeg

48,9 ko

frontend/static/surveys/items/1002/3.jpeg

43,1 ko

0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter