From a6ba66b9af4079fc21867df364543f73695bcb26 Mon Sep 17 00:00:00 2001
From: LDprg <71488985+LDprg@users.noreply.github.com>
Date: Tue, 24 Jan 2023 17:42:59 +0100
Subject: [PATCH] fix some stuff
---
electron/dist/latest.yml | 14 +++++++-------
electron/package.json | 2 +-
src/app/home/home.page.html | 12 ++++++++++++
src/app/learning/learning.page.html | 8 ++++----
src/app/learning/learning.page.ts | 14 ++++++++++++++
5 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/electron/dist/latest.yml b/electron/dist/latest.yml
index c910a2e..849eb03 100644
--- a/electron/dist/latest.yml
+++ b/electron/dist/latest.yml
@@ -1,8 +1,8 @@
-version: 1.0.1
+version: 1.0.4
files:
- - url: learnify2-Setup-1.0.1.exe
- sha512: 2gMUlrYn1yXqRLZj+7OYogEXXxtd1A9ewjfbPCxGFINcFIVwrao+4Qmulx+hm7Nz3iQF2DUiRIunijRRzMBoGA==
- size: 74317283
-path: learnify2-Setup-1.0.1.exe
-sha512: 2gMUlrYn1yXqRLZj+7OYogEXXxtd1A9ewjfbPCxGFINcFIVwrao+4Qmulx+hm7Nz3iQF2DUiRIunijRRzMBoGA==
-releaseDate: '2023-01-22T18:08:29.532Z'
+ - url: learnify2-Setup-1.0.4.exe
+ sha512: +72JN+T4KziORyIMfRLU8NLsg9HHvzT+8uoeuL1vI5ZDHUcUYJ/6Ud8gD9QdC8Y6PW1FWJwPPe2v3EQVT/3VVw==
+ size: 74316023
+path: learnify2-Setup-1.0.4.exe
+sha512: +72JN+T4KziORyIMfRLU8NLsg9HHvzT+8uoeuL1vI5ZDHUcUYJ/6Ud8gD9QdC8Y6PW1FWJwPPe2v3EQVT/3VVw==
+releaseDate: '2023-01-24T16:06:49.932Z'
diff --git a/electron/package.json b/electron/package.json
index 8f31e49..4dce235 100644
--- a/electron/package.json
+++ b/electron/package.json
@@ -1,6 +1,6 @@
{
"name": "learnify2",
- "version": "1.0.1",
+ "version": "1.0.5",
"description": "An amazing learning App",
"author": {
"name": "Lukas Datler",
diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html
index b72c307..a32af4f 100644
--- a/src/app/home/home.page.html
+++ b/src/app/home/home.page.html
@@ -54,6 +54,18 @@
target="_blank">Patreon.
+
+
+ How to contribute Learnify?
+
+
+
+
+ You can contribute Learnify by creating an issue or pull request on Github.
+
+
diff --git a/src/app/learning/learning.page.html b/src/app/learning/learning.page.html
index 03ba60b..a4db105 100644
--- a/src/app/learning/learning.page.html
+++ b/src/app/learning/learning.page.html
@@ -21,7 +21,7 @@
-
- {{(this.index / this.data?.length) * 100}}%
+ {{this.floor((this.index / this.data?.length) * 100)}}%
@@ -117,17 +117,17 @@
- {{this.correctCount}} - {{100 * this.correctCount/this.index}}% Correct
+ {{this.correctCount}} - {{this.floor(100 * this.correctCount/this.index)}}% Correct
- {{this.skippedCount}} - {{100 * this.skippedCount/this.index}}% Skipped
+ {{this.skippedCount}} - {{this.floor(100 * this.skippedCount/this.index)}}% Skipped
- {{this.index - this.correctCount - this.skippedCount}} - {{100 * (this.index - this.correctCount - this.skippedCount)/this.index}}% Wrong
+ {{this.index - this.correctCount - this.skippedCount}} - {{this.floor(100 * (this.index - this.correctCount - this.skippedCount)/this.index)}}% Wrong
diff --git a/src/app/learning/learning.page.ts b/src/app/learning/learning.page.ts
index 6c59283..532c0fa 100644
--- a/src/app/learning/learning.page.ts
+++ b/src/app/learning/learning.page.ts
@@ -81,6 +81,10 @@ export class LearningPage implements OnInit, ViewWillEnter {
this.setFocus();
}
+ floor(value: number) {
+ return Math.round(value);
+ }
+
getQuestion() {
if (this.data !== undefined) {
return this.data[this.index].first;
@@ -143,6 +147,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}
checkAnswer() {
+ if (this.tempReadonly) return;
+
let answer = this.getAnswerText().trim();
let correct = this.getAnswer().trim();
@@ -166,6 +172,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}
enterAnswer() {
+ if (this.tempReadonly) return;
+
let answer = this.getAnswerText().trim();
let correct = this.getAnswer().trim();
@@ -186,6 +194,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}
skip() {
+ if (this.tempReadonly) return;
+
this.status = Status.Ask;
this.skippedCount++;
this.apiService.updateUserStats(this.id, this.data[this.index]._id, "skip");
@@ -194,6 +204,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}
changeWrong() {
+ if (this.tempReadonly) return;
+
this.status = Status.Ask;
this.correctCount++;
this.data[this.index].changed = true;
@@ -204,6 +216,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}
nextItem() {
+ if (this.tempReadonly) return;
+
this.answerText = "";
this.index++;