@@ -9,52 +9,56 @@ class AssignmentGradeReport extends React.Component {
99 super ( props ) ;
1010
1111 this . state = {
12- GradeReportRoot : null ,
12+ GradeReportRoot : null ,
1313 loaded : false
1414 } ;
1515 }
1616
17- componentDidMount ( ) {
18- apiCall . get ( `/sectionUserInfo/${ this . props . UserID } /${ this . props . sectionID } ` , ( err , res , body ) => {
17+ componentDidMount ( ) {
18+ apiCall . get ( `/sectionUserInfo/${ this . props . UserID } /${ this . props . sectionID } ` , ( err , res , body ) => {
1919 let sectionuserId = body . Info . SectionUserID ;
20- if ( body . Info . Role === "Student" ) {
21- apiCall . post ( `/studentGradeReport` , { ai_id :this . props . AI_ID , sectionUserID :sectionuserId } , ( err , status , body ) => {
22- if ( status . statusCode === 200 ) {
20+ if ( body . Info . Role === "Student" ) {
21+ apiCall . post ( `/studentGradeReport` , { ai_id : this . props . AI_ID , sectionUserID : sectionuserId } , ( err , status , body ) => {
22+ if ( status . statusCode === 200 ) {
2323 console . log ( body ) ;
24- this . setState ( { GradeReportRoot :body . assignmentStudentGradeReport ,
25- loaded :true } ) ;
24+ this . setState ( {
25+ GradeReportRoot : body . assignmentStudentGradeReport ,
26+ loaded : true
27+ } ) ;
2628 }
2729 } ) ;
28- } else if ( body . Info . Role === "Instructor" ) {
29- apiCall . post ( `/gradeReport` , { ai_id :this . props . AI_ID } , ( err , status , body ) => {
30- if ( status . statusCode === 200 ) {
30+ } else if ( body . Info . Role === "Instructor" ) {
31+ apiCall . post ( `/gradeReport` , { ai_id : this . props . AI_ID } , ( err , status , body ) => {
32+ if ( status . statusCode === 200 ) {
3133 console . log ( body ) ;
32- this . setState ( { GradeReportRoot :body . assignmentGradeReport ,
33- loaded :true } ) ;
34+ this . setState ( {
35+ GradeReportRoot : body . assignmentGradeReport ,
36+ loaded : true
37+ } ) ;
3438 }
3539 } ) ;
3640 }
3741 } ) ;
3842 }
3943
40- displayProblemGradeReport ( workflowData , username , userGrade ) {
44+ displayProblemGradeReport ( workflowData , username , userGrade ) {
4145 console . log ( "Problem/Workflow Grade Report:" ) ;
4246 console . log ( "data" ) ;
4347 console . log ( workflowData ) ;
4448 this . props . displayProblemGradeReport ( workflowData , username , userGrade ) ;
4549 }
4650
47- displayAssignmentExtraCreditGradeReport ( AECGRData , username , userGrade ) {
51+ displayAssignmentExtraCreditGradeReport ( AECGRData , username , userGrade ) {
4852 this . props . displayAssignmentExtraCreditGradeReport ( AECGRData , username , userGrade ) ;
4953 }
5054
51- displayAssignmentExtraCreditTasksReport ( AECTRData , username , userGrade ) {
55+ displayAssignmentExtraCreditTasksReport ( AECTRData , username , userGrade ) {
5256 this . props . displayAssignmentExtraCreditTasksReport ( AECTRData , username , userGrade ) ;
5357 }
5458
5559 download ( filename , fileContent ) {
5660 filename = filename + ".tsv" ;
57-
61+
5862 var blob = new Blob ( [ fileContent ] , { type : 'text/tab-separated-values' } ) ;
5963 if ( navigator . msSaveBlob ) { // IE 10+
6064 navigator . msSaveBlob ( blob , filename ) ;
@@ -71,23 +75,23 @@ class AssignmentGradeReport extends React.Component {
7175 document . body . removeChild ( link ) ;
7276 }
7377 }
74-
78+
7579 }
7680
77- render ( ) {
81+ render ( ) {
7882 //return (<div>The full grade report page is under development and will be ready in late Spring 2019. You can see the grades for individual tasks from the "All Assignments Status" page. Look for your submission, and then you can see the grades further along its problem thread.</div>);
79- let { strings, assignmentIdentifier} = this . props ;
83+ let { strings, assignmentIdentifier } = this . props ;
8084
81- let { loaded, GradeReportRoot} = this . state ;
85+ let { loaded, GradeReportRoot } = this . state ;
8286
83- if ( ! loaded ) {
87+ if ( ! loaded ) {
8488 return ( < div > Loading...</ div > ) ;
8589 }
86-
90+
8791 let AGRData = [ ] ;
8892 let CSVData = [ ] ;
8993
90- for ( var userID in GradeReportRoot ) {
94+ for ( var userID in GradeReportRoot ) {
9195 let userReport = GradeReportRoot [ userID ] ;
9296 let username = userReport . lastName + ", " + userReport . firstName ;
9397 console . log ( "usereport" ) ;
@@ -97,15 +101,15 @@ class AssignmentGradeReport extends React.Component {
97101 console . log ( ecReport ) ;
98102 let numOfECReport = userReport . numOfExtraCredit ;
99103
100- let numXCreditTasks = numOfECReport == null || numOfECReport . statistics . totalTaskCount == 0 ? "none assigned" :
104+ let numXCreditTasks = numOfECReport == null || numOfECReport . statistics . totalTaskCount == 0 ? "none assigned" :
101105 numOfECReport . statistics . reachedTaskCount + " out of " + numOfECReport . statistics . totalTaskCount + " reached, " + numOfECReport . statistics . completedTaskCount + " complete" ;
102-
106+
103107 let curXCreditTaskGrade , curXCreditTaskGradeNum , curXCreditTaskGradeStatus ;
104108 if ( ecReport == null ) {
105109 curXCreditTaskGrade = "none assigned" ;
106110 curXCreditTaskGradeNum = - 1 ;
107111 curXCreditTaskGradeStatus = "n/a" ;
108- } else if ( ecReport . extraGradableTaskStatistics . extraInProgress === "n/a" ) {
112+ } else if ( ecReport . extraGradableTaskStatistics . extraInProgress === "n/a" ) {
109113 curXCreditTaskGrade = ecReport . extraGradableTaskStatistics . assignmentExtraScaledGradeSummation + " (none assigned)" ;
110114 curXCreditTaskGradeNum = ecReport . extraGradableTaskStatistics . assignmentExtraScaledGradeSummation ;
111115 curXCreditTaskGradeStatus = "n/a" ;
@@ -114,7 +118,7 @@ class AssignmentGradeReport extends React.Component {
114118 curXCreditTaskGradeNum = ecReport . extraGradableTaskStatistics . assignmentExtraScaledGradeSummation ;
115119 curXCreditTaskGradeStatus = ecReport . extraGradableTaskStatistics . extraInProgress ;
116120 }
117-
121+
118122 let curXCreditTimeGrade , curXCreditTimeGradeNum , curXCreditTimeGradeStatus ;
119123 if ( ecReport == null || ecReport . timelinessGrade == null ) {
120124 curXCreditTimeGrade = "none assigned" ;
@@ -125,27 +129,27 @@ class AssignmentGradeReport extends React.Component {
125129 curXCreditTimeGradeNum = ecReport . timelinessGrade . grade ;
126130 curXCreditTimeGradeStatus = ecReport . timelinessGrade . reachedTaskCount + " out of " + ecReport . timelinessGrade . completedTaskCount + " reached, " + ecReport . timelinessGrade . totalTaskCount ;
127131 }
128-
129-
130- if ( ! ( userReport . lastname == undefined && userReport . firstName == undefined && userReport . email == undefined ) ) {
132+
133+
134+ if ( ! ( userReport . lastname == undefined && userReport . firstName == undefined && userReport . email == undefined ) ) {
131135 AGRData . push ( {
132- LastName :userReport . lastName ,
133- FirstName :userReport . firstName ,
134- Email :userReport . email ,
136+ LastName : userReport . lastName ,
137+ FirstName : userReport . firstName ,
138+ Email : userReport . email ,
135139 AssignmentGrade : < a href = "#" onClick = { this . displayProblemGradeReport . bind ( this , userReport . workflowGradeReport , username , userReport . assignmentGrade ) } >
136- { userReport . assignmentGrade + " (" + userReport . assignmentInProgress + ")" } </ a > ,
140+ { userReport . assignmentGrade + " (" + userReport . assignmentInProgress + ")" } </ a > ,
137141 NumXCreditTasks : < a href = "#" onClick = { this . displayAssignmentExtraCreditTasksReport . bind ( this , numOfECReport , username , numXCreditTasks ) } > { numXCreditTasks } </ a > ,
138142 CurrXCreditTaskGrade : < a href = "#" onClick = { this . displayAssignmentExtraCreditGradeReport . bind ( this , ecReport , username , curXCreditTaskGrade ) } > { curXCreditTaskGrade } </ a > ,
139143 CurrXCreditTimeGrade : < a href = "#" onClick = { this . displayAssignmentExtraCreditGradeReport . bind ( this , ecReport , username , curXCreditTimeGrade ) } > { curXCreditTimeGrade } </ a >
140-
144+
141145 } ) ;
142-
146+
143147 CSVData . push ( [
144148 userReport . lastName ,
145149 userReport . firstName ,
146150 userReport . email ,
147- userReport . assignmentGrade ,
148- userReport . assignmentInProgress ,
151+ userReport . assignmentGrade ,
152+ userReport . assignmentInProgress ,
149153 numOfECReport == null || numOfECReport . statistics . totalTaskCount == 0 ? - 1 : numOfECReport . statistics . totalTaskCount ,
150154 numXCreditTasks ,
151155 curXCreditTaskGradeNum ,
@@ -159,17 +163,17 @@ class AssignmentGradeReport extends React.Component {
159163
160164 /////////////////////////////////////////
161165 /**Creates and downloads a TSV file:**/
162- let headers = [ strings . LastName ,
163- strings . FirstName ,
164- strings . Email ,
165- strings . AssignmentGrade ,
166- strings . AssignmentGrade + " Status" ,
167- strings . NumXCreditTasks ,
168- strings . NumXCreditTasks + " Status" ,
169- strings . CurrXCreditTaskGrade ,
170- strings . CurrXCreditTaskGrade + " Status" ,
171- strings . CurrXCreditTimeGrade ,
172- strings . CurrXCreditTimeGrade + " Status" ] ;
166+ let headers = [ strings . LastName ,
167+ strings . FirstName ,
168+ strings . Email ,
169+ strings . AssignmentGrade ,
170+ strings . AssignmentGrade + " Status" ,
171+ strings . NumXCreditTasks ,
172+ strings . NumXCreditTasks + " Status" ,
173+ strings . CurrXCreditTaskGrade ,
174+ strings . CurrXCreditTaskGrade + " Status" ,
175+ strings . CurrXCreditTimeGrade ,
176+ strings . CurrXCreditTimeGrade + " Status" ] ;
173177
174178 CSVData . unshift ( headers ) ;
175179
@@ -184,14 +188,16 @@ class AssignmentGradeReport extends React.Component {
184188
185189 console . log ( "AGR Data" ) ;
186190 console . log ( AGRData ) ;
187-
191+
188192 return (
189193 < div className = "section card-2 sectionTable" >
190194 < div className = "title-download" >
191195 < h2 className = "title" > { strings . AGRHeader } </ h2 >
192- < button className = "download-button"
196+ < h3 className = "subtitle" > **Add metadata here (course section, FN, LN, etc.)**</ h3 >
197+ < h4 className = "subsubtitle" > Drag columns to widen cells and scroll down after clicking on hyperlinks</ h4 >
198+ < button className = "download-button"
193199 onClick = { this . download . bind ( this , this . props . assignmentIdentifier , csvContent ) } >
194- Download
200+ Download
195201 </ button >
196202 </ div >
197203 < div className = "section-content" >
@@ -202,36 +208,36 @@ class AssignmentGradeReport extends React.Component {
202208 {
203209 Header : strings . LastName ,
204210 accessor : 'LastName' ,
205- resizable :true
211+ resizable : true
206212 } ,
207213 {
208214 Header : strings . FirstName ,
209215 accessor : 'FirstName' ,
210- resizable :true
216+ resizable : true
211217 } ,
212- {
218+ {
213219 Header : strings . Email ,
214220 accessor : 'Email' ,
215- resizable :true
221+ resizable : true
216222 } ,
217223 {
218224 Header : strings . AssignmentGrade ,
219- resizable :true ,
225+ resizable : true ,
220226 accessor : 'AssignmentGrade'
221227 } ,
222228 {
223229 Header : strings . NumXCreditTasks ,
224- resizable :true ,
230+ resizable : true ,
225231 accessor : 'NumXCreditTasks'
226232 } ,
227233 {
228- Header : strings . CurrXCreditTaskGrade ,
229- resizable :true ,
234+ Header : strings . CurrXCreditTaskGrade ,
235+ resizable : true ,
230236 accessor : 'CurrXCreditTaskGrade'
231237 } ,
232238 {
233- Header : strings . CurrXCreditTimeGrade ,
234- resizable :true ,
239+ Header : strings . CurrXCreditTimeGrade ,
240+ resizable : true ,
235241 accessor : 'CurrXCreditTimeGrade'
236242 }
237243 ] }
@@ -247,7 +253,7 @@ class AssignmentGradeReport extends React.Component {
247253 </ div >
248254 </ div >
249255 ) ;
250-
256+
251257 }
252258}
253259
0 commit comments