@@ -766,53 +766,6 @@ function coursework_supports($feature) {
766
766
}
767
767
}
768
768
769
- /**
770
- * Checks whether the student with the given username has been flagged
771
- * as having a disability
772
- *
773
- * @param string $username
774
- * @return bool
775
- */
776
- function has_disability ($ username ) {
777
- global $ CFG ;
778
-
779
- // TODO we are assuming a lot here.
780
- $ dbhost = $ CFG ->dbhost ;
781
- $ dbuser = $ CFG ->dbuser ;
782
- $ dbpass = $ CFG ->dbpass ;
783
-
784
- $ disabilitydb = 'exuimport ' ;
785
- $ disabilitycolumn = 'DISABILITY_CODE ' ;
786
- $ disabilitytable = 'ELE_STUDENT_ACCOUNTS ' ;
787
- $ usernamefield = 'USERNAME ' ;
788
- $ hasdisabilityvalue = 'Y ' ;
789
-
790
- $ sql = "SELECT {$ disabilitycolumn }
791
- FROM {$ disabilitytable }
792
- WHERE {$ usernamefield } = ' {$ username }' " ;
793
-
794
- // TODO make this use normal Moodle DB functions.
795
- $ dbconnection = mysql_connect ($ dbhost , $ dbuser , $ dbpass );
796
- if (!$ dbconnection ) {
797
- return false ;
798
- }
799
- if (!mysql_select_db ($ disabilitydb , $ dbconnection )) {
800
- return false ;
801
- }
802
- $ disabilities = mysql_query ($ sql , $ dbconnection );
803
- if (!$ disabilities ) {
804
- return false ;
805
- }
806
- $ row = mysql_fetch_assoc ($ disabilities );
807
- if (!$ row || empty ($ row [$ disabilitycolumn ])) {
808
- return false ;
809
- }
810
- // TODO get all data at once and cache it as a static variable
811
- mysql_close ($ dbconnection ); // Inefficient - we will be doing this a lot sometimes.
812
-
813
- return ($ row [$ disabilitycolumn ] == $ hasdisabilityvalue ) ? true : false ;
814
- }
815
-
816
769
/**
817
770
* Puts items in order of their configured display order within forms data, so that responses are
818
771
* always displayed the same way the form was when the respondents filled it in.
0 commit comments