-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestionsTable.html
More file actions
210 lines (187 loc) · 7.37 KB
/
Copy pathQuestionsTable.html
File metadata and controls
210 lines (187 loc) · 7.37 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Questins Table - CBT System</title>
<link rel="stylesheet" href="css/admin.css">
<script type="module" src="js/auth2.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="css/tableSearch.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="js/script.js"></script>
<script src="js/auth.js"></script>
<link rel="stylesheet" href="css/Tables.css">
</head>
<body>
<div class="dashboard-container">
<!-- Sidebar -->
<aside class="sidebar">
<div class="sidebar-header">
<img src="images/logo.png" alt="CBT System Icon">
<h2>CBT System</h2>
</div>
<nav class="sidebar-nav">
<ul>
<!-- Dashboard Dropdown -->
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-tachometer-alt"></i>
<span>Dashboard</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="SubAdmindashboard.html">Overview</a></li>
</ul>
</li>
<!-- Exam History Dropdown -->
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-history"></i>
<span>Exam History</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="CreateExam.html">Start Exam</a></li>
<li><a href="Grades.html">Grades & Scores</a></li>
<li><a href="OngoingExamTable.html">Ongoing Exams</a></li>
<li><a href="ExamTable.html">View All Exams</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-history"></i>
<span>Subject History</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="SubjectTable.html">View All Subjects</a></li>
</ul>
</li>
<!-- Student History Dropdown -->
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-history"></i>
<span>Student History</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="StudentTable.html">View Students</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-history"></i>
<span>Question History</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="QuestionsTable.html">View Questions</a></li>
</ul>
</li>
<!-- Profile Dropdown -->
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<i class="fas fa-user"></i>
<span>Profile</span>
<i class="fas fa-chevron-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="EditForm.html">Edit Info</a></li>
</ul>
</li>
<!-- Logout (No Dropdown) -->
<li>
<a id="logoutBtn" href="javascript:void(0)">
<i class="fas fa-sign-out-alt"></i>
<span>Logout</span>
</a>
</li>
</ul>
</nav>
</aside>
<!-- Main Content -->
<main class="main-content">
<header class="main-header">
<div class="header-left">
<h1>Questions</h1>
</div>
<div class="header-right">
<div class="notification-bell">
<i class="fas fa-bell"></i>
<span class="notification-count">3</span>
</div>
<div class="date-display">
<i class="fas fa-calendar-alt"></i>
<span id="currentDate">Loading...</span>
</div>
</div>
</header>
<!-- Charts Row -->
<div id = "toast" class="toast"></div>
<div id="errorMessage" style="color: red; display: none;"></div>
<!-- Recent Exams Table -->
<input class="search-bar" type="text" placeholder="Search for data & reports..." id="searchInput"/>
<select id="searchColumn" class="searchColumn">
<option value="all">Search Columns</option>
<!-- Options will be added dynamically -->
</select>
<div class="recent-exams">
<div class="section-header">
<h3>Registered Students</h3>
<input type="file" id="fileinput" style="display: none;">
</div>
<div class="table-container">
<table id="myTable">
<thead>
<tr >
<th>Subject Name</th>
</tr>
</thead>
<tbody id="QuestionsBody" class="table">
<!-- Will be populated by JavaScript -->
</tbody>
</table>
<h3 id="noResultsMessage" class="no-results">No results found</h3>
</div>
</div>
<div id="editModal" class="popup-wrapper">
<div class="popup-box">
<span class="popup-close" onclick="closeEditModal()">×</span>
<h3 class="popup-title">Edit Question</h3>
<input type="text" id="editLabel" class="popup-input" placeholder="Question text" />
<button class="popup-save-btn" onclick="editStudent(event)">Save Changes</button>
</div>
</div>
<div id="answerEditPopup" class="popup-wrapper">
<div class="popup-box">
<span class="popup-close" onclick="closeAnswerPopup()">×</span>
<h3 class="popup-title">Edit Answer</h3>
<input type="text" id="popupAnswerText" class="popup-input" placeholder="Answer text" />
<label class="popup-checkbox">
<input type="checkbox" id="popupIsCorrect" />
<span>Is Correct</span>
</label>
<button class="popup-save-btn" onclick="submitAnswerEdit()">Save Changes</button>
</div>
</div>
<!-- Quick Actions -->
</div>
</main>
</div>
<!-- Scripts -->
<script src="./js/Questions/GetAll.js" defer></script>
<script type="module">
import { setupTableSearch } from './js/tableSearch.js';
document.addEventListener("DOMContentLoaded", () => {
setupTableSearch({
inputId: "searchInput",
dropdownId: "searchColumn",
tableId: "myTable", // Add this ID to your <table>
bodyId: "QuestinsBody",
noResultsId: "noResultsMessage"
});
});
</script>
</body>
</html>