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


PHP question_attempt_step::get_user_id方法代碼示例

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


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

示例1: test_constructor_given_params

 public function test_constructor_given_params()
 {
     global $USER;
     $step = new question_attempt_step(array(), 123, 5);
     $this->assertEquals(123, $step->get_timecreated());
     $this->assertEquals(5, $step->get_user_id());
     $this->assertEquals(array(), $step->get_qt_data());
     $this->assertEquals(array(), $step->get_behaviour_data());
 }
開發者ID:jackdaniels79,項目名稱:moodle,代碼行數:9,代碼來源:questionattemptstep_test.php

示例2: make_step_record

 /**
  * Helper method used by insert_question_attempt_step and update_question_attempt_step
  * @param question_attempt_step $step the step to store.
  * @param int $questionattemptid the question attept id this step belongs to.
  * @param int $seq the sequence number of this stop.
  * @return stdClass data to insert into the database.
  */
 protected function make_step_record(question_attempt_step $step, $questionattemptid, $seq)
 {
     $record = new stdClass();
     $record->questionattemptid = $questionattemptid;
     $record->sequencenumber = $seq;
     $record->state = (string) $step->get_state();
     $record->fraction = $step->get_fraction();
     $record->timecreated = $step->get_timecreated();
     $record->userid = $step->get_user_id();
     return $record;
 }
開發者ID:covex-nn,項目名稱:moodle,代碼行數:18,代碼來源:datalib.php

示例3: insert_question_attempt_step

 /**
  * Store a {@link question_attempt_step} in the database.
  * @param question_attempt_step $qa the step to store.
  * @param int $questionattemptid the question attept id this step belongs to.
  * @param int $seq the sequence number of this stop.
  * @param object $context the context of the owning question_usage_by_activity.
  */
 public function insert_question_attempt_step(question_attempt_step $step, $questionattemptid, $seq, $context)
 {
     $record = new stdClass();
     $record->questionattemptid = $questionattemptid;
     $record->sequencenumber = $seq;
     $record->state = '' . $step->get_state();
     $record->fraction = $step->get_fraction();
     $record->timecreated = $step->get_timecreated();
     $record->userid = $step->get_user_id();
     $record->id = $this->db->insert_record('question_attempt_steps', $record);
     foreach ($step->get_all_data() as $name => $value) {
         if ($value instanceof question_file_saver) {
             $value->save_files($record->id, $context);
         }
         $data = new stdClass();
         $data->attemptstepid = $record->id;
         $data->name = $name;
         $data->value = $value;
         $this->db->insert_record('question_attempt_step_data', $data, false);
     }
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:28,代碼來源:datalib.php


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