將陣列回傳(2D)改成1D Array回傳 in DBRecommand.php
This commit is contained in:
parent
c75ad9a358
commit
0fd277cfc6
@ -82,7 +82,7 @@ class DBRecommand extends Database
|
|||||||
$whereClause = $this->table('TBelong').".ThID = ".$this->connDB->quote($theme_number)." AND ".$this->table('TBelong').".TID = ".$this->connDB->quote($next_point);
|
$whereClause = $this->table('TBelong').".ThID = ".$this->connDB->quote($theme_number)." AND ".$this->table('TBelong').".TID = ".$this->connDB->quote($next_point);
|
||||||
$AllOfResult = $this->queryBelongByWhere($whereClause);
|
$AllOfResult = $this->queryBelongByWhere($whereClause);
|
||||||
|
|
||||||
if(count($AllOfResult) != 0) return $AllOfResult;
|
if(count($AllOfResult) != 0) return $AllOfResult[0];
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ require_once UELEARNING_ROOT.'/config.php';
|
|||||||
require_once UELEARNING_LIB_ROOT.'/Target/Target.php';
|
require_once UELEARNING_LIB_ROOT.'/Target/Target.php';
|
||||||
require_once UELEARNING_LIB_ROOT.'/Database/DBRecommand.php';
|
require_once UELEARNING_LIB_ROOT.'/Database/DBRecommand.php';
|
||||||
require_once UELEARNING_LIB_ROOT.'/Study/Theme.php';
|
require_once UELEARNING_LIB_ROOT.'/Study/Theme.php';
|
||||||
|
require_once UELEARNING_LIB_ROOT.'/Study/Study.php';
|
||||||
|
require_once UELEARNING_LIB_ROOT.'/Study/StudyActivity.php';
|
||||||
use UElearning\Target;
|
use UElearning\Target;
|
||||||
use UElearning\Study;
|
use UElearning\Study;
|
||||||
use UElearning\Database;
|
use UElearning\Database;
|
||||||
@ -47,7 +49,7 @@ class RecommandPoint
|
|||||||
* 計算正規化參數
|
* 計算正規化參數
|
||||||
* @return double 正規化參數
|
* @return double 正規化參數
|
||||||
*/
|
*/
|
||||||
private function computeNormalizationParameter($theme_number)
|
public function computeNormalizationParameter($theme_number)
|
||||||
{
|
{
|
||||||
$normal = 0; //正規化之後的GAMMA值
|
$normal = 0; //正規化之後的GAMMA值
|
||||||
$EntitySum = 0; //實體學習點分別算銓重之後的值
|
$EntitySum = 0; //實體學習點分別算銓重之後的值
|
||||||
@ -62,7 +64,7 @@ class RecommandPoint
|
|||||||
$move_time = $edge[$i]["move_time"];
|
$move_time = $edge[$i]["move_time"];
|
||||||
$next_target = new Target\Target($next_point);
|
$next_target = new Target\Target($next_point);
|
||||||
$belong = $this->recommand->queryBelongByID($next_point,$theme->getId());
|
$belong = $this->recommand->queryBelongByID($next_point,$theme->getId());
|
||||||
$weight = $belong[0]["weight"];
|
$weight = $belong["weight"];
|
||||||
|
|
||||||
$VirtualSum += $weight / $next_target->getLearnTime();
|
$VirtualSum += $weight / $next_target->getLearnTime();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user