original_string: public static function release_drafts($gradeid) {
          global $DB;
  
          // Delete the previous non-draft annotations and comments.
          $DB->delete_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>0));
          $DB->delete_records('assignfeedback_editpdf_annot', array('gradeid'=>$gradeid, 'draft'=>0));
  
          // Copy all the draft annotations and comments to non-drafts.
          $records = $DB->get_records('assignfeedback_editpdf_annot', array('gradeid'=>$gradeid, 'draft'=>1));
          foreach ($records as $record) {
              unset($record->id);
              $record->draft = 0;
              $DB->insert_record('assignfeedback_editpdf_annot', $record);
          }
          $records = $DB->get_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>1));
          foreach ($records as $record) {
              unset($record->id);
              $record->draft = 0;
              $DB->insert_record('assignfeedback_editpdf_cmnt', $record);
          }
  
          return true;
      }
code: public static function release_drafts($gradeid) {
          global $DB;
  
          // Delete the previous non-draft annotations and comments.
          $DB->delete_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>0));
          $DB->delete_records('assignfeedback_editpdf_annot', array('gradeid'=>$gradeid, 'draft'=>0));
  
          // Copy all the draft annotations and comments to non-drafts.
          $records = $DB->get_records('assignfeedback_editpdf_annot', array('gradeid'=>$gradeid, 'draft'=>1));
          foreach ($records as $record) {
              unset($record->id);
              $record->draft = 0;
              $DB->insert_record('assignfeedback_editpdf_annot', $record);
          }
          $records = $DB->get_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>1));
          foreach ($records as $record) {
              unset($record->id);
              $record->draft = 0;
              $DB->insert_record('assignfeedback_editpdf_cmnt', $record);
          }
  
          return true;
      }
code_tokens: public static function release_drafts ( $ gradeid ) { global $ DB ; // Delete the previous non-draft annotations and comments. $ DB -> delete_records ( 'assignfeedback_editpdf_cmnt' , array ( 'gradeid' => $ gradeid , 'draft' => 0 ) ) ; $ DB -> delete_records ( 'assignfeedback_editpdf_annot' , array ( 'gradeid' => $ gradeid , 'draft' => 0 ) ) ; // Copy all the draft annotations and comments to non-drafts. $ records = $ DB -> get_records ( 'assignfeedback_editpdf_annot' , array ( 'gradeid' => $ gradeid , 'draft' => 1 ) ) ; foreach ( $ records as $ record ) { unset ( $ record -> id ) ; $ record -> draft = 0 ; $ DB -> insert_record ( 'assignfeedback_editpdf_annot' , $ record ) ; } $ records = $ DB -> get_records ( 'assignfeedback_editpdf_cmnt' , array ( 'gradeid' => $ gradeid , 'draft' => 1 ) ) ; foreach ( $ records as $ record ) { unset ( $ record -> id ) ; $ record -> draft = 0 ; $ DB -> insert_record ( 'assignfeedback_editpdf_cmnt' , $ record ) ; } return true ; }
docstring: Release the draft comments and annotations to students.
  @param int $gradeid
  @return bool
docstring_tokens: Release the draft comments and annotations to students .