public function consensus() { $annotation = new Annotation(1017); $this->unit->run($annotation->get_consensus_count(), 1, 'get_consensus_count'); $this->unit->run($annotation->get_consensus_coll()->get_item(0)->get_id(), 1018, 'get_consensus_coll後get_item get_id'); unit_test_report($this); }
public function delete($json, $callback = NULL) { $annotation_id = json_to_object($json); if (is_null($annotation_id)) { $data = FALSE; return $this->_display_jsonp($data, $callback); } //set_ignore_authorize(true); $annotation = new Annotation($annotation_id); $consensus_coll = $annotation->get_consensus_coll(); $this->_delete_annotation($annotation); set_ignore_authorize(true); //刪除時,重新計算分數 foreach ($consensus_coll as $consensus) { $this->_setup_scores($consensus); } context_complete(); //讀取更新後的範圍 $data = $this->_load_my(); /** * @author Pulipuli Chen <*****@*****.**> 20111106 如果有必要的話,在此讀取nav */ $data['nav'] = $this->_load_nav(); //$data['nav'] = array(); return $this->_display_jsonp($data, $callback); }