original_string: public static function load_quiz_and_settings($quizid) {
          global $DB;
  
          $rules = self::get_rule_classes();
          list($sql, $params) = self::get_load_sql($quizid, $rules, 'quiz.*');
          $quiz = $DB->get_record_sql($sql, $params, MUST_EXIST);
  
          foreach ($rules as $rule) {
              foreach ($rule::get_extra_settings($quizid) as $name => $value) {
                  $quiz->$name = $value;
              }
          }
  
          return $quiz;
      }
code: public static function load_quiz_and_settings($quizid) {
          global $DB;
  
          $rules = self::get_rule_classes();
          list($sql, $params) = self::get_load_sql($quizid, $rules, 'quiz.*');
          $quiz = $DB->get_record_sql($sql, $params, MUST_EXIST);
  
          foreach ($rules as $rule) {
              foreach ($rule::get_extra_settings($quizid) as $name => $value) {
                  $quiz->$name = $value;
              }
          }
  
          return $quiz;
      }
code_tokens: public static function load_quiz_and_settings ( $ quizid ) { global $ DB ; $ rules = self :: get_rule_classes ( ) ; list ( $ sql , $ params ) = self :: get_load_sql ( $ quizid , $ rules , 'quiz.*' ) ; $ quiz = $ DB -> get_record_sql ( $ sql , $ params , MUST_EXIST ) ; foreach ( $ rules as $ rule ) { foreach ( $ rule :: get_extra_settings ( $ quizid ) as $ name => $ value ) { $ quiz -> $ name = $ value ; } } return $ quiz ; }
docstring: Load the quiz settings and any settings required by the access rules.
  We try to do this with a single DB query.
  
  Note that the standard plugins do not use this mechanism, becuase all their
  settings are stored in the quiz table.
  
  @param int $quizid the quiz id.
  @return object mdl_quiz row with extra fields.
docstring_tokens: Load the quiz settings and any settings required by the access rules . We try to do this with a single DB query .