当前位置: 首页>>代码示例>>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;未经允许,请勿转载。