original_string: public function determine_default_rolemapping($imscode) {
          global $DB;
  
          switch($imscode) {
              case '01':
              case '04':
                  $shortname = 'student';
                  break;
              case '06':
              case '08':
                  $shortname = 'teacher';
                  break;
              case '02':
              case '03':
                  $shortname = 'editingteacher';
                  break;
              case '05':
              case '07':
                  $shortname = 'admin';
                  break;
              default:
                  return 0; // Zero for no match.
          }
          return (string)$DB->get_field('role', 'id', array('shortname' => $shortname));
      }
code: public function determine_default_rolemapping($imscode) {
          global $DB;
  
          switch($imscode) {
              case '01':
              case '04':
                  $shortname = 'student';
                  break;
              case '06':
              case '08':
                  $shortname = 'teacher';
                  break;
              case '02':
              case '03':
                  $shortname = 'editingteacher';
                  break;
              case '05':
              case '07':
                  $shortname = 'admin';
                  break;
              default:
                  return 0; // Zero for no match.
          }
          return (string)$DB->get_field('role', 'id', array('shortname' => $shortname));
      }
code_tokens: public function determine_default_rolemapping ( $ imscode ) { global $ DB ; switch ( $ imscode ) { case '01' : case '04' : $ shortname = 'student' ; break ; case '06' : case '08' : $ shortname = 'teacher' ; break ; case '02' : case '03' : $ shortname = 'editingteacher' ; break ; case '05' : case '07' : $ shortname = 'admin' ; break ; default : return 0 ; // Zero for no match. } return ( string ) $ DB -> get_field ( 'role' , 'id' , array ( 'shortname' => $ shortname ) ) ; }
docstring: This function is only used when first setting up the plugin, to
  decide which role assignments to recommend by default.
  For example, IMS role '01' is 'Learner', so may map to 'student' in Moodle.
  
  @param string $imscode
docstring_tokens: This function is only used when first setting up the plugin to decide which role assignments to recommend by default . For example IMS role 01 is Learner so may map to student in Moodle .