Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-34993_22' of git://github.com/timhunt/moodle into M…

…OODLE_22_STABLE
  • Loading branch information...
commit 006052e19c127f24379ce2032ce94541b3cd0caa 2 parents 31970a6 + cf6b831
Eloy Lafuente (stronk7) stronk7 authored
8 lib/questionlib.php
@@ -785,14 +785,22 @@ function question_load_questions($questionids, $extrafields = '', $join = '') {
785 785 */
786 786 function _tidy_question($question, $loadtags = false) {
787 787 global $CFG;
  788 +
  789 + // Load question-type specific fields.
788 790 if (!question_bank::is_qtype_installed($question->qtype)) {
789 791 $question->questiontext = html_writer::tag('p', get_string('warningmissingtype',
790 792 'qtype_missingtype')) . $question->questiontext;
791 793 }
792 794 question_bank::get_qtype($question->qtype)->get_question_options($question);
  795 +
  796 + // Convert numeric fields to float. (Prevents these being displayed as 1.0000000.)
  797 + $question->defaultmark += 0;
  798 + $question->penalty += 0;
  799 +
793 800 if (isset($question->_partiallyloaded)) {
794 801 unset($question->_partiallyloaded);
795 802 }
  803 +
796 804 if ($loadtags && !empty($CFG->usetags)) {
797 805 require_once($CFG->dirroot . '/tag/lib.php');
798 806 $question->tags = tag_get_tags_array('question', $question->id);
2  question/type/edit_question_form.php
@@ -187,7 +187,7 @@ protected function definition() {
187 187 $mform->setType('questiontext', PARAM_RAW);
188 188
189 189 $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),
190   - array('size' => 3));
  190 + array('size' => 7));
191 191 $mform->setType('defaultmark', PARAM_FLOAT);
192 192 $mform->setDefault('defaultmark', 1);
193 193 $mform->addRule('defaultmark', null, 'required', null, 'client');

0 comments on commit 006052e

Please sign in to comment.
Something went wrong with that request. Please try again.