Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions frontend/components/auth/FormLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default Vue.extend({

this.checkLoginDataValidity(lastLoginTime)
this.setLoginData(loginTime)
this.filterDailyQuestionnaireEveryday(currentDiffDay)
this.setFilledQuestionnaire(currentDiffDay)
} catch (error) {
console.error(error)
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export default Vue.extend({
this.setLogin({ isFirstLogin: false, lastLoginTime: loginTime })
}
},
filterDailyQuestionnaireEveryday(currentDiffDay: number) {
setFilledQuestionnaire(currentDiffDay: number) {
if (currentDiffDay > 0) {
const { filled } = this.getQuestionnaire
const dailyQuestionnaireId = '4'
Expand Down Expand Up @@ -303,20 +303,23 @@ export default Vue.extend({
if (this.isLoaded) {
await this.setUserData()
this.$nextTick(async () => {
const questionnaireStates = await this.$services.questionnaire.listFinishedQuestionnaires({
questionnaireTypeId: 1,
limit: 1
})
const questionnaireStates =
await this.$services.questionnaire.listFinishedQuestionnaires({
questionnaireTypeId: 1,
limit: 1
})
let firstQuestionnaireEverDate = null
if (questionnaireStates && questionnaireStates.items.length > 0) {
const firstQuestionnaireEver = questionnaireStates.items[0].finishedAt
firstQuestionnaireEverDate = moment(String(firstQuestionnaireEver)).format('DD-MM-YYYY')
firstQuestionnaireEverDate = moment(String(firstQuestionnaireEver)).format(
'DD-MM-YYYY'
)
}
await this.initQuestionnaire(firstQuestionnaireEverDate)
})
this.$router.push(this.localePath('/projects'))
}
}, 100)
}, 200)
})
}, 100)
} catch {
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/questionnaires/form/SliderInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{{ question }}
</span>
<span v-if="required && question" class="red--text">*</span>
<v-row align="start" justify="center">
<v-col cols="12" align="start">
<v-row align="center" justify="center">
<v-col cols="12">
<v-slider
v-model="sliderValue"
class="slider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const qTypes = [
{
name: "Sen (rano)",
language: "pl",
id: 13,
typeId: "4.1",
segments: [
{
Expand Down Expand Up @@ -63,6 +64,7 @@ export const qTypes = [
{
name: "Stres (rano)",
language: "pl",
id: 14,
typeId: "4.1",
segments: [
{
Expand Down Expand Up @@ -119,6 +121,7 @@ export const qTypes = [
{
name: "Stres (wieczorem)",
language: "pl",
id: 15,
typeId: "4.2",
segments: [
{
Expand Down Expand Up @@ -169,6 +172,7 @@ export const qTypes = [
{
name: "Zdrowie (wieczorem)",
language: "pl",
id: 16,
typeId: "4.2",
segments: [
{
Expand Down Expand Up @@ -217,6 +221,7 @@ export const qTypes = [
{
name: "Emocje (w przerwie)",
language: "pl",
id: 17,
typeId: "4.3",
segments: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const qTypes = [
name: "Ankieta na koniec badania",
language: "pl",
typeId: "5.1",
id: 18,
segments: [
{
questions: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const qTypes = [
{
name: "Ankieta zwrotna",
language: "pl",
id: 12,
typeId: "3.1",
type: "ankieta zwrotna",
description: "Celem ankiety jest zebranie informacji zwrotnej dotyczącej przeprowadzanego badania po to, aby móc ulepszyć procedury w przyszłości.",
Expand Down Expand Up @@ -37,6 +38,7 @@ export const qTypes = [
{
name: "Ankieta zwrotna",
language: "pl",
id: 12,
typeId: "3.2",
type: "ankieta zwrotna",
description: "Celem ankiety jest zebranie informacji zwrotnej dotyczącej przeprowadzanego badania po to, aby móc ulepszyć procedury w przyszłości.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const qTypes = [
{
name: "Ankieta po 2 tygodniach badania",
language: "pl",
id: 19,
typeId: "6.1",
segments: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const qTypes = [
{
name: "Kwestionariusz IPIP-BFM-20",
language: "pl",
id: 1,
typeId: "1.1",
type: "osobowość",
description: "Przeczytaj uważnie poniższe zdania, opisujące różne zachowania, uczucia i myśli ludzi. Zastanów się nad każdym z nich – w jakim stopniu opisuje ono również Ciebie takiego/taką, jakim/jaką zwykle jesteś? Ludzie są bardzo różni, więc nie ma tu dobrych ani złych odpowiedzi. Za każdym razem po prostu szczerze odpowiedz na pytanie, w jakim stopniu dane stwierdzenie opisuje Ciebie.",
Expand Down Expand Up @@ -184,6 +185,7 @@ export const qTypes = [
{
name: "Demografia",
type: "demografia",
id: 2,
typeId: "1.1",
language: "pl",
segments: [
Expand Down Expand Up @@ -530,6 +532,7 @@ export const qTypes = [
{
type: "humor",
name: "Humor Styles Questionnaire",
id: 3,
typeId: "1.1",
language: "pl",
segments: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
Each questionnaire has a unique id which corresponds to the utils/questionnaires.js and the backend


*/

export const qTypes = [
{
id: "2.1",
Expand All @@ -6,6 +12,7 @@ export const qTypes = [
{
name: "SWLS-A",
language: "pl",
id: 4,
typeId: "2.1",
type: "dobrostan: satysfakcja z życia",
segments: [
Expand Down Expand Up @@ -86,6 +93,7 @@ export const qTypes = [
{
name: "SPANE",
typeId: "2.1",
id: 5,
language: "pl",
type: "dobrostan: afekt",
segments: [
Expand Down Expand Up @@ -207,6 +215,7 @@ export const qTypes = [
{
name: "Skala Prosperowania",
typeId: "2.1",
id: 6,
language: "pl",
type: "dobrostan: skala prosperowania",
segments: [
Expand Down Expand Up @@ -308,6 +317,7 @@ export const qTypes = [
{
name: "Kwestionariusz PSS",
typeId: "2.1",
id: 8,
language: "pl",
type: "stres",
segments: [
Expand Down Expand Up @@ -415,6 +425,7 @@ export const qTypes = [
{
name: "List of RESS-EMA Items",
typeId: "2.1",
id: 10,
language: "pl",
type: "regulacja emocji",
segments: [
Expand Down Expand Up @@ -560,6 +571,7 @@ export const qTypes = [
{
name: "PAQ",
language: "pl",
id: 11,
typeId: "2.1",
type: "alexytymia",
segments: [
Expand Down Expand Up @@ -653,6 +665,7 @@ export const qTypes = [
{
name: "SWLS-A",
typeId: "2.2",
id: 4,
language: "pl",
type: "dobrostan: satysfakcja z życia",
segments: [
Expand Down Expand Up @@ -734,6 +747,7 @@ export const qTypes = [
name: "SPANE",
language: "pl",
typeId: "2.2",
id: 5,
type: "dobrostan: afekt",
segments: [
{
Expand Down Expand Up @@ -855,6 +869,7 @@ export const qTypes = [
name: "Skala Prosperowania",
language: "pl",
typeId: "2.2",
id: 6,
type: "dobrostan: skala prosperowania",
segments: [
{
Expand Down Expand Up @@ -956,6 +971,7 @@ export const qTypes = [
name: "Kwestionariusz Zdrowia Pacjenta PHQ-9 (PHQ-9)",
language: "pl",
typeId: "2.2",
id: 7,
type: "depresja",
segments: [
{
Expand Down Expand Up @@ -1052,6 +1068,7 @@ export const qTypes = [
name: "Kwestionariusz PSS",
language: "pl",
typeId: "2.2",
id: 8,
type: "stres",
segments: [
{
Expand Down Expand Up @@ -1159,6 +1176,7 @@ export const qTypes = [
name: "Physical Health Questionnaire",
language: "pl",
typeId: "2.2",
id: 9,
type: "zdrowie",
segments: [
{
Expand Down Expand Up @@ -1342,6 +1360,7 @@ export const qTypes = [
{
name: "List of RESS-EMA Items",
language: "pl",
id: 10,
typeId: "2.2",
type: "regulacja emocji",
segments: [
Expand Down Expand Up @@ -1488,6 +1507,7 @@ export const qTypes = [
name: "PAQ",
language: "pl",
typeId: "2.2",
id: 11,
type: "alexytymia",
segments: [
{
Expand Down
9 changes: 8 additions & 1 deletion frontend/utils/questionnaires.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const DATE_FORMAT = "DD-MM-YYYY HH:mm:ss"
const DATE_ONLY_FORMAT = "DD-MM-YYYY"
const SERVER_DATE_FORMAT = "YYYY-MM-DDTHH:mm:ss"

/*
Each questionnaire type has a list of questionnaire ids that corresponds to it.
The questionnaires for each type are listed in frontend/pages/questionnaires/{key}/questionnaires.js
For example, the questionnaires for type 1.1 are listed in frontend/pages/questionnaires/przed_badaniem/questionnaires.js
*/

export const qCategories = [
{
id: "1",
Expand All @@ -53,7 +59,7 @@ export const qCategories = [
id: "2.1",
name: "Przed i po badaniu (przed badaniem)",
count: 8,
questionnaires: [4, 5, 6, 7, 8, 9, 10, 11]
questionnaires: [4, 5, 6, 8, 10, 11]
},
{
id: "2.2",
Expand Down Expand Up @@ -397,6 +403,7 @@ export function getQuestionnairesToShow(firstQuestionnaireEverStr) {
console.error(error)
}


return toShow
}