• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP format_float函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中format_float函数的典型用法代码示例。如果您正苦于以下问题:PHP format_float函数的具体用法?PHP format_float怎么用?PHP format_float使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: determine_format

 /**
  * Build this UI element.
  *
  * @return element
  */
 public function determine_format()
 {
     $decimals = $this->item->get_decimals();
     $min = format_float($this->item->grademin, $decimals);
     $max = format_float($this->item->grademax, $decimals);
     return new empty_element("{$min} - {$max}");
 }
开发者ID:evltuma,项目名称:moodle,代码行数:12,代码来源:range.php


示例2: col_frequency

 function col_frequency($response){
     if ($this->question->_stats->s){
         return format_float((($response->rcount / $this->question->_stats->s)*100),2).'%';
     } else {
         return '';
     }
 }
开发者ID:nfreear,项目名称:moodle,代码行数:7,代码来源:statistics_question_table.php


示例3: test_adaptive_multichoice

 public function test_adaptive_multichoice()
 {
     // Create a multiple choice, single response question.
     $mc = test_question_maker::make_a_multichoice_single_question();
     $mc->penalty = 0.3333333;
     $this->start_attempt_at_question($mc, 'adaptive', 3);
     $rightindex = $this->get_mc_right_answer_index($mc);
     $wrongindex = ($rightindex + 1) % 3;
     // Check the initial state.
     $this->check_current_state(question_state::$todo);
     $this->check_current_mark(null);
     $this->check_current_output($this->get_contains_marked_out_of_summary(), $this->get_contains_question_text_expectation($mc), $this->get_contains_mc_radio_expectation(0, true, false), $this->get_contains_mc_radio_expectation(1, true, false), $this->get_contains_mc_radio_expectation(2, true, false), $this->get_contains_submit_button_expectation(true), $this->get_does_not_contain_feedback_expectation());
     // Process a submit.
     $this->process_submission(array('answer' => $wrongindex, '-submit' => 1));
     // Verify.
     $this->check_current_state(question_state::$todo);
     $this->check_current_mark(0);
     $this->check_current_output($this->get_contains_mark_summary(0), $this->get_contains_mc_radio_expectation($wrongindex, true, true), $this->get_contains_mc_radio_expectation(($wrongindex + 1) % 3, true, false), $this->get_contains_mc_radio_expectation(($wrongindex + 2) % 3, true, false), $this->get_contains_incorrect_expectation());
     $this->assertPattern('/B|C/', $this->quba->get_response_summary($this->slot));
     // Process a change of answer to the right one, but not sumbitted.
     $this->process_submission(array('answer' => $rightindex));
     // Verify.
     $this->check_current_state(question_state::$todo);
     $this->check_current_mark(0);
     $this->check_current_output($this->get_contains_mark_summary(0), $this->get_contains_mc_radio_expectation($rightindex, true, true), $this->get_contains_mc_radio_expectation(($rightindex + 1) % 3, true, false), $this->get_contains_mc_radio_expectation(($rightindex + 2) % 3, true, false));
     $this->assertPattern('/B|C/', $this->quba->get_response_summary($this->slot));
     // Now submit the right answer.
     $this->process_submission(array('answer' => $rightindex, '-submit' => 1));
     // Verify.
     $this->check_current_state(question_state::$complete);
     $this->check_current_mark(3 * (1 - $mc->penalty));
     $this->check_current_output($this->get_contains_mark_summary(3 * (1 - $mc->penalty)), $this->get_contains_mc_radio_expectation($rightindex, true, true), $this->get_contains_mc_radio_expectation(($rightindex + 1) % 3, true, false), $this->get_contains_mc_radio_expectation(($rightindex + 2) % 3, true, false), $this->get_contains_correct_expectation(), new PatternExpectation('/' . preg_quote(get_string('gradingdetailspenalty', 'qbehaviour_adaptive', format_float($mc->penalty, $this->displayoptions->markdp))) . '/'));
     $this->assertEqual('A', $this->quba->get_response_summary($this->slot));
     // Finish the attempt.
     $this->quba->finish_all_questions();
     // Verify.
     $this->check_current_state(question_state::$gradedright);
     $this->check_current_mark(3 * (1 - $mc->penalty));
     $this->check_current_output($this->get_contains_mark_summary(3 * (1 - $mc->penalty)), $this->get_contains_mc_radio_expectation($rightindex, false, true), $this->get_contains_mc_radio_expectation(($rightindex + 1) % 3, false, false), $this->get_contains_mc_radio_expectation(($rightindex + 2) % 3, false, false), $this->get_contains_correct_expectation());
     // Process a manual comment.
     $this->manual_grade('Not good enough!', 1);
     // Verify.
     $this->check_current_state(question_state::$mangrpartial);
     $this->check_current_mark(1);
     $this->check_current_output($this->get_contains_mark_summary(1), new PatternExpectation('/' . preg_quote('Not good enough!') . '/'));
     // Now change the correct answer to the question, and regrade.
     $mc->answers[13]->fraction = -0.33333333;
     $mc->answers[15]->fraction = 1;
     $this->quba->regrade_all_questions();
     // Verify.
     $this->check_current_state(question_state::$mangrpartial);
     $this->check_current_mark(1);
     $this->check_current_output($this->get_contains_mark_summary(1), $this->get_contains_partcorrect_expectation());
     $autogradedstep = $this->get_step($this->get_step_count() - 2);
     $this->assertWithinMargin($autogradedstep->get_fraction(), 0, 1.0E-7);
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:56,代码来源:testwalkthrough.php


示例4: get_value

 /**
  * Get the value for this input.
  *
  * @return string The value based on the grade_grade.
  */
 public function get_value()
 {
     $this->label = $this->grade->grade_item->itemname;
     $val = $this->grade->finalgrade;
     if ($this->grade->grade_item->scaleid) {
         return $val ? (int) $val : -1;
     } else {
         return $val ? format_float($val, $this->grade->grade_item->get_decimals()) : '';
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:15,代码来源:finalgrade.php


示例5: get_value

 /**
  * Get the value for this input.
  *
  * @return string The value based on the grade_grade.
  */
 public function get_value()
 {
     $this->label = $this->grade->grade_item->itemname;
     // Manual item raw grade support.
     $val = $this->grade->grade_item->is_manual_item() && !is_null($this->grade->rawgrade) ? $this->grade->rawgrade : $this->grade->finalgrade;
     if ($this->grade->grade_item->scaleid) {
         return $val ? (int) $val : -1;
     } else {
         return $val ? format_float($val, $this->grade->grade_item->get_decimals()) : '';
     }
 }
开发者ID:HuiChangZhai,项目名称:moodle,代码行数:16,代码来源:finalgrade.php


示例6: get_course_cost

function get_course_cost($plugininstance)
{
    $defaultplugin = enrol_get_plugin('authorize');
    $cost = (double) 0;
    $currency = !empty($plugininstance->currency) ? $plugininstance->currency : (empty($defaultplugin->currency) ? 'USD' : $defaultplugin->enrol_currency);
    if (!empty($plugininstance->cost)) {
        $cost = (double) ((double) $plugininstance->cost < 0) ? $defaultplugin->cost : $plugininstance->cost;
    }
    $cost = format_float($cost, 2);
    $ret = array('cost' => $cost, 'currency' => $currency);
    return $ret;
}
开发者ID:JP-Git,项目名称:moodle,代码行数:12,代码来源:localfuncs.php


示例7: get_course_cost

function get_course_cost($course)
{
    global $CFG;
    $cost = (double) 0;
    $currency = !empty($course->currency) ? $course->currency : (empty($CFG->enrol_currency) ? 'USD' : $CFG->enrol_currency);
    if (!empty($course->cost)) {
        $cost = (double) ((double) $course->cost < 0) ? $CFG->enrol_cost : $course->cost;
    }
    $cost = format_float($cost, 2);
    $ret = array('cost' => $cost, 'currency' => $currency);
    return $ret;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:12,代码来源:localfuncs.php


示例8: config_form_display

 /**
  * Add appropriate form elements to the critieria form
  *
  * @param moodle_form $mform Moodle forms object
  * @param stdClass $data containing default values to be set in the form
  */
 public function config_form_display(&$mform, $data = null)
 {
     $mform->addElement('checkbox', 'criteria_grade', get_string('enable'));
     $mform->addElement('text', 'criteria_grade_value', get_string('graderequired', 'completion'));
     $mform->disabledIf('criteria_grade_value', 'criteria_grade');
     $mform->setType('criteria_grade_value', PARAM_RAW);
     // Uses unformat_float.
     $mform->setDefault('criteria_grade_value', format_float($data));
     if ($this->id) {
         $mform->setDefault('criteria_grade', 1);
         $mform->setDefault('criteria_grade_value', format_float($this->gradepass));
     }
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:19,代码来源:completion_criteria_grade.php


示例9: results_as_columns

 public static function results_as_columns($results)
 {
     $header[] = get_string('choiceoptions', 'choice');
     $votes[] = get_string('numberofuser', 'choice');
     $percent[] = get_string('numberofuserinpercentage', 'choice');
     $graph[] = get_string('responsesresultgraphheader', 'choice');
     foreach ($results as $result) {
         $header[] = $result['text'];
         $votes[] = $result['votes'];
         $percent[] = format_float($result['percent'], 1) . '%';
         $graph[] = progress::level($result['percent']);
     }
     return array('header' => $header, 'rows' => array($votes, $percent, $graph));
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:14,代码来源:mod_choice_renderer.php


示例10: test_quiz_rescale_grade

 public function test_quiz_rescale_grade()
 {
     $quiz = new stdClass();
     $quiz->decimalpoints = 2;
     $quiz->questiondecimalpoints = 3;
     $quiz->grade = 10;
     $quiz->sumgrades = 10;
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, false), 0.12345678);
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, true), format_float(0.12, 2));
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, 'question'), format_float(0.123, 3));
     $quiz->sumgrades = 5;
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, false), 0.24691356);
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, true), format_float(0.25, 2));
     $this->assertEquals(quiz_rescale_grade(0.12345678, $quiz, 'question'), format_float(0.247, 3));
 }
开发者ID:janeklb,项目名称:moodle,代码行数:15,代码来源:locallib_test.php


示例11: get_value

 /**
  * Get the value for this input.
  *
  * @return string The value based on the grade_grade.
  */
 public function get_value()
 {
     $this->label = $this->grade->grade_item->itemname;
     $isoverridden = $this->grade->is_overridden();
     if (!empty($isoverridden)) {
         $val = $this->grade->finalgrade;
     } else {
         $val = $this->grade->rawgrade;
     }
     if ($this->grade->grade_item->scaleid) {
         return $val ? (int) $val : -1;
     } else {
         return $val ? format_float($val, $this->grade->grade_item->get_decimals()) : '';
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:20,代码来源:finalgrade.php


示例12: definition

 function definition()
 {
     $mform = $this->_form;
     list($instance, $plugin, $context) = $this->_customdata;
     $mform->addElement('header', 'header', get_string('pluginname', 'enrol_ipay'));
     $mform->addElement('text', 'name', get_string('custominstancename', 'enrol'));
     $mform->setType('name', PARAM_TEXT);
     $options = array(ENROL_INSTANCE_ENABLED => get_string('yes'), ENROL_INSTANCE_DISABLED => get_string('no'));
     $mform->addElement('select', 'status', get_string('status', 'enrol_ipay'), $options);
     $mform->setDefault('status', $plugin->get_config('status'));
     $mform->addElement('text', 'businessname', get_string('businessname', 'enrol_ipay'));
     $mform->setType('businessname', PARAM_TEXT);
     // test if i can see business name
     $mform->setDefault('businessname', $plugin->get_config('businessname'));
     //this faetches from the configured setings the business name
     $mform->addElement('text', 'cost', get_string('cost', 'enrol_ipay'), array('size' => 4));
     $mform->setType('cost', PARAM_RAW);
     // Use unformat_float to get real value.
     $mform->setDefault('cost', format_float($plugin->get_config('cost'), 2, true));
     $ipaycurrencies = $plugin->get_currencies();
     $mform->addElement('select', 'currency', get_string('currency', 'enrol_ipay'), $ipaycurrencies);
     $mform->setDefault('currency', $plugin->get_config('currency'));
     if ($instance->id) {
         $roles = get_default_enrol_roles($context, $instance->roleid);
     } else {
         $roles = get_default_enrol_roles($context, $plugin->get_config('roleid'));
     }
     $mform->addElement('select', 'roleid', get_string('assignrole', 'enrol_ipay'), $roles);
     $mform->setDefault('roleid', $plugin->get_config('roleid'));
     $mform->addElement('duration', 'enrolperiod', get_string('enrolperiod', 'enrol_ipay'), array('optional' => true, 'defaultunit' => 86400));
     $mform->setDefault('enrolperiod', $plugin->get_config('enrolperiod'));
     $mform->addHelpButton('enrolperiod', 'enrolperiod', 'enrol_ipay');
     $mform->addElement('date_time_selector', 'enrolstartdate', get_string('enrolstartdate', 'enrol_ipay'), array('optional' => true));
     $mform->setDefault('enrolstartdate', 0);
     $mform->addHelpButton('enrolstartdate', 'enrolstartdate', 'enrol_ipay');
     $mform->addElement('date_time_selector', 'enrolenddate', get_string('enrolenddate', 'enrol_ipay'), array('optional' => true));
     $mform->setDefault('enrolenddate', 0);
     $mform->addHelpButton('enrolenddate', 'enrolenddate', 'enrol_ipay');
     $mform->addElement('hidden', 'id');
     $mform->setType('id', PARAM_INT);
     $mform->addElement('hidden', 'courseid');
     $mform->setType('courseid', PARAM_INT);
     if (enrol_accessing_via_instance($instance)) {
         $mform->addElement('static', 'selfwarn', get_string('instanceeditselfwarning', 'core_enrol'), get_string('instanceeditselfwarningtext', 'core_enrol'));
     }
     $this->add_action_buttons(true, $instance->id ? null : get_string('addinstance', 'enrol'));
     $this->set_data($instance);
 }
开发者ID:kiarie,项目名称:ipay,代码行数:48,代码来源:edit_form.php


示例13: get_value

 /**
  * Get the value for this input.
  *
  * @return string The value based on the grade_grade.
  */
 public function get_value()
 {
     $this->label = $this->grade->grade_item->itemname;
     $isoverridden = $this->grade->is_overridden();
     // If the grade is overridden or the grade type is not an activity then use finalgrade.
     if (!empty($isoverridden) || $this->grade->grade_item->itemtype != 'mod') {
         $val = $this->grade->finalgrade;
     } else {
         $val = $this->grade->rawgrade;
     }
     if ($this->grade->grade_item->scaleid) {
         return $val ? (int) $val : -1;
     } else {
         return $val ? format_float($val, $this->grade->grade_item->get_decimals()) : '';
     }
 }
开发者ID:Keneth1212,项目名称:moodle,代码行数:21,代码来源:finalgrade.php


示例14: test_quiz_format_question_grade

 public function test_quiz_format_question_grade()
 {
     $quiz = new stdClass();
     $quiz->decimalpoints = 2;
     $quiz->questiondecimalpoints = 2;
     $this->assertEquals(quiz_format_question_grade($quiz, 0.12345678), format_float(0.12, 2));
     $this->assertEquals(quiz_format_question_grade($quiz, 0), format_float(0, 2));
     $this->assertEquals(quiz_format_question_grade($quiz, 1.0), format_float(1, 2));
     $quiz->decimalpoints = 3;
     $quiz->questiondecimalpoints = -1;
     $this->assertEquals(quiz_format_question_grade($quiz, 0.12345678), format_float(0.123, 3));
     $this->assertEquals(quiz_format_question_grade($quiz, 0), format_float(0, 3));
     $this->assertEquals(quiz_format_question_grade($quiz, 1.0), format_float(1, 3));
     $quiz->questiondecimalpoints = 4;
     $this->assertEquals(quiz_format_question_grade($quiz, 0.12345678), format_float(0.1235, 4));
     $this->assertEquals(quiz_format_question_grade($quiz, 0), format_float(0, 4));
     $this->assertEquals(quiz_format_question_grade($quiz, 1.0), format_float(1, 4));
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:18,代码来源:lib_test.php


示例15: 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


示例16: get_other_values

 protected function get_other_values(renderer_base $output)
 {
     $proficientcompetencypercentage = 0;
     $proficientcompetencypercentageformatted = '';
     if ($this->data->competencycount > 0) {
         $proficientcompetencypercentage = (double) $this->data->proficientcompetencycount / (double) $this->data->competencycount * 100.0;
         $proficientcompetencypercentageformatted = format_float($proficientcompetencypercentage);
     }
     $competencies = array();
     $contextcache = array();
     foreach ($this->data->leastproficientcompetencies as $competency) {
         if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
             $contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
         }
         $context = $contextcache[$competency->get_competencyframeworkid()];
         $exporter = new competency_exporter($competency, array('context' => $context));
         $competencies[] = $exporter->export($output);
     }
     return array('proficientcompetencypercentage' => $proficientcompetencypercentage, 'proficientcompetencypercentageformatted' => $proficientcompetencypercentageformatted, 'leastproficient' => $competencies, 'leastproficientcount' => count($competencies), 'canbegradedincourse' => has_capability('moodle/competency:coursecompetencygradable', $this->related['context']), 'canmanagecoursecompetencies' => has_capability('moodle/competency:coursecompetencymanage', $this->related['context']));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:20,代码来源:course_competency_statistics_exporter.php


示例17: definition

 /**
  * Defines forms elements
  */
 public function definition()
 {
     $mform = $this->_form;
     $mform->addElement('header', 'general', get_string('general', 'form'));
     $mform->addElement('text', 'name', get_string('paypalname', 'paypal'), array('size' => '64'));
     if (!empty($CFG->formatstringstriptags)) {
         $mform->setType('name', PARAM_TEXT);
     } else {
         $mform->setType('name', PARAM_CLEAN);
     }
     $mform->addRule('name', null, 'required', null, 'client');
     $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
     $mform->addHelpButton('name', 'paypalname', 'paypal');
     $this->standard_intro_elements();
     $mform->addElement('text', 'businessemail', get_string('businessemail', 'paypal'));
     $mform->setType('businessemail', PARAM_EMAIL);
     $mform->setDefault('businessemail', '');
     $mform->addElement('text', 'cost', get_string('cost', 'paypal'), array('size' => 4));
     $mform->setType('cost', PARAM_FLOAT);
     $mform->setDefault('cost', format_float(0, 2, true));
     $paypalcurrencies = $this->get_currencies();
     $mform->addElement('select', 'currency', get_string('currency', 'paypal'), $paypalcurrencies);
     $mform->setDefault('currency', 'BRL');
     $mform->addElement('text', 'itemname', get_string('itemname', 'paypal'));
     $mform->setType('itemname', PARAM_TEXT);
     $mform->setDefault('itemname', '');
     $mform->addElement('text', 'itemnumber', get_string('itemnumber', 'paypal'));
     $mform->setType('itemnumber', PARAM_TEXT);
     $mform->setDefault('itemnumber', '');
     $mform->addElement('checkbox', 'mailadmins', get_string('mailadmins', 'paypal'));
     $mform->addHelpButton('mailadmins', 'mailadmins', 'paypal');
     $mform->addElement('checkbox', 'mailstudents', get_string('mailstudents', 'paypal'));
     $mform->addHelpButton('mailstudents', 'mailstudents', 'paypal');
     $mform->addElement('checkbox', 'mailteachers', get_string('mailteachers', 'paypal'));
     $mform->addHelpButton('mailteachers', 'mailteachers', 'paypal');
     $this->standard_grading_coursemodule_elements();
     $this->standard_coursemodule_elements();
     $this->add_action_buttons();
 }
开发者ID:danielneis,项目名称:moodle-mod_paypal,代码行数:42,代码来源:mod_form.php


示例18: display_browse_field

 function display_browse_field($recordid, $template)
 {
     if ($content = get_record('data_content', 'fieldid', $this->field->id, 'recordid', $recordid)) {
         if (strlen($content->content) < 1) {
             return false;
         }
         $number = $content->content;
         $decimals = trim($this->field->param1);
         // only apply number formatting if param1 contains an integer number >= 0:
         if (preg_match("/^\\d+\$/", $decimals)) {
             $decimals = $decimals * 1;
             // removes leading zeros (eg. '007' -> '7'; '00' -> '0')
             $str = format_float($number, $decimals, true);
             // For debugging only:
             #                $str .= " ($decimals)";
         } else {
             $str = $number;
         }
         return $str;
     }
     return false;
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:22,代码来源:field.class.php


示例19: feedback

    public function feedback(question_attempt $qa, question_display_options $options) {
        // Try to find the last graded step.

        $gradedstep = $this->get_graded_step($qa);
        if (is_null($gradedstep) || $qa->get_max_mark() == 0 ||
                $options->marks < question_display_options::MARK_AND_MAX) {
            return '';
        }

        // Display the grading details from the last graded state
        $mark = new stdClass();
        $mark->max = $qa->format_max_mark($options->markdp);

        $actualmark = $gradedstep->get_fraction() * $qa->get_max_mark();
        $mark->cur = format_float($actualmark, $options->markdp);

        $rawmark = $gradedstep->get_behaviour_var('_rawfraction') * $qa->get_max_mark();
        $mark->raw = format_float($rawmark, $options->markdp);

        // let student know wether the answer was correct
        if ($qa->get_state()->is_commented()) {
            $class = $qa->get_state()->get_feedback_class();
        } else {
            $class = question_state::graded_state_for_fraction(
                    $gradedstep->get_behaviour_var('_rawfraction'))->get_feedback_class();
        }

        $gradingdetails = get_string('gradingdetails', 'qbehaviour_adaptive', $mark);

        $gradingdetails .= $this->penalty_info($qa, $mark);

        $output = '';
        $output .= html_writer::tag('div', get_string($class, 'question'),
                array('class' => 'correctness ' . $class));
        $output .= html_writer::tag('div', $gradingdetails,
                array('class' => 'gradingdetails'));
        return $output;
    }
开发者ID:nottmoo,项目名称:moodle,代码行数:38,代码来源:renderer.php


示例20: offlinequiz_get_question_infostring

function offlinequiz_get_question_infostring($offlinequiz, $question)
{
    if ($offlinequiz->showgrades || $offlinequiz->showquestioninfo) {
        $infostr = '(';
        $questioninfo = offlinequiz_get_questioninfo($offlinequiz, $question);
        if ($questioninfo) {
            $infostr .= $questioninfo;
            if ($offlinequiz->showgrades) {
                $infostr .= ', ';
            }
        }
        if ($offlinequiz->showgrades) {
            $pointstr = get_string('points', 'grades');
            if ($question->maxmark == 1) {
                $pointstr = get_string('point', 'offlinequiz');
            }
            $infostr = $infostr . format_float($question->maxmark, $offlinequiz->decimalpoints) . ' ' . $pointstr;
        }
        $infostr = $infostr . ')';
        return $infostr;
    }
    return null;
}
开发者ID:pauloangelo,项目名称:moodle-mod_offlinequiz,代码行数:23,代码来源:documentlib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP format_html函数代码示例发布时间:2022-05-15
下一篇:
PHP format_filesize函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap