original_string: public function get_published_submissions($orderby='finalgrade DESC') {
          global $DB;
  
          $authorfields = user_picture::fields('u', null, 'authoridx', 'author');
          $sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
                         s.title, s.grade, s.gradeover, COALESCE(s.gradeover,s.grade) AS finalgrade,
                         $authorfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.published = 1
                ORDER BY $orderby";
          $params = array('workshopid' => $this->id);
          return $DB->get_records_sql($sql, $params);
      }
code: public function get_published_submissions($orderby='finalgrade DESC') {
          global $DB;
  
          $authorfields = user_picture::fields('u', null, 'authoridx', 'author');
          $sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
                         s.title, s.grade, s.gradeover, COALESCE(s.gradeover,s.grade) AS finalgrade,
                         $authorfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.published = 1
                ORDER BY $orderby";
          $params = array('workshopid' => $this->id);
          return $DB->get_records_sql($sql, $params);
      }
code_tokens: public function get_published_submissions ( $ orderby = 'finalgrade DESC' ) { global $ DB ; $ authorfields = user_picture :: fields ( 'u' , null , 'authoridx' , 'author' ) ; $ sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
                         s.title, s.grade, s.gradeover, COALESCE(s.gradeover,s.grade) AS finalgrade,
                         $authorfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.published = 1
                ORDER BY $orderby" ; $ params = array ( 'workshopid' => $ this -> id ) ; return $ DB -> get_records_sql ( $ sql , $ params ) ; }
docstring: Returns published submissions with their authors data
  
  @return array of stdclass
docstring_tokens: Returns published submissions with their authors data