Commit b546bc474ac022210948c56133028521ce680379

Authored by Shikha Mishra
1 parent 275b17e4fb
Exists in master and in 1 other branch ui-design

Show functionality of course attendance while parent login

... ... @@ -416,7 +416,31 @@ const parentMenu = [{
416 416 click: e => {
417 417 // console.log(e);
418 418 }
419   -}];
  419 +},
  420 +{
  421 + title: 'Attendance',
  422 + group: 'Attendance',
  423 + component: 'Attendance',
  424 + icon: '/static/icon/attendence.png',
  425 + items: [
  426 + { name: 'courseAttendance', title: 'View Course Attendance', component: 'View Course Attendance', action: '', },
  427 + ]
  428 +},
  429 + // {
  430 + // path: '/CourseAttendance/:id',
  431 + // meta: {},
  432 + // name: 'View Course Attendance',
  433 + // props: (route) => ({
  434 + // type: route.query.type
  435 + // }),
  436 + // component: () =>
  437 + // import(
  438 + // /* webpackChunkName: "routes" */
  439 + // /* webpackMode: "lazy-once" */
  440 + // `@/pages/Attendence/viewCourseAttendance.vue`
  441 + // )
  442 + // },
  443 +];
420 444 // reorder menu
421 445 // Menu.forEach((item) => {
422 446 // if (item.items) {
... ...
src/pages/Attendence/viewCourseAttendance.vue
... ... @@ -12,6 +12,7 @@
12 12 <v-data-table :headers="headers" :items="courseAttendanceList">
13 13 <template slot="items" slot-scope="props">
14 14 <tr class="tr">
  15 + <td class="td td-row">{{ props.index + 1}}</td>
15 16 <td class="text-xs-center td td-row">{{ props.item.courseId.courseName}}</td>
16 17 <td class="text-xs-center td td-row">{{ props.item.startTime}}</td>
17 18 <td class="text-xs-center td td-row">{{ props.item.endTime }}</td>
... ... @@ -139,6 +140,12 @@ export default {
139 140 courseAttendanceList: [],
140 141 viewCourseAttendance: false,
141 142 headers: [
  143 + {
  144 + text: "No",
  145 + align: "",
  146 + sortable: false,
  147 + value: "index",
  148 + },
142 149 { text: "Course Name", value: "courseName", sortable: false, align: "center" },
143 150 {
144 151 text: "Start Time",
... ... @@ -166,11 +173,12 @@ export default {
166 173 return moment(date).format("MMMM DD, YYYY");
167 174 },
168 175 getStudentAttendence() {
169   - this.showLoader = true;
  176 + this.showLoader = true;
  177 + var studentId = localStorage.getItem("parentStudentId");
170 178 http()
171 179 .get(
172 180 "/studentAttendance",
173   - { params: { studentId: this.$route.params.id } },
  181 + { params: { studentId: studentId } },
174 182 {
175 183 headers: { Authorization: "Bearer " + this.token }
176 184 }
... ... @@ -189,10 +197,11 @@ export default {
189 197 });
190 198 },
191 199 getStudentData() {
  200 + var particularStudentId = localStorage.getItem("parentStudentId");
192 201 http()
193 202 .get(
194 203 "/getParticularStudentDetail",
195   - { params: { studentId: this.$route.params.id } },
  204 + { params: { studentId: particularStudentId } },
196 205 {
197 206 headers: { Authorization: "Bearer " + this.token }
198 207 }
... ... @@ -210,10 +219,11 @@ export default {
210 219 });
211 220 },
212 221 getCourseAttendance(classId) {
  222 + var particularCourseStudentId = localStorage.getItem("parentStudentId");
213 223 http()
214 224 .get(
215 225 "/getStudentCourseAttendance",
216   - { params: { studentId: this.$route.params.id,
  226 + { params: { studentId: particularCourseStudentId,
217 227 classId: classId }
218 228 },
219 229 {
... ...
src/pages/Dashboard/LiveOnlineClass.vue
... ... @@ -263,6 +263,7 @@ export default {
263 263 jitsi.innerHTML = "";
264 264 this.showStartSessionButton = true;
265 265 this.showJoinSessionButton = true;
  266 + this.updateCourseAttendance();
266 267 if (this.$store.state.role === "TEACHER") {
267 268 this.updateLiveClass();
268 269 }
... ... @@ -375,7 +376,6 @@ export default {
375 376 .post("/createCourseAttendance", attendenceData)
376 377 .then((response) => {
377 378 this.courseAttendanceId = response.data.data._id;
378   - this.updateCourseAttendance();
379 379 this.loading = false;
380 380 // this.snackbar = true;
381 381 // this.color = "green";
... ...