/** * 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 actionDeletetest() { $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : ''; $arrJson = array(); WUserTest::deleteUserTestByTest($id); if ($this->loadModel($id)->delete() && WCourseLecture::updateTestPreTest($id) && WQuestion::deleteQues($id)) { $arrJson = array('status' => true, 'msg' => 'Success'); } else { $arrJson = array('status' => false, 'msg' => 'UnSuccess'); } echo CJSON::encode($arrJson); exit; }