-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressTracker.java
More file actions
66 lines (50 loc) · 1.98 KB
/
ProgressTracker.java
File metadata and controls
66 lines (50 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.util.*;
public class ProgressTracker {
private int questionsAsked;
private int studyPlansCreated;
private int motivationSessions;
private int totalSessions;
private int totalQuestions;
public ProgressTracker() {
this.questionsAsked = 0;
this.studyPlansCreated = 0;
this.motivationSessions = 0;
this.totalSessions = 1;
this.totalQuestions = 0;
}
public void recordQuestion() {
questionsAsked++;
totalQuestions++;
}
public void recordStudyPlan() {
studyPlansCreated++;
}
public void recordMotivation() {
motivationSessions++;
}
public void loadStats(DataHandler dataHandler) {
// Stats are loaded from file if exists
// For simplicity, we'll keep session-based tracking
}
public void saveStats(DataHandler dataHandler) {
dataHandler.saveStats(this);
}
public void displayStatistics() {
System.out.println(Colors.YELLOW + "\n📊 Current Session:" + Colors.RESET);
System.out.println(" Questions Asked: " + questionsAsked);
System.out.println(" Study Plans: " + studyPlansCreated);
System.out.println(" Motivation Sessions: " + motivationSessions);
System.out.println(Colors.YELLOW + "\n📈 Overall Statistics:" + Colors.RESET);
System.out.println(" Total Sessions: " + totalSessions);
System.out.println(" Total Questions: " + totalQuestions);
if (totalSessions > 0) {
System.out.println(" Avg Questions/Session: " + (totalQuestions / totalSessions));
}
}
// Getters
public int getQuestionsAsked() { return questionsAsked; }
public int getStudyPlansCreated() { return studyPlansCreated; }
public int getMotivationSessions() { return motivationSessions; }
public int getTotalSessions() { return totalSessions; }
public int getTotalQuestions() { return totalQuestions; }
}