/** * Deletes a particular model. * If deletion is successful, the browser will be redirected to the 'admin' page. * @param integer $id the ID of the model to be deleted */ public function actionDelete() { $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : ''; $model = $this->loadModel($id); $arrJson = array(); WTest::updatePoint($model['test_id'], $model['point']); if (WQuestionAnswer::deleteQuesAns($id) && $this->loadModel($id)->delete()) { $arrJson = array('status' => true, 'msg' => 'Success'); } else { $arrJson = array('status' => false, 'msg' => 'UnSuccess'); } echo CJSON::encode($arrJson); exit; }