From e762c6d87c529368459124617904da952223d857 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sun, 26 Oct 2014 19:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E7=AB=8B=E5=AD=B8=E7=BF=92=E6=B4=BB?= =?UTF-8?q?=E5=8B=95=E6=9E=B6=E6=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/lib/Study/StudyActivity.php | 239 ++++++++++++++++ htdocs/lib/Study/StudyActivityManager.php | 75 +++++ htdocs/lib/Study/StudyWill.php | 321 ++++++++++++++++++++++ htdocs/lib/Study/Theme.php | 147 ++++++++++ 4 files changed, 782 insertions(+) create mode 100644 htdocs/lib/Study/StudyActivity.php create mode 100644 htdocs/lib/Study/StudyActivityManager.php create mode 100644 htdocs/lib/Study/StudyWill.php create mode 100644 htdocs/lib/Study/Theme.php diff --git a/htdocs/lib/Study/StudyActivity.php b/htdocs/lib/Study/StudyActivity.php new file mode 100644 index 0000000..a6feb5b --- /dev/null +++ b/htdocs/lib/Study/StudyActivity.php @@ -0,0 +1,239 @@ +getQuery() 抓取資料表中所有資訊,並放在此陣列裡 + * @type array + */ + protected $queryResultArray; + + /** + * 從資料庫取得查詢 + * + * @throw UElearning\Exception\AreaNoFoundException + * @since 2.0.0 + */ + protected function getQuery(){ + // TODO: 從資料庫取得查詢 + //// 從資料庫查詢 + //$db = new Database\DBTarget(); + //$areaInfo = $db->queryArea($this->aId); + // + //// 判斷有沒有這個 + //if( $areaInfo != null ) { + // $this->queryResultArray = $areaInfo; + //} + //else throw new Exception\AreaNoFoundException($this->aId); + } + + // ======================================================================== + + /** + * 建構子 + * + * @param int $inputID 學習階段流水號ID + * @since 2.0.0 + */ + public function __construct($inputID){ + $this->id = $inputAID; + $this->getQuery(); + } + + // ======================================================================== + // 控制這次學習階段: + + /** + * 設定這次學習時間要延長多久 + * + * @return int 延長時間(分) + * @since 2.0.0 + */ + public function setDelay(){ + //return $this->queryResultArray['name']; + } + + /** + * 設定累加這次學習時間要延長多久 + * + * @return int 延長時間(分) + * @since 2.0.0 + */ + public function addDelay(){ + //return $this->queryResultArray['name']; + } + + /** + * 結束這次學習 + * + * @since 2.0.0 + */ + public function finishActivity(){ + //return $this->queryResultArray['name']; + } + + /** + * 撤銷這次學習 + * + * @since 2.0.0 + */ + public function cancelActivity(){ + //return $this->queryResultArray['name']; + } + + // ======================================================================== + // 取得資料: + + /** + * 取得學習階段流水號ID + * + * @return int 學習階段流水號ID + * @since 2.0.0 + */ + public function getId(){ + return $this->id; + } + + /** + * 取得這次是誰在學習物件 + * + * @return \UElearning\User\User 使用者物件 + * @since 2.0.0 + */ + public function getUser(){ + + $userId = $this->queryResultArray['user_id'];; + return new User\User($userId); + } + + /** + * 取得這次是誰在學習 + * + * @return string 使用者ID + * @since 2.0.0 + */ + public function getUserId(){ + return $this->queryResultArray['user_id']; + } + + ///** + // * 取得這次是學哪個主題物件 + // * + // * @return int 主題物件 + // * @since 2.0.0 + // */ + //public function getTheme(){ + // $tId = $this->queryResultArray['theme_id']; + // return new Target\User($userId);; + //} + + /** + * 取得這次是學哪個主題 + * + * @return int 主題ID + * @since 2.0.0 + */ + public function getThemeId(){ + return $this->queryResultArray['theme_id']; + } + + /** + * 取得這次學習是什麼時候開始的 + * + * @return string 開始學習時間 + * @since 2.0.0 + */ + public function getStartTime(){ + //return $this->queryResultArray['build_time']; + } + + /** + * 取得這次學習是什麼時候結束的 + * + * @return string 結束學習時間 + * @since 2.0.0 + */ + public function getEndTime(){ + //return $this->queryResultArray['build_time']; + } + + /** + * 取得這次學習所需時間 + * + * @return int 所需學習時間(分) + * @since 2.0.0 + */ + public function getLearnTime(){ + //return $this->queryResultArray['name']; + } + + /** + * 取得這次學習時間要延長多久 + * + * @return int 延長時間(分) + * @since 2.0.0 + */ + public function getDelay(){ + //return $this->queryResultArray['name']; + } + + /** + * 取得這次學習的導引風格 + * + * @return int 將推薦幾個學習點 + * @since 2.0.0 + */ + public function getLearnStyle(){ + return $this->queryResultArray['learnStyle_mode']; + } + + /** + * 在這次學習,是否拒絕使用者前往非推薦的學習點 + * + * @return bool 是否拒絕前往非推薦的學習點 + * @since 2.0.0 + */ + public function isForceLearnStyle(){ + return $this->queryResultArray['learnStyle_force']; + } + + /** + * 取得這次學習的教材風格 + * + * @return string 教材風格 + * @since 2.0.0 + */ + public function getMaterialStyle(){ + return $this->queryResultArray['material_mode']; + } + +} \ No newline at end of file diff --git a/htdocs/lib/Study/StudyActivityManager.php b/htdocs/lib/Study/StudyActivityManager.php new file mode 100644 index 0000000..1538452 --- /dev/null +++ b/htdocs/lib/Study/StudyActivityManager.php @@ -0,0 +1,75 @@ +queryResultArray['name']; + } + + /** + * 幫學生預約學習 + * + * @param string $userId 使用者ID + * @param string $themeId 主題ID + * @param string $startTime 預約開始時間 + * @param string $expiredTime 預約過期時間 + * @param int $learnTime 所需學習時間(分) + * @param int $learnStyle 將推薦幾個學習點 + * @param bool $learnStyle_force 是否拒絕前往非推薦的學習點 + * @param string $materialMode 教材風格 + * @param bool $lock 是否鎖定不讓學生更改 + * @return int 預約學習活動的流水編號 + * @since 2.0.0 + */ + public function createWiilActivity($userId, $themeId, $startTime, $expiredTime, + $learnTime, $learnStyle, $learnStyle_force, $materialMode, $lock) + { + + } + + // ======================================================================== + + /** + * 取得這位學生可以使用的學習活動有哪些 + * + * @param string $user_id 使用者ID + * @return array 可用的學習活動資訊 + * @since 2.0.0 + */ + public function getEnableActivityByUserId($user_id) { + + } +} \ No newline at end of file diff --git a/htdocs/lib/Study/StudyWill.php b/htdocs/lib/Study/StudyWill.php new file mode 100644 index 0000000..f8305e6 --- /dev/null +++ b/htdocs/lib/Study/StudyWill.php @@ -0,0 +1,321 @@ +getQuery() 抓取資料表中所有資訊,並放在此陣列裡 + * @type array + */ + protected $queryResultArray; + + /** + * 從資料庫取得查詢 + * + * @throw UElearning\Exception\AreaNoFoundException + * @since 2.0.0 + */ + protected function getQuery(){ + // TODO: 從資料庫取得查詢 + //// 從資料庫查詢 + //$db = new Database\DBTarget(); + //$areaInfo = $db->queryArea($this->aId); + // + //// 判斷有沒有這個 + //if( $areaInfo != null ) { + // $this->queryResultArray = $areaInfo; + //} + //else throw new Exception\AreaNoFoundException($this->aId); + } + + // ======================================================================== + + /** + * 建構子 + * + * @param int $inputID 學習階段流水號ID + * @since 2.0.0 + */ + public function __construct($inputID){ + $this->id = $inputAID; + $this->getQuery(); + } + + // ======================================================================== + // 控制這次學習階段: + + /** + * 撤銷這次預約 + * + * @since 2.0.0 + */ + public function cancel(){ + //return $this->queryResultArray['name']; + } + + // ======================================================================== + // 取得資料: + + /** + * 取得預約學習階段流水號ID + * + * @return int 預約學習階段流水號ID + * @since 2.0.0 + */ + public function getId(){ + return $this->id; + } + + /** + * 取得是誰要預約學習的使用者物件 + * + * @return \UElearning\User\User 使用者物件 + * @since 2.0.0 + */ + public function getUser(){ + + $userId = $this->queryResultArray['user_id'];; + return new User\User($userId); + } + + /** + * 取得是誰要預約學習 + * + * @return string 使用者ID + * @since 2.0.0 + */ + public function getUserId(){ + return $this->queryResultArray['user_id']; + } + + /** + * 設定這次是誰要預約學習 + * + * @param string $user_id 使用者ID + * @since 2.0.0 + */ + public function setUserById($user_id){ + + } + + ///** + // * 取得這次預約是學哪個主題物件 + // * + // * @return int 主題物件 + // * @since 2.0.0 + // */ + //public function getTheme(){ + // $tId = $this->queryResultArray['theme_id']; + // return new Target\User($userId);; + //} + + /** + * 取得這次預約是學哪個主題 + * + * @return int 主題ID + * @since 2.0.0 + */ + public function getThemeId(){ + return $this->queryResultArray['theme_id']; + } + + /** + * 設定這次要預約學哪個主題 + * + * @param int $theme_id 主題ID + * @since 2.0.0 + */ + public function setThemeById($theme_id){ + return $this->queryResultArray['theme_id']; + } + + /** + * 取得這次學習是預約在什麼時候開始 + * + * @return string 開始學習預約時間 + * @since 2.0.0 + */ + public function getStartTime(){ + //return $this->queryResultArray['build_time']; + } + + /** + * 設定這次學習是預約在什麼時候開始 + * + * @param string $time 開始學習預約時間 + * @since 2.0.0 + */ + public function setStartTime($time){ + //return $this->queryResultArray['build_time']; + } + + /** + * 取得這次學習預約什麼時候過期 + * + * @return string 過期預約時間 + * @since 2.0.0 + */ + public function getExpiredTime(){ + //return $this->queryResultArray['build_time']; + } + + /** + * 設定這次學習預約什麼時候過期 + * + * @param string $time 過期預約時間 + * @since 2.0.0 + */ + public function setExpiredTime($time){ + //return $this->queryResultArray['build_time']; + } + + /** + * 取得預約學習所需時間 + * + * @return int 所需學習時間(分) + * @since 2.0.0 + */ + public function getLearnTime(){ + //return $this->queryResultArray['name']; + } + + /** + * 設定預約學習所需時間 + * + * @param int $min 所需學習時間(分) + * @since 2.0.0 + */ + public function setLearnTime($min){ + //return $this->queryResultArray['name']; + } + + /** + * 取得預約學習的導引風格 + * + * @return int 將推薦幾個學習點 + * @since 2.0.0 + */ + public function getLearnStyle(){ + return $this->queryResultArray['learnStyle_mode']; + } + + /** + * 設定預約學習的導引風格 + * + * @param int $num 將推薦幾個學習點 + * @since 2.0.0 + */ + public function setLearnStyle($num){ + + } + + /** + * 在這次學習,是否拒絕使用者前往非推薦的學習點 + * + * @return bool 是否拒絕前往非推薦的學習點 + * @since 2.0.0 + */ + public function isForceLearnStyle(){ + return $this->queryResultArray['learnStyle_force']; + } + + /** + * 預約本次學習,是否拒絕使用者前往非推薦的學習點 + * + * @param bool $value 是否拒絕前往非推薦的學習點 + * @since 2.0.0 + */ + public function setForceLearnStyle($value){ + + } + + /** + * 取得預約學習的教材風格 + * + * @return string 教材風格 + * @since 2.0.0 + */ + public function getMaterialStyle(){ + return $this->queryResultArray['material_mode']; + } + + /** + * 設定預約學習的教材風格 + * + * @param string $value 教材風格 + * @since 2.0.0 + */ + public function setMaterialStyle($value){ + + } + + /** + * 取得開始學習此預約前,是否允許讓學生自行更改設定 + * + * @return bool 是否允許讓學生自行更改設定 + * @since 2.0.0 + */ + public function isLock() { + + } + + /** + * 設定開始學習此預約前,是否允許讓學生自行更改設定 + * + * @param bool $value 是否允許讓學生自行更改設定 + * @since 2.0.0 + */ + function setLock($value) { + + } + + // ------------------------------------------------------------------------ + + /** + * 取得此預約建立時間 + * + * @return string 建立時間 + * @since 2.0.0 + */ + public function getCreateTime(){ + return $this->queryResultArray['build_time']; + } + + /** + * 取得此預約修改時間 + * + * @return string 修改時間 + * @since 2.0.0 + */ + public function getModifyTime(){ + return $this->queryResultArray['modify_time']; + } + +} \ No newline at end of file diff --git a/htdocs/lib/Study/Theme.php b/htdocs/lib/Study/Theme.php new file mode 100644 index 0000000..4e24700 --- /dev/null +++ b/htdocs/lib/Study/Theme.php @@ -0,0 +1,147 @@ +getQuery() 抓取資料表中所有資訊,並放在此陣列裡 + * @type array + */ + protected $queryResultArray; + + /** + * 從資料庫取得查詢 + * + * @throw UElearning\Exception\AreaNoFoundException + * @since 2.0.0 + */ + protected function getQuery(){ + // TODO: 從資料庫取得查詢 + //// 從資料庫查詢 + //$db = new Database\DBTarget(); + //$areaInfo = $db->queryArea($this->aId); +// + //// 判斷有沒有這個 + //if( $areaInfo != null ) { + // $this->queryResultArray = $areaInfo; + //} + //else throw new Exception\AreaNoFoundException($this->aId); + } + + /** + * 從資料庫更新設定 + * + * @since 2.0.0 + */ + protected function setUpdate($field, $value){ + // TODO: 從資料庫更新設定 + // 將新設定寫進資料庫裡 + //$db = new Database\DBTarget(); + //$db->changeTargetData($this->tId, $field, $value); + //$this->getQuery(); + } + + // ======================================================================== + + /** + * 建構子 + * + * @param int $inputTID 主題ID + * @since 2.0.0 + */ + public function __construct($inputTID){ + $this->tId = $inputAID; + $this->getQuery(); + } + + // ======================================================================== + + /** + * 取得主題ID + * + * @return int 主題ID + * @since 2.0.0 + */ + public function getId(){ + return $this->tId; + } + + /** + * 取得主題名稱 + * + * @return string 主題名稱 + * @since 2.0.0 + */ + public function getName(){ + return $this->queryResultArray['name']; + } + + /** + * 取得主題介紹 + * + * @return string 主題介紹 + * @since 2.0.0 + */ + public function getIntroduction(){ + //return $this->queryResultArray['name']; + } + + /** + * 取得此主題學習所需時間 + * + * @return int 所需學習時間(分) + * @since 2.0.0 + */ + public function getLearnTime(){ + //return $this->queryResultArray['name']; + } + + /** + * 取得建立時間 + * + * @return string 建立時間 + * @since 2.0.0 + */ + public function getCreateTime(){ + return $this->queryResultArray['build_time']; + } + + /** + * 取得修改時間 + * + * @return string 修改時間 + * @since 2.0.0 + */ + public function getModifyTime(){ + return $this->queryResultArray['modify_time']; + } + +} \ No newline at end of file