Skip to content

Commit

Permalink
fix some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
LDprg committed Jan 24, 2023
1 parent bf4b030 commit a6ba66b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
14 changes: 7 additions & 7 deletions electron/dist/latest.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "learnify2",
"version": "1.0.1",
"version": "1.0.5",
"description": "An amazing learning App",
"author": {
"name": "Lukas Datler",
Expand Down
12 changes: 12 additions & 0 deletions src/app/home/home.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
target="_blank">Patreon</a>.
</ion-card-subtitle>
</ion-item>
<ion-item>
<ion-card-title>
How to contribute Learnify?
</ion-card-title>
</ion-item>
<ion-item>
<ion-card-subtitle>
You can contribute Learnify by creating an issue or pull request on <a href="https://github.com/LDprg/learnify2"
rel="noopener noreferrer"
target="_blank">Github</a>.
</ion-card-subtitle>
</ion-item>
</ion-card-content>
</ion-card>
</ion-col>
Expand Down
8 changes: 4 additions & 4 deletions src/app/learning/learning.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-
</ion-label>
<ion-label>
{{(this.index / this.data?.length) * 100}}%
{{this.floor((this.index / this.data?.length) * 100)}}%
</ion-label>
<ion-label></ion-label>
<ion-label></ion-label>
Expand Down Expand Up @@ -117,17 +117,17 @@
<ion-row>
<ion-col>
<ion-item class="ion-text-center ion-text-wrap" color="success">
<ion-label>{{this.correctCount}} - {{100 * this.correctCount/this.index}}% Correct</ion-label>
<ion-label>{{this.correctCount}} - {{this.floor(100 * this.correctCount/this.index)}}% Correct</ion-label>
</ion-item>
</ion-col>
<ion-col>
<ion-item class="ion-text-center ion-text-wrap" color="warning">
<ion-label>{{this.skippedCount}} - {{100 * this.skippedCount/this.index}}% Skipped</ion-label>
<ion-label>{{this.skippedCount}} - {{this.floor(100 * this.skippedCount/this.index)}}% Skipped</ion-label>
</ion-item>
</ion-col>
<ion-col>
<ion-item class="ion-text-center ion-text-wrap" color="danger">
<ion-label>{{this.index - this.correctCount - this.skippedCount}} - {{100 * (this.index - this.correctCount - this.skippedCount)/this.index}}% Wrong</ion-label>
<ion-label>{{this.index - this.correctCount - this.skippedCount}} - {{this.floor(100 * (this.index - this.correctCount - this.skippedCount)/this.index)}}% Wrong</ion-label>
</ion-item>
</ion-col>
</ion-row>
Expand Down
14 changes: 14 additions & 0 deletions src/app/learning/learning.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand All @@ -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();

Expand All @@ -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");
Expand All @@ -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;
Expand All @@ -204,6 +216,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
}

nextItem() {
if (this.tempReadonly) return;

this.answerText = "";

this.index++;
Expand Down

0 comments on commit a6ba66b

Please sign in to comment.