當前位置: 首頁>>代碼示例>>PHP>>正文


PHP test_question_maker::make_a_description_question方法代碼示例

本文整理匯總了PHP中test_question_maker::make_a_description_question方法的典型用法代碼示例。如果您正苦於以下問題:PHP test_question_maker::make_a_description_question方法的具體用法?PHP test_question_maker::make_a_description_question怎麽用?PHP test_question_maker::make_a_description_question使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在test_question_maker的用法示例。


在下文中一共展示了test_question_maker::make_a_description_question方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_informationitem_feedback_description

 public function test_informationitem_feedback_description()
 {
     // Create a true-false question with correct answer true.
     $description = test_question_maker::make_a_description_question();
     $this->start_attempt_at_question($description, 'deferredfeedback');
     // Check the initial state.
     $this->check_current_state(question_state::$todo);
     $this->check_current_mark(null);
     $this->check_current_output($this->get_contains_question_text_expectation($description), new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => $this->quba->get_field_prefix($this->slot) . '-seen', 'value' => 1)), $this->get_does_not_contain_feedback_expectation());
     // Process a submission indicating this question has been seen.
     $this->process_submission(array('-seen' => 1));
     $this->check_current_state(question_state::$complete);
     $this->check_current_mark(null);
     $this->check_current_output($this->get_does_not_contain_correctness_expectation(), new NoPatternExpectation('/type=\\"hidden\\"[^>]*name=\\"[^"]*seen\\"|name=\\"[^"]*seen\\"[^>]*type=\\"hidden\\"/'), $this->get_does_not_contain_feedback_expectation());
     // Finish the attempt.
     $this->quba->finish_all_questions();
     // Verify.
     $this->check_current_state(question_state::$finished);
     $this->check_current_mark(null);
     $this->check_current_output($this->get_contains_question_text_expectation($description), $this->get_contains_general_feedback_expectation($description));
     // Process a manual comment.
     $this->manual_grade('Not good enough!', null);
     $this->check_current_state(question_state::$manfinished);
     $this->check_current_mark(null);
     $this->check_current_output(new PatternExpectation('/' . preg_quote('Not good enough!') . '/'));
     // Check that trying to process a manual comment with a grade causes an exception.
     $this->expectException();
     $this->manual_grade('Not good enough!', 1);
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:29,代碼來源:testwalkthrough.php

示例2: setUp

 public function setUp()
 {
     $this->quba = question_engine::make_questions_usage_by_activity('unit_test', get_context_instance(CONTEXT_SYSTEM));
     $this->quba->set_preferred_behaviour('deferredfeedback');
     $slot = $this->quba->add_question(test_question_maker::make_a_description_question());
     $this->qas[$slot] = $this->quba->get_question_attempt($slot);
     $slot = $this->quba->add_question(test_question_maker::make_a_description_question());
     $this->qas[$slot] = $this->quba->get_question_attempt($slot);
     $this->iterator = $this->quba->get_attempt_iterator();
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:10,代碼來源:testquestionattemptiterator.php

示例3: setUp

 public function setUp()
 {
     $question = test_question_maker::make_a_description_question();
     $this->qa = new testable_question_attempt($question, 0);
     for ($i = 0; $i < 3; $i++) {
         $step = new question_attempt_step(array('i' => $i));
         $this->qa->add_step($step);
     }
     $this->iterator = $this->qa->get_step_iterator();
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:10,代碼來源:testquestionattemptstepiterator.php

示例4: setUp

 public function setUp()
 {
     $this->question = test_question_maker::make_a_description_question();
     $this->qa = new testable_question_attempt($this->question, 0, null, 2);
     for ($i = 0; $i < 3; $i++) {
         $step = new question_attempt_step(array('i' => $i));
         $this->qa->add_step($step);
     }
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:9,代碼來源:testquestionattempt.php


注:本文中的test_question_maker::make_a_description_question方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。