本文整理汇总了PHP中completion_info::internal_get_grade_state方法的典型用法代码示例。如果您正苦于以下问题:PHP completion_info::internal_get_grade_state方法的具体用法?PHP completion_info::internal_get_grade_state怎么用?PHP completion_info::internal_get_grade_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类completion_info
的用法示例。
在下文中一共展示了completion_info::internal_get_grade_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_internal_get_grade_state
public function test_internal_get_grade_state()
{
$this->mock_setup();
$item = new stdClass();
$grade = new stdClass();
$item->gradepass = 4;
$item->hidden = 0;
$grade->rawgrade = 4.0;
$grade->finalgrade = null;
// Grade has pass mark and is not hidden, user passes.
$this->assertEquals(COMPLETION_COMPLETE_PASS, completion_info::internal_get_grade_state($item, $grade));
// Same but user fails.
$grade->rawgrade = 3.9;
$this->assertEquals(COMPLETION_COMPLETE_FAIL, completion_info::internal_get_grade_state($item, $grade));
// User fails on raw grade but passes on final.
$grade->finalgrade = 4.0;
$this->assertEquals(COMPLETION_COMPLETE_PASS, completion_info::internal_get_grade_state($item, $grade));
// Item is hidden.
$item->hidden = 1;
$this->assertEquals(COMPLETION_COMPLETE, completion_info::internal_get_grade_state($item, $grade));
// Item isn't hidden but has no pass mark.
$item->hidden = 0;
$item->gradepass = 0;
$this->assertEquals(COMPLETION_COMPLETE, completion_info::internal_get_grade_state($item, $grade));
}