@@ -580,10 +580,10 @@ export class CourseList{
580580 dropdown_selector : string ;
581581 refresh_selector : string ;
582582 assignment_list : AssignmentList ;
583- current_course : string ;
583+ current_course : { [ key : string ] : string }
584584 options = new Map ( ) ;
585585 base_url : string ;
586- data : string [ ] ;
586+ data : { [ key : string ] : string } [ ] ;
587587 course_list_element : HTMLUListElement ;
588588 default_course_element : HTMLButtonElement ;
589589 dropdown_element : HTMLButtonElement ;
@@ -673,7 +673,7 @@ private handle_load_list(data: { success: any; value: any; }): void {
673673 }
674674} ;
675675
676- private load_list_success ( data : string [ ] ) : void {
676+ private load_list_success ( data : { [ key : string ] : string } [ ] ) : void {
677677 this . data = data ;
678678 this . disable_list ( )
679679 this . clear_list ( ) ;
@@ -698,28 +698,28 @@ private load_list_success(data: string[]): void {
698698 }
699699} ;
700700
701- private change_course ( course : string ) : void {
701+ private change_course ( course : { [ key : string ] : string } ) : void {
702702 this . disable_list ( ) ;
703703 if ( this . current_course !== undefined ) {
704- this . default_course_element . innerText = course ;
704+ this . default_course_element . innerText = course [ 'course_title' ] ;
705705 }
706706 this . current_course = course ;
707- this . default_course_element . innerText = this . current_course ;
707+ this . default_course_element . innerText = this . current_course [ 'course_title' ] ;
708708 var success = ( ) => { this . load_assignment_list_success ( ) } ;
709- this . assignment_list . load_list ( course , success ) ;
709+ this . assignment_list . load_list ( course [ 'course_id' ] , success ) ;
710710} ;
711711
712712private load_assignment_list_success ( ) : void {
713713 if ( this . data ) {
714714 var that = this ;
715- var set_course = function ( course : string ) {
715+ var set_course = function ( course : { [ key : string ] : string } ) {
716716 return function ( ) { that . change_course ( course ) ; } ;
717717 }
718718
719719 for ( var i = 0 ; i < this . data . length ; i ++ ) {
720720 var a = document . createElement ( 'a' ) ;
721721 a . href = '#' ;
722- a . innerText = this . data [ i ] ;
722+ a . innerText = this . data [ i ] [ 'course_title' ] ;
723723 var element = document . createElement ( 'li' ) ;
724724 element . append ( a ) ;
725725 element . onclick = set_course ( this . data [ i ] ) ;
0 commit comments