更新資料庫增加欄位: 是否啟用虛擬學習點選項

This commit is contained in:
Yuan Chiu 2015-01-09 16:36:59 +08:00
parent cc02589d2d
commit b0e73eab35
5 changed files with 142 additions and 63 deletions

View File

@ -52,12 +52,14 @@ class DBStudyActivity extends Database {
* @param bool $timeForce 時間到時是否強制中止學習
* @param int $learnStyle 學習導引模式
* @param bool $learnStyle_force 拒絕前往非推薦的學習點
* @param bool $enable_virtual 是否啟用虛擬教材
* @param string $materialMode 教材模式
* @since 2.0.0
*/
public function insertActivity($userId, $themeId, $startTime, $endTime,
$learnTime, $delay, $timeForce,
$learnStyle, $learnStyle_force, $materialMode)
$learnStyle, $learnStyle_force, $enable_virtual,
$materialMode)
{
// 自動填入未填的時間
@ -107,10 +109,10 @@ class DBStudyActivity extends Database {
$sqlString = "INSERT INTO `".$this->table('StudyActivity').
"` (`UID`, `ThID`,
`StartTime`, `EndTime`, `LearnTime`, `Delay`, `TimeForce`,
`LMode`, `LModeForce`, `MMode`)
`LMode`, `LModeForce`, `EnableVirtual`, `MMode`)
VALUES ( :uid , :thid ,
".$to_startTime.", ".$to_endTime.", ".$to_learnTime." , :delay , :timeforce ,
".$to_learnStyle.", :lstyle_force , ".$to_materialMode.")";
".$to_learnStyle.", :lstyle_force , :enable_virtual , ".$to_materialMode.")";
$query = $this->connDB->prepare($sqlString);
$query->bindParam(":uid", $userId);
@ -118,6 +120,7 @@ class DBStudyActivity extends Database {
$query->bindParam(":delay", $delay);
$query->bindParam(":timeforce", $timeForce);
$query->bindParam(":lstyle_force", $learnStyle_force);
$query->bindParam(":enable_virtual", $enable_virtual);
$query->execute();
// 取得剛剛加入的ID
@ -159,7 +162,7 @@ class DBStudyActivity extends Database {
" AS `ExpiredTime`, ".
"`EndTime`, ".
"`LearnTime`, `Delay`, `TimeForce`, ".
"`LMode`, `LModeForce`, `MMode`, ".
"`LMode`, `LModeForce`, `EnableVirtual`, `MMode`, ".
"(SELECT count(`TID`)
FROM `".$this->table('TBelong')."` AS `belong`
@ -193,6 +196,11 @@ class DBStudyActivity extends Database {
}
else { $output_learnStyleForce = false; }
if($thisResult['EnableVirtual'] != '0') {
$output_enable_virtual = true;
}
else { $output_enable_virtual = false; }
array_push($result,
array( 'activity_id' => (int)$thisResult['SaID'],
'user_id' => $thisResult['UID'],
@ -206,6 +214,7 @@ class DBStudyActivity extends Database {
'time_force' => $output_time_force,
'learnStyle_mode' => (int)$thisResult['LMode'],
'learnStyle_force' => $output_learnStyleForce,
'enable_virtual' => $output_enable_virtual,
'material_mode' => $thisResult['MMode'],
'target_total' => (int)$thisResult['TargetTotal'],
'learned_total' => (int)$thisResult['LearnedTotal']
@ -249,6 +258,7 @@ class DBStudyActivity extends Database {
* 'time_force' => <時間到時是否強制中止學習>,
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習點>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'target_total' => <有多少標的學習>,
* 'learned_total' => <已經完成多少標的學習>
@ -287,6 +297,7 @@ class DBStudyActivity extends Database {
* 'time_force' => <時間到時是否強制中止學習>,
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習點>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'target_total' => <有多少標的學習>,
* 'learned_total' => <已經完成多少標的學習>
@ -315,6 +326,7 @@ class DBStudyActivity extends Database {
* 'delay' => <延誤結束時間()>,
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習點>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'target_total' => <有多少標的學習>,
* 'learned_total' => <已經完成多少標的學習>
@ -393,13 +405,15 @@ class DBStudyActivity extends Database {
* @param bool $timeForce 時間到時是否強制中止學習
* @param int $learnStyle 學習導引模式
* @param bool $learnStyle_force 拒絕前往非推薦的學習點
* @param bool $enable_virtual 是否啟用虛擬教材
* @param string $materialMode 教材模式
* @param string $isLock 是否鎖定不讓學生更改
* @since 2.0.0
*/
public function insertWillActivity($userId, $themeId, $startTime, $expiredTime,
$learnTime, $timeForce,
$learnStyle, $learnStyle_force, $materialMode, $isLock)
$learnStyle, $learnStyle_force, $enable_virtual,
$materialMode, $isLock)
{
// 自動填入未填的時間
@ -448,16 +462,18 @@ class DBStudyActivity extends Database {
$sqlString = "INSERT INTO `".$this->table('StudyWill').
"` (`UID`, `ThID`,
`StartTime`, `ExpiredTime`, `LearnTime`, `TimeForce`,
`LMode`, `LModeForce`, `MMode`, `Lock`)
`LMode`, `LModeForce`, `EnableVirtual`, `MMode`, `Lock`)
VALUES ( :uid , :thid ,
".$to_startTime.", ".$to_expiredTime.", ".$to_learnTime." , :timeforce ,
".$to_learnStyle.", :lstyle_force , ".$to_materialMode.", :lock )";
".$to_learnStyle.", :lstyle_force , :enable_virtual ,
".$to_materialMode.", :lock )";
$query = $this->connDB->prepare($sqlString);
$query->bindParam(":uid", $userId);
$query->bindParam(":thid", $themeId);
$query->bindParam(":timeforce", $timeForce);
$query->bindParam(":lstyle_force", $learnStyle_force);
$query->bindParam(":enable_virtual", $enable_virtual);
$query->bindParam(":lock", $isLock);
$query->execute();
@ -494,7 +510,7 @@ class DBStudyActivity extends Database {
$sqlString = "SELECT `SwID`, `UID`, `ThID`, ".
"`StartTime`, `ExpiredTime`, `LearnTime`, `TimeForce`, ".
"`LMode`, `LModeForce`, `MMode`, `Lock`, ".
"`LMode`, `LModeForce`, `EnableVirtual`, `MMode`, `Lock`, ".
"(SELECT count(`TID`)
FROM `".$this->table('TBelong')."` AS `belong`
@ -530,6 +546,11 @@ class DBStudyActivity extends Database {
}
else { $output_isLock = false; }
if($thisResult['EnableVirtual'] != '0') {
$output_enable_virtual = true;
}
else { $output_enable_virtual = false; }
array_push($result,
array( 'activity_will_id' => $thisResult['SwID'],
'user_id' => $thisResult['UID'],
@ -540,6 +561,7 @@ class DBStudyActivity extends Database {
'time_force' => $output_time_force,
'learnStyle_mode' => $thisResult['LMode'],
'learnStyle_force' => $output_learnStyleForce,
'enable_virtual' => $output_enable_virtual,
'material_mode' => $thisResult['MMode'],
'is_lock' => $output_isLock,
'target_total' => $thisResult['TargetTotal'],
@ -583,6 +605,7 @@ class DBStudyActivity extends Database {
* 'time_force' => <時間到時是否強制中止學習>,
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習點>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'is_lock' => <是否鎖定不讓學生更改>,
* 'target_total' => <有多少標的學習>,
@ -621,7 +644,8 @@ class DBStudyActivity extends Database {
* 'learn_time' => <學習所需時間()>
* 'time_force' => <時間到時是否強制中止
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習
* 'learnStyle_force' => <拒絕前往非推薦的學習>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'is_lock' => <是否鎖定不讓學生更改
* 'target_total' => <有多少標的學習>,
@ -652,7 +676,8 @@ class DBStudyActivity extends Database {
* 'learn_time' => <學習所需時間()>
* 'time_force' => <時間到時是否強制中止
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習
* 'learnStyle_force' => <拒絕前往非推薦的學習>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'is_lock' => <是否鎖定不讓學生更改
* 'target_total' => <有多少標的學習>,
@ -687,6 +712,7 @@ class DBStudyActivity extends Database {
case 'time_force': $sqlField = 'TimeForce'; break;
case 'learnStyle_mode': $sqlField = 'LMode'; break;
case 'learnStyle_force': $sqlField = 'LModeForce'; break;
case 'enable_virtual': $sqlField = 'EnableVirtual'; break;
case 'material_mode': $sqlField = 'MMode'; break;
case 'is_lock': $sqlField = 'Lock'; break;
default: $sqlField = $field; break;
@ -721,7 +747,7 @@ SELECT 'study' AS `Type`,
(`LearnTime`+`Delay`) AS `HaveTime`, `LearnTime`, `Delay`,
ceiling((UNIX_TIMESTAMP(`StartTime`)+(`LearnTime`+`Delay`)*60-UNIX_TIMESTAMP(NOW()))/60) AS `RemainingTime`, `TimeForce`,
`LMode`, `LModeForce`, `MMode`, '1' AS `Lock`,
`LMode`, `LModeForce`, `MMode`, `EnableVirtual`, '1' AS `Lock`,
(SELECT count(`TID`) FROM `".$this->table('TBelong')."` AS `belong` WHERE `belong`.`ThID` = `sa`.`ThID`) AS ` TargetTotal`,
(SELECT count(DISTINCT `TID`) FROM `".$this->table('Study')."` AS `study` WHERE `Out_TargetTime` IS NOT NULL AND `study`.`SaID` = `sa`.`SaID`) AS `LearnedTotal`
@ -740,7 +766,7 @@ SELECT 'will' AS `Type`,
`StartTime`, `ExpiredTime`, `LearnTime` AS `HaveTime`, `LearnTime`, 0 AS `Delay`,
`LearnTime` AS `RemainingTime`, `TimeForce`,
`LMode`, `LModeForce`, `MMode`, `Lock`,
`LMode`, `LModeForce`, `MMode`, `EnableVirtual`, `Lock`,
(SELECT count(`TID`) FROM `".$this->table('TBelong')."` AS `belong` WHERE `belong`.`ThID` = `sw`.`ThID`) AS `TargetTotal`,
0 AS `LearnedTotal`
@ -760,7 +786,7 @@ SELECT 'theme' AS `Type`,
NULL, NULL, `ThLearnTime` AS `HaveTime`, `ThLearnTime`, 0 AS `Delay`,
`ThLearnTime` AS `RemainingTime`, NULL,
NULL, NULL, NULL, 0 AS `Lock`,
NULL, NULL, NULL, 0 AS `EnableVirtual`, 0 AS `Lock`,
(SELECT count(`TID`) FROM `".$this->table('TBelong')."` AS `belong` WHERE `belong`.`ThID` = `th`.`ThID`) AS `TargetTotal`,
0 AS `LearnedTotal`
@ -796,6 +822,11 @@ $sqlString = $sqlString_SA." UNION ".$sqlString_SW." UNION ".$sqlString_TG;
}
else { $output_lock = false; }
if($thisResult['EnableVirtual'] != '0') {
$output_enable_virtual = true;
}
else { $output_enable_virtual = false; }
array_push($result,
array( 'type' => $thisResult['Type'],
'id' => $thisResult['ID'],
@ -813,6 +844,7 @@ $sqlString = $sqlString_SA." UNION ".$sqlString_SW." UNION ".$sqlString_TG;
'time_force' => $output_time_force,
'learnStyle_mode' => $thisResult['LMode'],
'learnStyle_force' => $output_learnStyleForce,
'enable_virtual' => $output_enable_virtual,
'material_mode' => $thisResult['MMode'],
'lock' => $output_lock,
'target_total' => $thisResult['TargetTotal'],

View File

@ -402,6 +402,16 @@ class StudyActivity {
return $this->queryResultArray['learnStyle_force'];
}
/**
* 取得預約學習是否使用虛擬學習點
*
* @return bool 是否啟用虛擬學習點
* @since 2.0.0
*/
public function isEnableVirtual(){
return $this->queryResultArray['enable_virtual'];
}
/**
* 取得這次學習的教材風格
*

View File

@ -50,6 +50,7 @@ class StudyActivityManager {
* @param bool $timeForce 時間到時是否強制中止學習
* @param int $learnStyle 將推薦幾個學習點
* @param bool $learnStyle_force 是否拒絕前往非推薦的學習點
* @param bool $enable_virtual 是否啟用虛擬教材
* @param string $materialMode 教材風格
* @throw UElearning\Exception\UserNoFoundException
* @throw UElearning\Exception\ThemeNoFoundException
@ -57,7 +58,7 @@ class StudyActivityManager {
* @since 2.0.0
*/
public function startActivity( $userId, $themeId, $learnTime, $timeForce,
$learnStyle, $learnStyle_force, $materialMode )
$learnStyle, $learnStyle_force, $enable_virtual, $materialMode )
{
$user = new User\User($userId);
@ -101,10 +102,15 @@ class StudyActivityManager {
}
// 若無指定是否要使用虛擬教材
if(!isset($enable_virtual)) {
$enable_virtual = false;
}
// 存入資料庫
$db = new Database\DBStudyActivity();
$resultId = $db->insertActivity($userId, $themeId, null, null,
$learnTime, 0, $timeForce, $learnStyle, $learnStyle_force, $materialMode);
$learnTime, 0, $timeForce, $learnStyle, $learnStyle_force, $enable_virtual, $materialMode);
// 傳回新增後得到的編號
return $resultId;
@ -127,10 +133,11 @@ class StudyActivityManager {
$timeForce = $sact->isForceLearnTime();
$learnStyle = $sact->getLearnStyle();
$learnStyle_force = $sact->isForceLearnStyle();
$enable_virtual = $sact->isEnableVirtual();
$materialMode = $sact->getMaterialStyle();
$this->startActivity( $userId, $themeId, $learnTime, $timeForce,
$learnStyle, $learnStyle_force, $materialMode );
$learnStyle, $learnStyle_force, $enable_virtual, $materialMode );
}
/**
@ -144,13 +151,15 @@ class StudyActivityManager {
* @param bool $timeForce 學習時間已過是否強制中止學習
* @param int $learnStyle 將推薦幾個學習點
* @param bool $learnStyle_force 是否拒絕前往非推薦的學習點
* @param bool $enable_virtual 是否啟用虛擬教材
* @param string $materialMode 教材風格
* @param bool $lock 是否鎖定不讓學生更改
* @return int 預約學習活動的流水編號
* @since 2.0.0
*/
public function createWiilActivity($userId, $themeId, $startTime, $expiredTime,
$learnTime, $timeForce, $learnStyle, $learnStyle_force, $materialMode, $lock)
$learnTime, $timeForce, $learnStyle, $learnStyle_force,
$enable_virtual, $materialMode, $lock)
{
if($this->checkDataIsExist($userId, $themeId, $materialMode)) {
@ -159,7 +168,7 @@ class StudyActivityManager {
$db = new Database\DBStudyActivity();
$resultId = $db->insertWillActivity($userId, $themeId,
$startTime, $expiredTime, $learnTime, $timeForce,
$learnStyle, $learnStyle_force, $materialMode, $lock);
$learnStyle, $learnStyle_force, $materialMode, $materialMode, $lock);
// 傳回新增後得到的編號
return $resultId;
@ -190,6 +199,7 @@ class StudyActivityManager {
* 'time_force' => <時間到時是否強制中止學習>,
* 'learnStyle_mode' => <學習導引模式>,
* 'learnStyle_force' => <拒絕前往非推薦的學習點>,
* 'enable_virtual' => <是否啟用虛擬教材>,
* 'material_mode' => <教材模式>,
* 'lock' => <是否鎖定不讓學生更改>,
* 'target_total' => <有多少標的學習>,

View File

@ -304,6 +304,29 @@ class StudyWill {
$this->getQuery();
}
/**
* 取得預約學習是否使用虛擬學習點
*
* @return bool 是否啟用虛擬學習點
* @since 2.0.0
*/
public function isEnableVirtual(){
return $this->queryResultArray['enable_virtual'];
}
/**
* 設定預約學習是否使用虛擬學習點
*
* @param bool $value 是否啟用虛擬學習點
* @since 2.0.0
*/
public function setEnableVirtual($value){
$db = new Database\DBStudyActivity();
$db->changeWillActivityData($this->id, 'enable_virtual', $value);
$this->getQuery();
}
/**
* 取得預約學習的教材風格
*

View File

@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u1
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- 主機: localhost
-- 產生日期: 2014 年 12 月 27 日 03:15
-- 伺服器版本: 5.5.40
-- PHP 版本: 5.6.0
-- 產生時間: 2015 年 01 月 06 日 12:56
-- 伺服器版本: 5.6.16
-- PHP 版本 5.5.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
@ -17,13 +17,13 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8 */;
--
-- 資料庫: `uelearning`
-- 資料庫 `UElearning`
--
-- --------------------------------------------------------
--
-- 結構 `chu__AGroup`
-- 資料表結構 `chu__AGroup`
--
CREATE TABLE IF NOT EXISTS `chu__AGroup` (
@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS `chu__AGroup` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='使用者群組權限管理分類';
--
-- 轉存資料表的資料 `chu__AGroup`
-- 資料表的匯出資料 `chu__AGroup`
--
INSERT INTO `chu__AGroup` (`GID`, `GName`, `GMemo`, `GBuildTime`, `GModifyTime`, `GAuth_Admin`, `GAuth_ClientAdmin`) VALUES
@ -50,7 +50,7 @@ INSERT INTO `chu__AGroup` (`GID`, `GName`, `GMemo`, `GBuildTime`, `GModifyTime`,
-- --------------------------------------------------------
--
-- 結構 `chu__Area`
-- 資料表結構 `chu__Area`
--
CREATE TABLE IF NOT EXISTS `chu__Area` (
@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS `chu__Area` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='標的所在的區域分類' AUTO_INCREMENT=15 ;
--
-- 轉存資料表的資料 `chu__Area`
-- 資料表的匯出資料 `chu__Area`
--
INSERT INTO `chu__Area` (`AID`, `HID`, `AFloor`, `ANum`, `AName`, `AMapID`, `AIntroduction`) VALUES
@ -87,7 +87,7 @@ INSERT INTO `chu__Area` (`AID`, `HID`, `AFloor`, `ANum`, `AName`, `AMapID`, `AIn
-- --------------------------------------------------------
--
-- 結構 `chu__CGroup`
-- 資料表結構 `chu__CGroup`
--
CREATE TABLE IF NOT EXISTS `chu__CGroup` (
@ -102,18 +102,19 @@ CREATE TABLE IF NOT EXISTS `chu__CGroup` (
-- --------------------------------------------------------
--
-- 結構 `chu__Edge`
-- 資料表結構 `chu__Edge`
--
CREATE TABLE IF NOT EXISTS `chu__Edge` (
`Ti` int(11) NOT NULL,
`Tj` int(11) NOT NULL,
`MoveTime` int(4) NOT NULL COMMENT '移動時間(分鐘)',
`Distance` int(11) NOT NULL COMMENT '距離(M)'
`Distance` int(11) NOT NULL COMMENT '距離(M)',
PRIMARY KEY (`Ti`,`Tj`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='標的和標的之間';
--
-- 轉存資料表的資料 `chu__Edge`
-- 資料表的匯出資料 `chu__Edge`
--
INSERT INTO `chu__Edge` (`Ti`, `Tj`, `MoveTime`, `Distance`) VALUES
@ -346,7 +347,7 @@ INSERT INTO `chu__Edge` (`Ti`, `Tj`, `MoveTime`, `Distance`) VALUES
-- --------------------------------------------------------
--
-- 結構 `chu__Hall`
-- 資料表結構 `chu__Hall`
--
CREATE TABLE IF NOT EXISTS `chu__Hall` (
@ -358,7 +359,7 @@ CREATE TABLE IF NOT EXISTS `chu__Hall` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='區域所在的廳分類' AUTO_INCREMENT=2 ;
--
-- 轉存資料表的資料 `chu__Hall`
-- 資料表的匯出資料 `chu__Hall`
--
INSERT INTO `chu__Hall` (`HID`, `HName`, `HMapID`, `HIntroduction`) VALUES
@ -367,7 +368,7 @@ INSERT INTO `chu__Hall` (`HID`, `HName`, `HMapID`, `HIntroduction`) VALUES
-- --------------------------------------------------------
--
-- 結構 `chu__Log`
-- 資料表結構 `chu__Log`
--
CREATE TABLE IF NOT EXISTS `chu__Log` (
@ -381,7 +382,7 @@ CREATE TABLE IF NOT EXISTS `chu__Log` (
-- --------------------------------------------------------
--
-- 結構 `chu__Material`
-- 資料表結構 `chu__Material`
--
CREATE TABLE IF NOT EXISTS `chu__Material` (
@ -394,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `chu__Material` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='教材' AUTO_INCREMENT=31 ;
--
-- 轉存資料表的資料 `chu__Material`
-- 資料表的匯出資料 `chu__Material`
--
INSERT INTO `chu__Material` (`MID`, `TID`, `MEntity`, `MMode`, `MUrl`) VALUES
@ -432,7 +433,7 @@ INSERT INTO `chu__Material` (`MID`, `TID`, `MEntity`, `MMode`, `MUrl`) VALUES
-- --------------------------------------------------------
--
-- 結構 `chu__MaterialKind`
-- 資料表結構 `chu__MaterialKind`
--
CREATE TABLE IF NOT EXISTS `chu__MaterialKind` (
@ -442,7 +443,7 @@ CREATE TABLE IF NOT EXISTS `chu__MaterialKind` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- 轉存資料表的資料 `chu__MaterialKind`
-- 資料表的匯出資料 `chu__MaterialKind`
--
INSERT INTO `chu__MaterialKind` (`MkID`, `MkName`) VALUES
@ -451,7 +452,7 @@ INSERT INTO `chu__MaterialKind` (`MkID`, `MkName`) VALUES
-- --------------------------------------------------------
--
-- 結構 `chu__Recommand`
-- 資料表結構 `chu__Recommand`
--
CREATE TABLE IF NOT EXISTS `chu__Recommand` (
@ -463,13 +464,14 @@ CREATE TABLE IF NOT EXISTS `chu__Recommand` (
-- --------------------------------------------------------
--
-- 結構 `chu__Study`
-- 資料表結構 `chu__Study`
--
CREATE TABLE IF NOT EXISTS `chu__Study` (
`SID` int(10) NOT NULL AUTO_INCREMENT,
`SaID` int(10) NOT NULL,
`TID` int(10) NOT NULL COMMENT '標的編號',
`IsEntity` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否為實際抵達學習點',
`In_TargetTime` datetime NOT NULL COMMENT '進入標的時間',
`Out_TargetTime` datetime DEFAULT NULL COMMENT '離開標的時間',
PRIMARY KEY (`SID`)
@ -478,7 +480,7 @@ CREATE TABLE IF NOT EXISTS `chu__Study` (
-- --------------------------------------------------------
--
-- 結構 `chu__StudyActivity`
-- 資料表結構 `chu__StudyActivity`
--
CREATE TABLE IF NOT EXISTS `chu__StudyActivity` (
@ -492,6 +494,7 @@ CREATE TABLE IF NOT EXISTS `chu__StudyActivity` (
`TimeForce` tinyint(1) NOT NULL DEFAULT '0' COMMENT '學習時間已過是否強制中止學習',
`LMode` int(2) NOT NULL DEFAULT '1' COMMENT '學習導引模式',
`LModeForce` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否拒絕前往非推薦點進行學習',
`EnableVirtual` tinyint(1) NOT NULL DEFAULT '0',
`MMode` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '教材模式',
PRIMARY KEY (`SaID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='學習活動' AUTO_INCREMENT=1 ;
@ -499,7 +502,7 @@ CREATE TABLE IF NOT EXISTS `chu__StudyActivity` (
-- --------------------------------------------------------
--
-- 結構 `chu__StudyWill`
-- 資料表結構 `chu__StudyWill`
--
CREATE TABLE IF NOT EXISTS `chu__StudyWill` (
@ -512,6 +515,7 @@ CREATE TABLE IF NOT EXISTS `chu__StudyWill` (
`TimeForce` tinyint(1) NOT NULL DEFAULT '1' COMMENT '學習時間已過是否強制中止學習',
`LMode` int(2) NOT NULL DEFAULT '1' COMMENT '學習導引模式',
`LModeForce` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否拒絕前往非推薦點進行學習',
`EnableVirtual` tinyint(1) NOT NULL DEFAULT '0',
`MMode` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '教材模式',
`Lock` tinyint(1) NOT NULL DEFAULT '1' COMMENT '鎖定不讓學生更改',
`BuildTime` datetime NOT NULL,
@ -522,7 +526,7 @@ CREATE TABLE IF NOT EXISTS `chu__StudyWill` (
-- --------------------------------------------------------
--
-- 結構 `chu__Target`
-- 資料表結構 `chu__Target`
--
CREATE TABLE IF NOT EXISTS `chu__Target` (
@ -539,7 +543,7 @@ CREATE TABLE IF NOT EXISTS `chu__Target` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='標的資訊';
--
-- 轉存資料表的資料 `chu__Target`
-- 資料表的匯出資料 `chu__Target`
--
INSERT INTO `chu__Target` (`TID`, `AID`, `TNum`, `TName`, `TMapID`, `TLearnTime`, `PLj`, `Mj`, `S`) VALUES
@ -563,7 +567,7 @@ INSERT INTO `chu__Target` (`TID`, `AID`, `TNum`, `TName`, `TMapID`, `TLearnTime`
-- --------------------------------------------------------
--
-- 結構 `chu__TBelong`
-- 資料表結構 `chu__TBelong`
--
CREATE TABLE IF NOT EXISTS `chu__TBelong` (
@ -575,7 +579,7 @@ CREATE TABLE IF NOT EXISTS `chu__TBelong` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='標的和主題之間';
--
-- 轉存資料表的資料 `chu__TBelong`
-- 資料表的匯出資料 `chu__TBelong`
--
INSERT INTO `chu__TBelong` (`ThID`, `TID`, `Weights`) VALUES
@ -598,7 +602,7 @@ INSERT INTO `chu__TBelong` (`ThID`, `TID`, `Weights`) VALUES
-- --------------------------------------------------------
--
-- 結構 `chu__Theme`
-- 資料表結構 `chu__Theme`
--
CREATE TABLE IF NOT EXISTS `chu__Theme` (
@ -612,7 +616,7 @@ CREATE TABLE IF NOT EXISTS `chu__Theme` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='主題' AUTO_INCREMENT=3 ;
--
-- 轉存資料表的資料 `chu__Theme`
-- 資料表的匯出資料 `chu__Theme`
--
INSERT INTO `chu__Theme` (`ThID`, `ThName`, `ThLearnTime`, `ThIntroduction`, `ThBuildTime`, `ThModifyTime`) VALUES
@ -621,7 +625,7 @@ INSERT INTO `chu__Theme` (`ThID`, `ThName`, `ThLearnTime`, `ThIntroduction`, `Th
-- --------------------------------------------------------
--
-- 結構 `chu__User`
-- 資料表結構 `chu__User`
--
CREATE TABLE IF NOT EXISTS `chu__User` (
@ -645,7 +649,7 @@ CREATE TABLE IF NOT EXISTS `chu__User` (
-- --------------------------------------------------------
--
-- 結構 `chu__UserSession`
-- 資料表結構 `chu__UserSession`
--
CREATE TABLE IF NOT EXISTS `chu__UserSession` (