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


PHP question_attempt::get_full_qa方法代碼示例

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


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

示例1: __construct

 /**
  * Create a question_attempt_with_restricted_history
  * @param question_attempt $baseqa The question_attempt to make a restricted version of.
  * @param int $lastseq the index of the last step to include.
  * @param string $preferredbehaviour the preferred behaviour. It is slightly
  *      annoyting that this needs to be passed, but unavoidable for now.
  */
 public function __construct(question_attempt $baseqa, $lastseq, $preferredbehaviour)
 {
     $this->baseqa = $baseqa->get_full_qa();
     if ($lastseq < 0 || $lastseq >= $this->baseqa->get_num_steps()) {
         throw new coding_exception('$lastseq out of range', $lastseq);
     }
     $this->steps = array_slice($this->baseqa->steps, 0, $lastseq + 1);
     $this->observer = new question_usage_null_observer();
     // This should be a straight copy of all the remaining fields.
     $this->id = $this->baseqa->id;
     $this->usageid = $this->baseqa->usageid;
     $this->slot = $this->baseqa->slot;
     $this->question = $this->baseqa->question;
     $this->maxmark = $this->baseqa->maxmark;
     $this->minfraction = $this->baseqa->minfraction;
     $this->maxfraction = $this->baseqa->maxfraction;
     $this->questionsummary = $this->baseqa->questionsummary;
     $this->responsesummary = $this->baseqa->responsesummary;
     $this->rightanswer = $this->baseqa->rightanswer;
     $this->flagged = $this->baseqa->flagged;
     // Except behaviour, where we need to create a new one.
     $this->behaviour = question_engine::make_behaviour($this->baseqa->get_behaviour_name(), $this, $preferredbehaviour);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:30,代碼來源:questionattempt.php


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