public function fill() { $sch = getproblemsearch('fill_id', FillBaseModel::FILL_PROBLEM_TYPE); $key = set_get_key(); $isadmin = $this->isSuperAdmin(); $mypage = splitpage('ex_fill', $sch['sql']); $numoffill = 1 + ($mypage['page'] - 1) * $mypage['eachpage']; $row = M('ex_fill')->field('fill_id,question,creator,easycount,kind')->where($sch['sql'])->order('fill_id asc')->limit($mypage['sqladd'])->select(); $widgets = array('row' => $row, 'mykey' => $key, 'mypage' => $mypage, 'isadmin' => $isadmin, 'numoffill' => $numoffill); $questionIds = array(); foreach ($row as $r) { $questionIds[] = $r['fill_id']; } $this->getQuestionChapterAndPoint($questionIds, FillBaseModel::FILL_PROBLEM_TYPE); $this->ZaddWidgets($widgets); $this->auto_display(); }
public function fill() { $sch = getproblemsearch(); $key = set_get_key(); $isadmin = checkAdmin(1); $mypage = splitpage('ex_fill', $sch['sql']); $numoffill = 1 + ($mypage['page'] - 1) * $mypage['eachpage']; $row = m('ex_fill')->field('fill_id,question,creator,point,easycount,kind')->where($sch['sql'])->order('fill_id asc')->limit($mypage['sqladd'])->select(); $this->assign('row', $row); $this->assign('mypage', $mypage); $this->assign('numoffill', $numoffill); $this->assign('isadmin', $isadmin); $this->assign('mykey', $key); $this->assign('search', $sch['search']); $this->assign('problem', $sch['problem']); $this->auto_display(); }
private function addfill() { $sch = getproblemsearch(); $isadmin = checkAdmin(1); $mypage = splitpage('ex_fill', $sch['sql']); $numoffill = 1 + ($mypage['page'] - 1) * $mypage['eachpage']; $row = M('ex_fill')->field('fill_id,question,creator,point,easycount,kind')->where($sch['sql'])->order('fill_id asc')->limit($mypage['sqladd'])->select(); $haveadded = array(); if ($row) { foreach ($row as $value) { $haveadded[$value['fill_id']] = $this->checkadded($this->eid, 3, $value['fill_id']); } } $this->zadd('added', $haveadded); $this->zadd('mypage', $mypage); $this->zadd('numoffill', $numoffill); $this->zadd('isadmin', $isadmin); $this->zadd('row', $row); $this->zadd('search', $sch['search']); $this->zadd('problem', $sch['problem']); $this->auto_display('fill'); }
private function addFillProblem() { $sch = getproblemsearch('fill_id', FillBaseModel::FILL_PROBLEM_TYPE); $isadmin = $this->isSuperAdmin(); $mypage = splitpage('ex_fill', $sch['sql']); $numoffill = 1 + ($mypage['page'] - 1) * $mypage['eachpage']; $row = M('ex_fill')->field('fill_id,question,creator,easycount,kind')->where($sch['sql'])->order('fill_id asc')->limit($mypage['sqladd'])->select(); $questionAddedIds = QuestionBaseModel::instance()->getQuestionIds4ExamByType($this->eid, FillBaseModel::FILL_PROBLEM_TYPE); $haveadded = array(); foreach ($questionAddedIds as $qid) { $haveadded[$qid['question_id']] = 1; } $widgets = array('row' => $row, 'added' => $haveadded, 'mypage' => $mypage, 'isadmin' => $isadmin, 'numoffill' => $numoffill); $questionIds = array(); foreach ($row as $r) { $questionIds[] = $r['fill_id']; } $this->getQuestionChapterAndPoint($questionIds, FillBaseModel::FILL_PROBLEM_TYPE); $this->ZaddWidgets($widgets); $this->auto_display('fill'); }