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


PHP question_engine_data_mapper::load_attempts_at_question方法代碼示例

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


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

示例1: analyse

 /**
  * Analyse all the response data for for all the specified attempts at
  * this question.
  * @param $qubaids which attempts to consider.
  */
 public function analyse($qubaids)
 {
     // Load data.
     $dm = new question_engine_data_mapper();
     $questionattempts = $dm->load_attempts_at_question($this->questiondata->id, $qubaids);
     // Analyse it.
     foreach ($questionattempts as $qa) {
         $this->add_data_from_one_attempt($qa);
     }
     $this->loaded = true;
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:16,代碼來源:responseanalysis.php

示例2: display_analysis

 /**
  * Display analysis of a particular question in this quiz.
  * @param object $question the row from the question table for the question to analyse.
  */
 public function display_analysis($question)
 {
     get_question_options($question);
     $this->display_question_information($question);
     $dm = new question_engine_data_mapper();
     $this->attempts = $dm->load_attempts_at_question($question->id, $this->qubaids);
     // Setup useful internal arrays for report generation.
     $this->inputs = array_keys($question->inputs);
     $this->prts = array_keys($question->prts);
     // TODO: change this to be a list of all *deployed* notes, not just those *used*.
     $qnotes = array();
     foreach ($this->attempts as $qa) {
         $q = $qa->get_question();
         $qnotes[$q->get_question_summary()] = true;
     }
     $this->qnotes = array_keys($qnotes);
     // Compute results.
     list($results, $answernoteresults, $answernoteresultsraw) = $this->input_report();
     list($validresults, $invalidresults) = $this->input_report_separate();
     // Display the results.
     // Overall results.
     $i = 0;
     $list = '';
     $tablehead = array();
     foreach ($this->qnotes as $qnote) {
         $list .= html_writer::tag('li', stack_ouput_castext($qnote));
         $i++;
         $tablehead[] = $i;
     }
     $tablehead[] = format_string(get_string('questionreportingtotal', 'quiz_stack'));
     $tablehead = array_merge(array(''), $tablehead, $tablehead);
     echo html_writer::tag('p', get_string('notesused', 'quiz_stack'));
     echo html_writer::tag('ol', $list);
     // Complete anwernotes.
     $inputstable = new html_table();
     $inputstable->head = $tablehead;
     $data = array();
     foreach ($answernoteresults as $prt => $anotedata) {
         if (count($answernoteresults) > 1) {
             $inputstable->data[] = array(html_writer::tag('b', $this->prts[$prt]));
         }
         $cstats = $this->column_stats($anotedata);
         foreach ($anotedata as $anote => $a) {
             $inputstable->data[] = array_merge(array($anote), $a, array(array_sum($a)), $cstats[$anote]);
         }
     }
     echo html_writer::tag('p', get_string('completenotes', 'quiz_stack'));
     echo html_writer::table($inputstable);
     // Split anwernotes.
     $inputstable = new html_table();
     $inputstable->head = $tablehead;
     foreach ($answernoteresultsraw as $prt => $anotedata) {
         if (count($answernoteresultsraw) > 1) {
             $inputstable->data[] = array(html_writer::tag('b', $this->prts[$prt]));
         }
         $cstats = $this->column_stats($anotedata);
         foreach ($anotedata as $anote => $a) {
             $inputstable->data[] = array_merge(array($anote), $a, array(array_sum($a)), $cstats[$anote]);
         }
     }
     echo html_writer::tag('p', get_string('splitnotes', 'quiz_stack'));
     echo html_writer::table($inputstable);
     // Maxima analysis.
     $maxheader = array();
     $maxheader[] = "STACK input data for the question '" . $question->name . "'";
     $maxheader[] = new moodle_url($this->get_base_url(), array('questionid' => $question->id));
     $maxheader[] = "Data generated: " . date("Y-m-d H:i:s");
     $maximacode = $this->maxima_comment($maxheader);
     $maximacode .= "\ndisplay2d:true\$\nload(\"stackreporting\")\$\n";
     $maximacode .= "stackdata:[]\$\n";
     $variants = array();
     foreach ($this->qnotes as $qnote) {
         $variants[] = '"' . $qnote . '"';
     }
     $inputs = array();
     foreach ($this->inputs as $input) {
         $inputs[] = $input;
     }
     $anymaximadata = false;
     // Results for each question note.
     foreach ($this->qnotes as $qnote) {
         echo html_writer::tag('h2', get_string('variantx', 'quiz_stack') . stack_ouput_castext($qnote));
         $inputstable = new html_table();
         $inputstable->attributes['class'] = 'generaltable stacktestsuite';
         $inputstable->head = array_merge(array(get_string('questionreportingsummary', 'quiz_stack'), '', get_string('questionreportingscore', 'quiz_stack')), $this->prts);
         foreach ($results[$qnote] as $dsummary => $summary) {
             foreach ($summary as $key => $res) {
                 $inputstable->data[] = array_merge(array($dsummary, $res['count'], $res['fraction']), $res['answernotes']);
             }
         }
         echo html_writer::table($inputstable);
         // Separate out inputs and look at validity.
         $validresultsdata = array();
         foreach ($this->inputs as $input) {
             $inputstable = new html_table();
             $inputstable->attributes['class'] = 'generaltable stacktestsuite';
//.........這裏部分代碼省略.........
開發者ID:sanyaade-teachings,項目名稱:quiz_stack,代碼行數:101,代碼來源:report.php

示例3: calculate

 /**
  * Analyse all the response data for for all the specified attempts at this question.
  *
  * @param \qubaid_condition $qubaids which attempts to consider.
  * @param string $whichtries         which tries to analyse. Will be one of
  *                                   \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
  * @return analysis_for_question
  */
 public function calculate($qubaids, $whichtries = \question_attempt::LAST_TRY)
 {
     // Load data.
     $dm = new \question_engine_data_mapper();
     $questionattempts = $dm->load_attempts_at_question($this->questiondata->id, $qubaids);
     // Analyse it.
     foreach ($questionattempts as $qa) {
         $responseparts = $qa->classify_response($whichtries);
         if ($this->breakdownbyvariant) {
             $this->analysis->count_response_parts($qa->get_variant(), $responseparts);
         } else {
             $this->analysis->count_response_parts(1, $responseparts);
         }
     }
     $this->analysis->cache($qubaids, $whichtries, $this->questiondata->id);
     return $this->analysis;
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:25,代碼來源:analyser.php

示例4: calculate

 /**
  * Analyse all the response data for for all the specified attempts at
  * this question.
  * @param \qubaid_condition $qubaids which attempts to consider.
  * @return analysis_for_question
  */
 public function calculate($qubaids)
 {
     // Load data.
     $dm = new \question_engine_data_mapper();
     $questionattempts = $dm->load_attempts_at_question($this->questiondata->id, $qubaids);
     // Analyse it.
     foreach ($questionattempts as $qa) {
         $responseparts = $qa->classify_response();
         $this->analysis->count_response_parts($responseparts);
     }
     $this->analysis->cache($qubaids, $this->questiondata->id);
     return $this->analysis;
 }
開發者ID:EmmanuelYupit,項目名稱:educursos,代碼行數:19,代碼來源:analyser.php


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