From: pichetp
Date: Fri, 25 Sep 2009 00:48:34 +0000 (+0000)
Subject: MDL-10110 Adding multichoice option in calculated question minor bugs fixed
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1b41f2b0fbc7b0f5770a010e39f779ea1629cb0d;p=moodle.git
MDL-10110 Adding multichoice option in calculated question minor bugs fixed
---
diff --git a/question/type/calculated/edit_calculated_form.php b/question/type/calculated/edit_calculated_form.php
index db9956109a..38378a08ed 100644
--- a/question/type/calculated/edit_calculated_form.php
+++ b/question/type/calculated/edit_calculated_form.php
@@ -59,7 +59,7 @@ class question_edit_calculated_form extends question_edit_form {
$addrepeated = array();
if ($this->editasmultichoice == 1){
$addrepeated[] =& $mform->createElement('hidden', 'tolerance');
- $addrepeated[] =& $mform->createElement('hidden', 'tolerancetype');
+ $addrepeated[] =& $mform->createElement('hidden', 'tolerancetype',1);
}else {
$addrepeated[] =& $mform->createElement('text', 'tolerance', get_string('tolerance', 'qtype_calculated'));
$addrepeated[] =& $mform->createElement('select', 'tolerancetype', get_string('tolerancetype', 'quiz'), $this->qtypeobj->tolerance_types());
@@ -92,7 +92,7 @@ class question_edit_calculated_form extends question_edit_form {
global $QTYPES;
$this->qtypeobj =& $QTYPES[$this->qtype()];
// echo code left for testing period
- // echo "question ".optional_param('multichoice', '', PARAM_RAW)." optional
";print_r($this->question);echo "
";
+ echo "question ".optional_param('multichoice', '', PARAM_RAW)." optional
";print_r($this->question);echo "
";
$label = get_string("sharedwildcards", "qtype_datasetdependent");
$mform->addElement('hidden', 'initialcategory', 1);
$html2 = $this->qtypeobj->print_dataset_definitions_category($this->question);
@@ -104,6 +104,11 @@ class question_edit_calculated_form extends question_edit_form {
if ( isset($this->question->options->multichoice) && $this->question->options->multichoice == '1'){
$this->editasmultichoice = 1 ;
}else {
+ if ( !isset($this->question->id ) && 1 == optional_param('multichoice', '', PARAM_RAW )){
+ $this->editasmultichoice = 1 ;
+ }else {
+ $this->editasmultichoice = 0 ;
+ }
if ( !isset($this->question->id ) && '' != optional_param('createoptionbutton', '', PARAM_RAW) && 1 == optional_param('multichoice', '', PARAM_RAW)){
$this->editasmultichoice = 1 ;
}