当前位置: 首页>>代码示例>>PHP>>正文


PHP question_attempt::get_max_mark方法代码示例

本文整理汇总了PHP中question_attempt::get_max_mark方法的典型用法代码示例。如果您正苦于以下问题:PHP question_attempt::get_max_mark方法的具体用法?PHP question_attempt::get_max_mark怎么用?PHP question_attempt::get_max_mark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在question_attempt的用法示例。


在下文中一共展示了question_attempt::get_max_mark方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: feedback

 public function feedback(question_attempt $qa, question_display_options $options)
 {
     if (!$options->feedback) {
         return '';
     }
     if ($qa->get_state() == question_state::$gaveup || $qa->get_state() == question_state::$mangaveup) {
         return '';
     }
     $feedback = '';
     if (!$qa->get_last_behaviour_var('certainty') && $qa->get_last_behaviour_var('_assumedcertainty')) {
         $feedback .= html_writer::tag('p', get_string('assumingcertainty', 'qbehaviour_deferredcbm', question_cbm::get_string($qa->get_last_behaviour_var('_assumedcertainty'))));
     }
     if ($options->marks >= question_display_options::MARK_AND_MAX) {
         $a->rawmark = format_float($qa->get_last_behaviour_var('_rawfraction') * $qa->get_max_mark(), $options->markdp);
         $a->mark = $qa->format_mark($options->markdp);
         $feedback .= html_writer::tag('p', get_string('markadjustment', 'qbehaviour_deferredcbm', $a));
     }
     return $feedback;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:19,代码来源:renderer.php

示例2: penalty_info

 /**
  * Display the information about the penalty calculations.
  * @param question_attempt $qa the question attempt.
  * @param object $mark contains information about the current mark.
  * @param question_display_options $options display options.
  */
 protected function penalty_info(question_attempt $qa, $mark, question_display_options $options)
 {
     $currentpenalty = $qa->get_question()->penalty * $qa->get_max_mark();
     $totalpenalty = $currentpenalty * $qa->get_last_behaviour_var('_try', 0);
     if ($currentpenalty == 0) {
         return '';
     }
     $output = '';
     // Print details of grade adjustment due to penalties
     if ($mark->raw != $mark->cur) {
         $output .= ' ' . get_string('gradingdetailsadjustment', 'qbehaviour_adaptive', $mark);
     }
     // Print information about any new penalty, only relevant if the answer can be improved.
     if ($qa->get_behaviour()->is_state_improvable($qa->get_state())) {
         $output .= ' ' . get_string('gradingdetailspenalty', 'qbehaviour_adaptive', format_float($currentpenalty, $options->markdp));
         // Print information about total penalties so far, if larger than current penalty.
         if ($totalpenalty > $currentpenalty) {
             $output .= ' ' . get_string('gradingdetailspenaltytotal', 'qbehaviour_adaptive', format_float($totalpenalty, $options->markdp));
         }
     }
     return $output;
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:28,代码来源:renderer.php

示例3: test_maxmark_beats_default_mark

 public function test_maxmark_beats_default_mark()
 {
     $qa = new question_attempt($this->question, $this->usageid, null, 2);
     $this->assertEquals(2, $qa->get_max_mark());
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:5,代码来源:questionattempt_test.php

示例4: standard_mark_summary

 /**
  * Generate the display of the marks for this question.
  * @param question_attempt $qa the question attempt to display.
  * @param question_display_options $options controls what should and should not be displayed.
  * @return HTML fragment.
  */
 public function standard_mark_summary(question_attempt $qa, qbehaviour_renderer $behaviouroutput, question_display_options $options)
 {
     if (!$options->marks) {
         return '';
     } else {
         if ($qa->get_max_mark() == 0) {
             return get_string('notgraded', 'question');
         } else {
             if ($options->marks == question_display_options::MAX_ONLY || is_null($qa->get_fraction())) {
                 return $behaviouroutput->marked_out_of_max($qa, $this, $options);
             } else {
                 return $behaviouroutput->mark_out_of_max($qa, $this, $options);
             }
         }
     }
 }
开发者ID:matiasma,项目名称:moodle,代码行数:22,代码来源:renderer.php

示例5: update_question_attempt

 /**
  * Update a question_attempts row to refect any changes in a question_attempt
  * (but not any of its steps).
  * @param question_attempt $qa the question attempt that has changed.
  */
 public function update_question_attempt(question_attempt $qa)
 {
     $record = new stdClass();
     $record->id = $qa->get_database_id();
     $record->maxmark = $qa->get_max_mark();
     $record->minfraction = $qa->get_min_fraction();
     $record->maxfraction = $qa->get_max_fraction();
     $record->flagged = $qa->is_flagged();
     $record->questionsummary = $qa->get_question_summary();
     $record->rightanswer = $qa->get_right_answer_summary();
     $record->responsesummary = $qa->get_response_summary();
     $record->timemodified = time();
     $this->db->update_record('question_attempts', $record);
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:19,代码来源:datalib.php

示例6: mark_summary

 /**
  * Generate the display of the marks for this question.
  * @param question_attempt $qa the question attempt to display.
  * @param question_display_options $options controls what should and should not be displayed.
  * @return HTML fragment.
  */
 protected function mark_summary(question_attempt $qa, question_display_options $options)
 {
     if (!$options->marks) {
         return '';
     }
     if ($qa->get_max_mark() == 0) {
         $summary = get_string('notgraded', 'question');
     } else {
         if ($options->marks == question_display_options::MAX_ONLY || is_null($qa->get_fraction())) {
             //$summary = get_string('markedoutofmax', 'question',
             if ($qa->format_max_mark($options->markdp) > 1) {
                 $summary = get_string('points', 'question', $qa->format_max_mark($options->markdp));
             } else {
                 $summary = get_string('point', 'question', $qa->format_max_mark($options->markdp));
             }
         } else {
             $a = new stdClass();
             $a->mark = $qa->format_mark($options->markdp);
             $a->max = $qa->format_max_mark($options->markdp);
             $summary = get_string('markoutofmax', 'question', $a);
         }
     }
     return html_writer::tag('h2', $summary, array('class' => 'grade quizpoints_no'));
 }
开发者ID:vinoth4891,项目名称:clinique,代码行数:30,代码来源:renderer.php

示例7: manual_comment_fields

 public function manual_comment_fields(question_attempt $qa, question_display_options $options)
 {
     $inputname = $qa->get_behaviour_field_name('comment');
     $id = $inputname . '_id';
     list($commenttext, $commentformat) = $qa->get_current_manual_comment();
     $editor = editors_get_preferred_editor($commentformat);
     $strformats = format_text_menu();
     $formats = $editor->get_supported_formats();
     foreach ($formats as $fid) {
         $formats[$fid] = $strformats[$fid];
     }
     $commenttext = format_text($commenttext, $commentformat, array('para' => false));
     $editor->set_text($commenttext);
     $editor->use_editor($id, array('context' => $options->context));
     $commenteditor = html_writer::tag('div', html_writer::tag('textarea', s($commenttext), array('id' => $id, 'name' => $inputname, 'rows' => 10, 'cols' => 60)));
     $editorformat = '';
     if (count($formats) == 1) {
         reset($formats);
         $editorformat .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $inputname . 'format', 'value' => key($formats)));
     } else {
         $editorformat = html_writer::start_tag('div', array('class' => 'fitem'));
         $editorformat .= html_writer::start_tag('div', array('class' => 'fitemtitle'));
         $editorformat .= html_writer::tag('label', get_string('format'), array('for' => 'menu' . $inputname . 'format'));
         $editorformat .= html_writer::end_tag('div');
         $editorformat .= html_writer::start_tag('div', array('class' => 'felement fhtmleditor'));
         $editorformat .= html_writer::select($formats, $inputname . 'format', $commentformat, '');
         $editorformat .= html_writer::end_tag('div');
         $editorformat .= html_writer::end_tag('div');
     }
     $comment = html_writer::tag('div', html_writer::tag('div', html_writer::tag('label', get_string('comment', 'question'), array('for' => $id)), array('class' => 'fitemtitle')) . html_writer::tag('div', $commenteditor, array('class' => 'felement fhtmleditor')), array('class' => 'fitem'));
     $comment .= $editorformat;
     $mark = '';
     if ($qa->get_max_mark()) {
         $currentmark = $qa->get_current_manual_mark();
         $maxmark = $qa->get_max_mark();
         $fieldsize = strlen($qa->format_max_mark($options->markdp)) - 1;
         $markfield = $qa->get_behaviour_field_name('mark');
         $attributes = array('type' => 'text', 'size' => $fieldsize, 'name' => $markfield, 'id' => $markfield);
         if (!is_null($currentmark)) {
             $attributes['value'] = $currentmark;
         }
         $a = new stdClass();
         $a->max = $qa->format_max_mark($options->markdp);
         $a->mark = html_writer::empty_tag('input', $attributes);
         $markrange = html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $qa->get_behaviour_field_name('maxmark'), 'value' => $maxmark)) . html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $qa->get_control_field_name('minfraction'), 'value' => $qa->get_min_fraction())) . html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $qa->get_control_field_name('maxfraction'), 'value' => $qa->get_max_fraction()));
         $error = $qa->validate_manual_mark($currentmark);
         $errorclass = '';
         if ($error !== '') {
             $erroclass = ' error';
             $error = html_writer::tag('span', $error, array('class' => 'error')) . html_writer::empty_tag('br');
         }
         $mark = html_writer::tag('div', html_writer::tag('div', html_writer::tag('label', get_string('mark', 'question'), array('for' => $markfield)), array('class' => 'fitemtitle')) . html_writer::tag('div', $error . get_string('xoutofmax', 'question', $a) . $markrange, array('class' => 'felement ftext' . $errorclass)), array('class' => 'fitem'));
     }
     return html_writer::tag('fieldset', html_writer::tag('div', $comment . $mark, array('class' => 'fcontainer clearfix')), array('class' => 'hidden'));
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:55,代码来源:rendererbase.php


注:本文中的question_attempt::get_max_mark方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。