-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeacherHomepageActivity.java
142 lines (115 loc) · 3.78 KB
/
TeacherHomepageActivity.java
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.example.musicappcsia;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
public class TeacherHomepageActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
private Button setHW;
private Button seeProgress;
private Button seeStudentScoreboard;
private Button seeTeacherScoreboard;
private Button teacherLogout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teacher_homepage);
//Buttons
setHW = (Button) findViewById(R.id.button_teacher_set_hw);
setHW.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
submitHWActivity();
}
});
seeProgress = (Button) findViewById(R.id.button_teacher_student_progress);
seeProgress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
studentProgressActivity();
}
});
seeStudentScoreboard = (Button) findViewById(R.id.button_teacher_student_scoreboard);
seeStudentScoreboard.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
teacherStudentScoreboardActivity();
}
});
seeTeacherScoreboard = (Button) findViewById(R.id.button_teacher_scoreboard);
seeTeacherScoreboard.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
teacherScoreboardActivity();
}
});
teacherLogout = (Button) findViewById(R.id.button_teacher_logout);
teacherLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
teacherLogoutActivity();
}
});
}
public void submitHWActivity() {
Intent scheduleIntent = new Intent(this, TeacherAssignHWActivity.class);
startActivity(scheduleIntent);
}
public void teacherScoreboardActivity(){
Intent scheduleIntent = new Intent(this, TeacherScoreBoardActivity.class);
startActivity(scheduleIntent);
}
public void studentProgressActivity(){
Intent scheduleIntent = new Intent(this, TeacherViewStudentProgressActivity.class);
startActivity(scheduleIntent);
}
public void teacherLogoutActivity(){
Intent scheduleIntent = new Intent(this, LoginActivity.class);
startActivity(scheduleIntent);
}
public void teacherStudentScoreboardActivity(){
Intent scheduleIntent = new Intent(this, StudentScoreboardActivity.class);
startActivity(scheduleIntent);
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
//int indexnum = (int) parent.getItemAtPosition(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
//method
public String printStudent(int x) {
String text = "";
if (x==0)
{
text = "Student 1";
}
if (x==1)
{
text = "Student 2";
}
if (x==2)
{
text = "Student 3";
}
if (x==3)
{
text = "Student 4";
}
if (x==4)
{
text = "Student 5";
}
if (x==5)
{
text = "Student 6";
}
if (x==6)
{
text = "Student 7";
}
return text;
}
}