我在Moodle工作,但有一个php-mysql的相关疑问,由于缺乏我的知识,这些疑问正在变得复杂。
我有一个疑问,即产出罚款回报。 采用I-ELSe条件,需要检查,是否将一个有方位的田地和一个包含多个领域的田地结合起来。
在数据库表中,Im站点检查的类型如下。
element - varchar(255)
value - longtext
这是我对如下文所述 o/p的回击:
Query
$scormstatus = $DB->get_records_sql("SELECT sc.*, s.name AS activityname FROM mdl_scorm_scoes_track AS sc JOIN mdl_scorm AS s ON s.id = sc.scormid WHERE sc.scormid = " .$activityid. " AND sc.userid = " .$userid. " AND sc.attempt = ".$scormattempt->attempt." ");
foreach($scormstatus as $status)
{
echo "<br/>".$status->element."**".$status->value."<br/>";
if(is_numeric($status->value))
{
if($status->element = cmi.core.score.raw && $status->value != 0 )
{
echo "<br/>Score";
}
else
{
if($status->element = x.start.time && $status->value != 0 )
{
echo "<br/>Started";
}
}
}
}
产出:
cmi.core.lesson_location**2
Score
cmi.core.lesson_status**incomplete
cmi.core.score.max**50
Score
cmi.core.score.min**0
cmi.core.score.raw**0
cmi.core.total_time**00:00:22.00
x.start.time**1334767290
Score
Now as you would have seen that even though I m checking for a condition which is a combination of cmi.core.score.raw and value greater than 0 it still prints Score for all records and never goes in the else part.
理想的做法是产出 我期待着看到这样的情况。
国际民主和选举援助学会
cmi.core.lesson_location**2
cmi.core.lesson_status**incomplete
cmi.core.score.max**50
cmi.core.score.min**0
cmi.core.score.raw**0
cmi.core.total_time**00:00:22.00
x.start.time**1334767290
Started
我的猜测是,承认我在法国-法国-欧洲经济论坛案中的一些价值领域,因此总是在错误的综合框架中结束。
Any guesses as to what is happening. Thanks in advance