update
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
@ -1,5 +1,5 @@
|
||||||
import dataGripStore from 'ts/store/DataGrip';
|
import dataGripStore from 'ts/store/DataGrip';
|
||||||
import { getRandom, shuffle } from 'ts/helpers/random';
|
import { shuffle } from 'ts/helpers/random';
|
||||||
import localization from 'ts/helpers/Localization';
|
import localization from 'ts/helpers/Localization';
|
||||||
|
|
||||||
import IQuiz from '../interfaces/Quiz';
|
import IQuiz from '../interfaces/Quiz';
|
||||||
|
@ -20,17 +20,23 @@ function getQuestionByList(
|
||||||
return getQuestion(question, formattedAnswers, formattedAnswers.indexOf(rightAnswer));
|
return getQuestion(question, formattedAnswers, formattedAnswers.indexOf(rightAnswer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRandomDiff(value: number) {
|
||||||
|
return Math.random() > 0.5 ? value : -value;
|
||||||
|
}
|
||||||
|
|
||||||
function getQuestionByNumber(question: string, rightAnswer: number) {
|
function getQuestionByNumber(question: string, rightAnswer: number) {
|
||||||
let a, b;
|
let a, b;
|
||||||
if (rightAnswer < 3) {
|
if (rightAnswer < 3) {
|
||||||
a = rightAnswer + 1;
|
a = rightAnswer + 1;
|
||||||
b = rightAnswer + 2;
|
b = rightAnswer + 2;
|
||||||
} else {
|
} else {
|
||||||
a = rightAnswer + (getRandom(rightAnswer) * (Math.random() > 0.5 ? 1 : -1));
|
const step = rightAnswer > 10
|
||||||
b = rightAnswer + (getRandom(rightAnswer) * (Math.random() > 0.5 ? 1 : -1));
|
? Math.ceil(rightAnswer * 0.15)
|
||||||
if (a === b) return null;
|
: 1;
|
||||||
|
a = rightAnswer + getRandomDiff(step);
|
||||||
|
b = rightAnswer + getRandomDiff(step * 2);
|
||||||
}
|
}
|
||||||
const answers = shuffle([rightAnswer || 1, a || 1, b || 1]);
|
const answers = shuffle([rightAnswer, a, b]);
|
||||||
return getQuestion(question, answers, answers.indexOf(rightAnswer));
|
return getQuestion(question, answers, answers.indexOf(rightAnswer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import localization from 'ts/helpers/Localization';
|
import { t as _t } from 'ts/helpers/Localization';
|
||||||
import dataGripStore from 'ts/store/DataGrip';
|
import dataGripStore from 'ts/store/DataGrip';
|
||||||
import viewNameStore, { ViewNameEnum } from 'ts/store/ViewName';
|
import viewNameStore, { ViewNameEnum } from 'ts/store/ViewName';
|
||||||
import confirm from 'ts/components/ModalWindow/store/Confirm';
|
import confirm from 'ts/components/ModalWindow/store/Confirm';
|
||||||
|
@ -34,7 +34,7 @@ function getMenu(navigate: Function): any[] {
|
||||||
icon: './assets/menu/share.svg',
|
icon: './assets/menu/share.svg',
|
||||||
onClick() {
|
onClick() {
|
||||||
navigator.share({
|
navigator.share({
|
||||||
title: localization.get('common.title'),
|
title: _t('common.title'),
|
||||||
text: '',
|
text: '',
|
||||||
url: window.location.href,
|
url: window.location.href,
|
||||||
});
|
});
|
||||||
|
@ -46,7 +46,7 @@ function getMenu(navigate: Function): any[] {
|
||||||
icon: './assets/menu/logout.svg',
|
icon: './assets/menu/logout.svg',
|
||||||
onClick() {
|
onClick() {
|
||||||
confirm.open({
|
confirm.open({
|
||||||
title: 'Вы уверены что хотите выйти?',
|
title: _t('sidebar.buttons.logoutQuestion'),
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
dataGripStore.exit();
|
dataGripStore.exit();
|
||||||
navigate('/');
|
navigate('/');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode, useState, useEffect } from 'react';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
|
@ -81,7 +81,17 @@ const DesktopView = observer(({ children }: IPageWrapper): React.ReactElement =>
|
||||||
});
|
});
|
||||||
|
|
||||||
function PageWrapper({ children }: IPageWrapper) {
|
function PageWrapper({ children }: IPageWrapper) {
|
||||||
return isMobile
|
const [localIsMobile, setLocalIsMobile] = useState<boolean>(isMobile);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
function handleResize() {
|
||||||
|
setLocalIsMobile(window.innerWidth < 700 || isMobile);
|
||||||
|
}
|
||||||
|
window.addEventListener('resize', handleResize);
|
||||||
|
return () => window.removeEventListener('resize', handleResize);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return localIsMobile
|
||||||
? (<MobileView>{children}</MobileView>)
|
? (<MobileView>{children}</MobileView>)
|
||||||
: (<DesktopView>{children}</DesktopView>);
|
: (<DesktopView>{children}</DesktopView>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,8 @@ Wenn dies ein Fehler ist und die Statistiken für diesen Mitarbeiter berücksich
|
||||||
§ common.notifications.save: Änderungen gespeichert
|
§ common.notifications.save: Änderungen gespeichert
|
||||||
§ common.notifications.setting: Einstellungen gespeichert
|
§ common.notifications.setting: Einstellungen gespeichert
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Drucken
|
§ sidebar.buttons.print: Drucken
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: Die ganze Zeit
|
§ sidebar.filters.all: Die ganze Zeit
|
||||||
§ sidebar.filters.year: Jahr
|
§ sidebar.filters.year: Jahr
|
||||||
§ sidebar.filters.halfYear: ein halbes Jahr
|
§ sidebar.filters.halfYear: ein halbes Jahr
|
||||||
|
|
|
@ -29,4 +29,8 @@ If this is an error and this employee needs to be calculated as usual, go to the
|
||||||
§ common.notifications.save: The changes have been saved
|
§ common.notifications.save: The changes have been saved
|
||||||
§ common.notifications.setting: The settings have been saved
|
§ common.notifications.setting: The settings have been saved
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Print
|
§ sidebar.buttons.print: Print
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: all time
|
§ sidebar.filters.all: all time
|
||||||
§ sidebar.filters.year: year
|
§ sidebar.filters.year: year
|
||||||
§ sidebar.filters.halfYear: half year
|
§ sidebar.filters.halfYear: half year
|
||||||
|
|
|
@ -28,4 +28,8 @@ El trabajo de los colaboradores con este estatus en este proyecto puede desestim
|
||||||
§ common.notifications.save: Cambios guardados
|
§ common.notifications.save: Cambios guardados
|
||||||
§ common.notifications.setting: Ajustes guardados
|
§ common.notifications.setting: Ajustes guardados
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Impresión
|
§ sidebar.buttons.print: Impresión
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: a todas horas
|
§ sidebar.filters.all: a todas horas
|
||||||
§ sidebar.filters.year: año
|
§ sidebar.filters.year: año
|
||||||
§ sidebar.filters.halfYear: medio año
|
§ sidebar.filters.halfYear: medio año
|
||||||
|
|
|
@ -26,4 +26,8 @@ Si c’est une erreur et que la statistique pour ce collaborateur doit être pri
|
||||||
§ common.notifications.save: Modifications enregistrées
|
§ common.notifications.save: Modifications enregistrées
|
||||||
§ common.notifications.setting: Paramètres enregistrés
|
§ common.notifications.setting: Paramètres enregistrés
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Impression
|
§ sidebar.buttons.print: Impression
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: à toute heure
|
§ sidebar.filters.all: à toute heure
|
||||||
§ sidebar.filters.year: année
|
§ sidebar.filters.year: année
|
||||||
§ sidebar.filters.halfYear: demi-année
|
§ sidebar.filters.halfYear: demi-année
|
||||||
|
|
|
@ -26,4 +26,8 @@ export default `
|
||||||
§ common.notifications.save: 変更は保存されます
|
§ common.notifications.save: 変更は保存されます
|
||||||
§ common.notifications.setting: 設定が保存されます
|
§ common.notifications.setting: 設定が保存されます
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: 印刷
|
§ sidebar.buttons.print: 印刷
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: すべての時間
|
§ sidebar.filters.all: すべての時間
|
||||||
§ sidebar.filters.year: 年
|
§ sidebar.filters.year: 年
|
||||||
§ sidebar.filters.halfYear: 半年
|
§ sidebar.filters.halfYear: 半年
|
||||||
|
|
|
@ -26,4 +26,8 @@ export default `
|
||||||
§ common.notifications.save: 변경 사항이 저장됩니다
|
§ common.notifications.save: 변경 사항이 저장됩니다
|
||||||
§ common.notifications.setting: 설정이 저장됩니다
|
§ common.notifications.setting: 설정이 저장됩니다
|
||||||
§ common.fileLoader.notification: 파일 업로드 오류$1
|
§ common.fileLoader.notification: 파일 업로드 오류$1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: 인쇄
|
§ sidebar.buttons.print: 인쇄
|
||||||
§ sidebar.buttons.share: 그것을 공유
|
§ sidebar.buttons.share: 그것을 공유
|
||||||
§ sidebar.buttons.logout: 나가
|
§ sidebar.buttons.logout: 나가
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: 항상
|
§ sidebar.filters.all: 항상
|
||||||
§ sidebar.filters.year: 년
|
§ sidebar.filters.year: 년
|
||||||
§ sidebar.filters.halfYear: 반년
|
§ sidebar.filters.halfYear: 반년
|
||||||
|
|
|
@ -26,4 +26,8 @@ Se este for um erro e a estatística para esse funcionário precisar ser levada
|
||||||
§ common.notifications.save: Alterações salvas
|
§ common.notifications.save: Alterações salvas
|
||||||
§ common.notifications.setting: Configuração guardada
|
§ common.notifications.setting: Configuração guardada
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Impressão
|
§ sidebar.buttons.print: Impressão
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: o tempo todo
|
§ sidebar.filters.all: o tempo todo
|
||||||
§ sidebar.filters.year: ano
|
§ sidebar.filters.year: ano
|
||||||
§ sidebar.filters.halfYear: meio ano
|
§ sidebar.filters.halfYear: meio ano
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: Печать
|
§ sidebar.buttons.print: Печать
|
||||||
§ sidebar.buttons.share: Расшарить
|
§ sidebar.buttons.share: Расшарить
|
||||||
§ sidebar.buttons.logout: Выйти
|
§ sidebar.buttons.logout: Выйти
|
||||||
|
§ sidebar.buttons.logoutQuestion: Вы уверены что хотите выйти?
|
||||||
§ sidebar.filters.all: всё время
|
§ sidebar.filters.all: всё время
|
||||||
§ sidebar.filters.year: год
|
§ sidebar.filters.year: год
|
||||||
§ sidebar.filters.halfYear: пол года
|
§ sidebar.filters.halfYear: пол года
|
||||||
|
|
|
@ -26,4 +26,8 @@ export default `
|
||||||
§ common.notifications.save: 将保存更改
|
§ common.notifications.save: 将保存更改
|
||||||
§ common.notifications.setting: 设置被保存
|
§ common.notifications.setting: 设置被保存
|
||||||
§ common.fileLoader.notification: Cant open file $1
|
§ common.fileLoader.notification: Cant open file $1
|
||||||
|
§ common.confirm.title: Are you sure you want to remove it?
|
||||||
|
§ common.confirm.yes: Yes, I am sure.
|
||||||
|
§ common.confirm.no: Cancel
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default `
|
||||||
§ sidebar.buttons.print: 印刷业
|
§ sidebar.buttons.print: 印刷业
|
||||||
§ sidebar.buttons.share: Share
|
§ sidebar.buttons.share: Share
|
||||||
§ sidebar.buttons.logout: Logout
|
§ sidebar.buttons.logout: Logout
|
||||||
|
§ sidebar.buttons.logoutQuestion: Are you sure you want to clear data-set?
|
||||||
§ sidebar.filters.all: 一直
|
§ sidebar.filters.all: 一直
|
||||||
§ sidebar.filters.year: 年份
|
§ sidebar.filters.year: 年份
|
||||||
§ sidebar.filters.halfYear: 半年
|
§ sidebar.filters.halfYear: 半年
|
||||||
|
|