本文整理汇总了PHP中quiz_access_manager::cannot_review_message方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz_access_manager::cannot_review_message方法的具体用法?PHP quiz_access_manager::cannot_review_message怎么用?PHP quiz_access_manager::cannot_review_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz_access_manager
的用法示例。
在下文中一共展示了quiz_access_manager::cannot_review_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_cannot_review_message
public function test_cannot_review_message()
{
$quiz = new stdClass();
$quiz->reviewattempt = 0x10010;
$quiz->timeclose = 0;
$quiz->attempts = 0;
$quiz->questions = '1,2,0,3,4,0';
$cm = new stdClass();
$cm->id = 123;
$quizobj = new quiz($quiz, $cm, new stdClass(), false);
$am = new quiz_access_manager($quizobj, time(), false);
$this->assertEqual('', $am->cannot_review_message(mod_quiz_display_options::DURING));
$this->assertEqual('', $am->cannot_review_message(mod_quiz_display_options::IMMEDIATELY_AFTER));
$this->assertEqual(get_string('noreview', 'quiz'), $am->cannot_review_message(mod_quiz_display_options::LATER_WHILE_OPEN));
$this->assertEqual(get_string('noreview', 'quiz'), $am->cannot_review_message(mod_quiz_display_options::AFTER_CLOSE));
$closetime = time() + 10000;
$quiz->timeclose = $closetime;
$quizobj = new quiz($quiz, $cm, new stdClass(), false);
$am = new quiz_access_manager($quizobj, time(), false);
$this->assertEqual(get_string('noreviewuntil', 'quiz', userdate($closetime)), $am->cannot_review_message(mod_quiz_display_options::LATER_WHILE_OPEN));
}