Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
Showing with 9 additions and 1 deletion.
  1. +8 −0 lib/questionlib.php
  2. +1 −1  question/type/edit_question_form.php
8 lib/questionlib.php
View
@@ -785,14 +785,22 @@ function question_load_questions($questionids, $extrafields = '', $join = '') {
*/
function _tidy_question($question, $loadtags = false) {
global $CFG;
+
+ // Load question-type specific fields.
if (!question_bank::is_qtype_installed($question->qtype)) {
$question->questiontext = html_writer::tag('p', get_string('warningmissingtype',
'qtype_missingtype')) . $question->questiontext;
}
question_bank::get_qtype($question->qtype)->get_question_options($question);
+
+ // Convert numeric fields to float. (Prevents these being displayed as 1.0000000.)
+ $question->defaultmark += 0;
+ $question->penalty += 0;
+
if (isset($question->_partiallyloaded)) {
unset($question->_partiallyloaded);
}
+
if ($loadtags && !empty($CFG->usetags)) {
require_once($CFG->dirroot . '/tag/lib.php');
$question->tags = tag_get_tags_array('question', $question->id);
2  question/type/edit_question_form.php
View
@@ -187,7 +187,7 @@ protected function definition() {
$mform->setType('questiontext', PARAM_RAW);
$mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),
- array('size' => 3));
+ array('size' => 7));
$mform->setType('defaultmark', PARAM_FLOAT);
$mform->setDefault('defaultmark', 1);
$mform->addRule('defaultmark', null, 'required', null, 'client');
Please sign in to comment.
Something went wrong with that request. Please try again.