1
1
<template >
2
2
<v-container fluid >
3
-
4
3
<v-row >
5
4
<v-col >
6
5
<h3 >Individual Student Reports</h3 >
101
100
<h3 >Session Results</h3 >
102
101
</v-col >
103
102
</v-row >
104
- <v-row v-if =" userInfo.activeInstituteType === 'DISTRICT'" class =" mt-n6" >
103
+ <v-row
104
+ v-if =" userInfo.activeInstituteType === 'DISTRICT'"
105
+ class =" mt-n6"
106
+ >
105
107
<v-col >
106
108
<span
107
- style =" color : gray ;font-size : small "
108
- >
109
- Select a school and a session below to find the reports available for download.
110
- </span >
109
+ style =" color : gray ;font-size : small "
110
+ >
111
+ Select a school and a session below to find the reports available for download.
112
+ </span >
111
113
</v-col >
112
114
</v-row >
113
- <v-row v-else class =" mt-n6" >
115
+ <v-row
116
+ v-else
117
+ class =" mt-n6"
118
+ >
114
119
<v-col >
115
120
<span
116
- style =" color : gray ;font-size : small "
117
- >
118
- Select a session below to find the reports available for download.
119
- </span >
121
+ style =" color : gray ;font-size : small "
122
+ >
123
+ Select a session below to find the reports available for download.
124
+ </span >
120
125
</v-col >
121
126
</v-row >
122
127
123
128
<v-row class =" mt-n2" >
124
- <v-col cols =" 4" v-if =" userInfo.activeInstituteType === 'DISTRICT'" >
125
- <v-autocomplete
126
- id =" selectSchool"
127
- v-model =" schoolNameNumberFilter"
128
- variant =" underlined"
129
- :items =" schoolSearchNames"
130
- color =" #003366"
131
- label =" School Name or Number"
132
- single-line
133
- :clearable =" true"
134
- item-title =" schoolCodeName"
135
- item-value =" schoolCodeValue"
136
- autocomplete =" off"
137
- />
138
- </v-col >
129
+ <v-col
130
+ v-if =" userInfo.activeInstituteType === 'DISTRICT'"
131
+ cols =" 4"
132
+ >
133
+ <v-autocomplete
134
+ id =" selectSchool"
135
+ v-model =" schoolNameNumberFilter"
136
+ variant =" underlined"
137
+ :items =" schoolSearchNames"
138
+ color =" #003366"
139
+ label =" School Name or Number"
140
+ single-line
141
+ :clearable =" true"
142
+ item-title =" schoolCodeName"
143
+ item-value =" schoolCodeValue"
144
+ autocomplete =" off"
145
+ />
146
+ </v-col >
139
147
140
- <v-col cols =" 4" >
141
- <v-select
142
- id =" selectedSession"
143
- v-model =" selectedSessionID"
144
- variant =" underlined"
145
- :items =" sessionSearchNames"
146
- label =" Session"
147
- item-title =" sessionCodeName"
148
- item-value =" sessionCodeValue"
149
- :rules =" [rules.required()]"
150
- :clearable =" true"
151
- />
152
- </v-col >
148
+ <v-col cols =" 4" >
149
+ <v-select
150
+ id =" selectedSession"
151
+ v-model =" selectedSessionID"
152
+ variant =" underlined"
153
+ :items =" sessionSearchNames"
154
+ label =" Session"
155
+ item-title =" sessionCodeName"
156
+ item-value =" sessionCodeValue"
157
+ :rules =" [rules.required()]"
158
+ :clearable =" true"
159
+ />
160
+ </v-col >
153
161
</v-row >
154
162
<div :class =" { 'disabled-section': disableCondition }" >
155
163
<v-row
156
164
no-gutters
157
165
class =" d-flex"
158
166
>
159
- <v-card
160
- class =" mt-2 mr-4"
161
- width =" 30em"
162
- border =" sm"
163
- style =" border : 1px solid black ;border-radius : 10px ;"
164
- >
165
- <v-card-title style =" font-size : medium ;" >
166
- Assessment Results
167
- </v-card-title >
167
+ <v-card
168
+ class =" mt-2 mr-4"
169
+ width =" 30em"
170
+ border =" sm"
171
+ style =" border : 1px solid black ;border-radius : 10px ;"
172
+ >
173
+ <v-card-title style =" font-size : medium ;" >
174
+ Assessment Results
175
+ </v-card-title >
168
176
169
- <v-row class =" pl-3 pb-3" >
177
+ <v-row class =" pl-3 pb-3" >
170
178
<v-col cols =" 12" >
171
179
<DownloadLink
172
180
label =" Session Results.csv"
173
181
:download-action =" () => downloadDetailedDOARReport()"
174
182
/>
175
183
</v-col >
176
- </v-row >
177
- <v-row class =" pl-3 pb-3 mt-n6" >
184
+ </v-row >
185
+ <v-row class =" pl-3 pb-3 mt-n6" >
178
186
<v-col cols =" 12" >
179
187
<DownloadLink
180
188
label =" Session Results.xam"
181
- :download-action =" () => downloadDetailedDOARReport ()"
189
+ :download-action =" () => downloadXamFile ()"
182
190
/>
183
191
</v-col >
184
- </v-row >
185
- <v-row class =" pl-3 pb-3 mt-n6" >
192
+ </v-row >
193
+ <v-row class =" pl-3 pb-3 mt-n6" >
186
194
<v-col cols =" 12" >
187
195
<DownloadLink
188
196
label =" Session Results by Student.pdf"
189
- :download-action =" () => downloadDetailedDOARReport ()"
197
+ :download-action =" () => downloadStudentReport ()"
190
198
/>
191
199
</v-col >
192
- </v-row >
193
- <v-row class =" pl-3 pb-3 mt-n6" >
200
+ </v-row >
201
+ <v-row class =" pl-3 pb-3 mt-n6" >
194
202
<v-col cols =" 12" >
195
203
<DownloadLink
196
204
label =" Session Results by Assessment.pdf"
197
- :download-action =" () => downloadDetailedDOARReport ()"
205
+ :download-action =" () => downloadAssessmentResults ()"
198
206
/>
199
207
</v-col >
200
- </v-row >
201
- </v-card >
208
+ </v-row >
209
+ </v-card >
202
210
203
- <v-card
204
- class =" mt-2"
205
- width =" 30em"
206
- border =" sm"
207
- style =" border : 1px solid black ;border-radius : 10px ;"
208
- >
209
- <v-card-title style =" font-size : medium ;" >
210
- Distribution of Assessment Results (DOAR)
211
- </v-card-title >
211
+ <v-card
212
+ class =" mt-2"
213
+ width =" 30em"
214
+ border =" sm"
215
+ style =" border : 1px solid black ;border-radius : 10px ;"
216
+ >
217
+ <v-card-title style =" font-size : medium ;" >
218
+ Distribution of Assessment Results (DOAR)
219
+ </v-card-title >
212
220
<v-row class =" pl-3 pb-3" >
213
221
<v-col
214
222
cols =" 12"
229
237
/>
230
238
</v-col >
231
239
</v-row >
232
- </v-card >
240
+ </v-card >
233
241
</v-row >
234
242
</div >
235
243
236
- <div :class =" { 'disabled-section': !schoolNameNumberFilter }" >
237
-
238
- </div >
244
+ <div :class =" { 'disabled-section': !schoolNameNumberFilter }" />
239
245
</v-container >
240
246
</template >
241
247
@@ -283,6 +289,8 @@ export default {
283
289
rules: Rules,
284
290
schoolNameNumberFilter: null ,
285
291
schoolSearchNames: [],
292
+ selectedSessionID: null ,
293
+ isDistrictUser: false
286
294
};
287
295
},
288
296
computed: {
@@ -293,6 +301,9 @@ export default {
293
301
}
294
302
},
295
303
async created () {
304
+ authStore ().getUserInfo ().then (() => {
305
+ this .isDistrictUser = this .userInfo .activeInstituteType !== ' SCHOOL' ;
306
+ });
296
307
await this .getAllSessions ();
297
308
this .setupSchoolLists ();
298
309
},
@@ -304,22 +315,22 @@ export default {
304
315
this .schoolYearSessions = response .data .sort ((a , b ) =>
305
316
LocalDateTime .parse (b .activeUntilDate ).compareTo (LocalDateTime .parse (a .activeUntilDate ))
306
317
);
307
- }).catch ((error ) => {
308
- console .error (error);
309
- }).finally (() => {
310
- this .loading = false ;
311
- this .setupSessions ();
312
- });
318
+ }).catch ((error ) => {
319
+ console .error (error);
320
+ }).finally (() => {
321
+ this .loading = false ;
322
+ this .setupSessions ();
323
+ });
313
324
},
314
325
setupSessions () {
315
326
let sessions = [];
316
327
let sessionYearMinusTwo = LocalDate .now ().minusYears (2 ).year ();
317
328
this .schoolYearSessions ? .forEach ((session ) => {
318
329
if (parseInt (session .courseYear ) >= sessionYearMinusTwo){
319
330
sessions .push ({
320
- sessionCodeName: session .courseYear + ' /' + session .courseMonth ,
321
- sessionCodeValue: session .sessionID
322
- });
331
+ sessionCodeName: session .courseYear + ' /' + session .courseMonth ,
332
+ sessionCodeValue: session .sessionID
333
+ });
323
334
}
324
335
});
325
336
this .sessionSearchNames = sortBy (sessions, [' sessionCourseYear' ,' sessionCourseMonth' ]);
@@ -358,7 +369,7 @@ export default {
358
369
if (error? .response ? .data ? .message ) {
359
370
this .setErrorAlert (error? .response ? .data ? .message );
360
371
} else {
361
- this .setErrorAlert (` PEN must be a valid.` );
372
+ this .setErrorAlert (' PEN must be a valid.' );
362
373
}
363
374
}).finally (() => {
364
375
this .isSearchingStudent = false ;
@@ -378,7 +389,20 @@ export default {
378
389
379
390
},
380
391
async downloadXamFile () {
381
-
392
+ this .isLoading = true ;
393
+ try {
394
+ const url = ` ${ ApiRoutes .assessments .BASE_REPORTS_URL } /${ this .userInfo .activeInstituteType } /${ this .selectedSessionID } /school/${ this .schoolNameNumberFilter } /download` ;
395
+ window .open (url);
396
+ } catch (error) {
397
+ console .error (error);
398
+ this .setFailureAlert (
399
+ error? .response ? .data ? .message
400
+ ? error? .response ? .data ? .message
401
+ : ' An error occurred while trying to retrieve your school\' s report.'
402
+ );
403
+ } finally {
404
+ this .isLoading = false ;
405
+ }
382
406
},
383
407
async downloadGradProjections (){
384
408
0 commit comments