示例#1
0
 public function annotate($backupid)
 {
     if (empty($this->annotationitem)) {
         // We aren't annotating this item
         return;
     }
     if (!$this->is_set()) {
         throw new base_element_struct_exception('attribute_has_not_value', $this->get_name());
     }
     backup_structure_dbops::insert_backup_ids_record($backupid, $this->annotationitem, $this->get_value());
 }
 protected function define_execution()
 {
     global $DB;
     // Fetch all the annotated outcomes
     if ($outcomes = $DB->get_records('backup_ids_temp', array('backupid' => $this->get_backupid(), 'itemname' => 'outcome'))) {
         foreach ($outcomes as $outcome) {
             if ($scale = $DB->get_record('grade_outcomes', array('id' => $outcome->itemid))) {
                 // Annotate as scalefinal because it's > 0
                 backup_structure_dbops::insert_backup_ids_record($this->get_backupid(), 'scalefinal', $scale->scaleid);
             }
         }
     }
 }