Merge branch 'w49_MDL-30517_m22_blockdelete' of git://github.com/skodak/moodle
authorAparup Banerjee <aparup@moodle.com>
Wed, 30 Nov 2011 09:39:23 +0000 (17:39 +0800)
committerAparup Banerjee <aparup@moodle.com>
Wed, 30 Nov 2011 09:39:23 +0000 (17:39 +0800)
14 files changed:
blocks/community/renderer.php
enrol/self/edit_form.php
enrol/self/lang/en/enrol_self.php
mod/forum/index.php
mod/forum/lib.php
mod/scorm/report/interactions/report.php
question/format/xml/format.php
question/type/calculated/datasetitems_form.php
question/type/calculated/edit_calculated_form.php
question/type/calculated/questiontype.php
question/type/calculatedmulti/edit_calculatedmulti_form.php
question/type/calculatedsimple/edit_calculatedsimple_form.php
question/type/multianswer/edit_multianswer_form.php
theme/base/style/core.css

index 5eb9d85..1df8f82 100644 (file)
@@ -193,6 +193,8 @@ class block_community_renderer extends plugin_renderer_base {
 
 
                 //Create course content html
+                $blocks = get_plugin_list('block');
+                $activities = get_plugin_list('mod');
                 if (!empty($course->contents)) {
                     $activitieshtml = '';
                     $blockhtml = '';
@@ -202,14 +204,22 @@ class block_community_renderer extends plugin_renderer_base {
                             if (!empty($blockhtml)) {
                                 $blockhtml .= ' - ';
                             }
-                            $blockhtml .= get_string('pluginname', 'block_' . $content->modulename)
-                                    . " (" . $content->contentcount . ")";
+                            if (array_key_exists($content->modulename, $blocks)) {
+                                $blockname = get_string('pluginname', 'block_' . $content->modulename);
+                            } else {
+                                $blockname = $content->modulename;
+                            }
+                            $blockhtml .= $blockname . " (" . $content->contentcount . ")";
                         } else {
                             if (!empty($activitieshtml)) {
                                 $activitieshtml .= ' - ';
                             }
-                            $activitieshtml .= get_string('modulename', $content->modulename)
-                                    . " (" . $content->contentcount . ")";
+                            if (array_key_exists($content->modulename, $activities)) {
+                                $activityname = get_string('modulename', $content->modulename);
+                            } else {
+                                $activityname = $content->modulename;
+                            }
+                            $activitieshtml .= $activityname . " (" . $content->contentcount . ")";
                         }
                     }
 
index 338ccb6..5919d69 100644 (file)
@@ -59,9 +59,9 @@ class enrol_self_edit_form extends moodleform {
         $mform->setDefault('customint1', $plugin->get_config('groupkey'));
 
         if ($instance->id) {
-            $roles = get_default_enrol_roles($context, $instance->roleid);
+            $roles = $this->extend_assignable_roles($context, $instance->roleid);
         } else {
-            $roles = get_default_enrol_roles($context, $plugin->get_config('roleid'));
+            $roles = $this->extend_assignable_roles($context, $plugin->get_config('roleid'));
         }
         $mform->addElement('select', 'roleid', get_string('role', 'enrol_self'), $roles);
         $mform->setDefault('roleid', $plugin->get_config('roleid'));
@@ -156,4 +156,24 @@ class enrol_self_edit_form extends moodleform {
 
         return $errors;
     }
+
+    /**
+    * Gets a list of roles that this user can assign for the course as the default for self-enrolment
+    *
+    * @param context $context the context.
+    * @param integer $defaultrole the id of the role that is set as the default for self-enrolement
+    * @return array index is the role id, value is the role name
+    */
+    function extend_assignable_roles($context, $defaultrole) {
+        global $DB;
+        $roles = get_assignable_roles($context);
+        $sql = "SELECT r.id, r.name
+                  FROM {role} r
+                 WHERE r.id = $defaultrole";
+        $results = $DB->get_record_sql($sql);
+        if (isset($results->name)) {
+            $roles[$results->id] = $results->name;
+        }
+        return $roles;
+    }
 }
\ No newline at end of file
index a1edd91..af2c54c 100644 (file)
@@ -61,7 +61,7 @@ $string['pluginname'] = 'Self enrolment';
 $string['pluginname_desc'] = 'The self enrolment plugin allows users to choose which courses they want to participate in. The courses may be protected by an enrolment key. Internally the enrolment is done via the manual enrolment plugin which has to be enabled in the same course.';
 $string['requirepassword'] = 'Require enrolment key';
 $string['requirepassword_desc'] = 'Require enrolment key in new courses and prevent removing of enrolment key from existing courses.';
-$string['role'] = 'Assign role';
+$string['role'] = 'Default assigned role';
 $string['self:config'] = 'Configure self enrol instances';
 $string['self:manage'] = 'Manage enrolled users';
 $string['self:unenrol'] = 'Unenrol users from course';
index 18f054b..0ec460b 100644 (file)
@@ -68,7 +68,6 @@ $strunsubscribe  = get_string('unsubscribe', 'forum');
 $stryes          = get_string('yes');
 $strno           = get_string('no');
 $strrss          = get_string('rss');
-$strsectionname  = get_string('sectionname', 'format_'.$course->format);
 
 $searchform = forum_search_form($course);
 
@@ -260,8 +259,14 @@ if ($generalforums) {
                 } else {
                     $tooltiptext = get_string('rsssubscriberssposts', 'forum');
                 }
+
+                if (!isloggedin() && $course->id == SITEID) {
+                    $userid = guest_user()->id;
+                } else {
+                    $userid = $USER->id;
+                }
                 //Get html code for RSS link
-                $row[] = rss_get_link($context->id, $USER->id, 'mod_forum', $forum->id, $tooltiptext);
+                $row[] = rss_get_link($context->id, $userid, 'mod_forum', $forum->id, $tooltiptext);
             } else {
                 $row[] = '&nbsp;';
             }
@@ -300,6 +305,8 @@ if ($show_rss = (($can_subscribe || $course->id == SITEID) &&
 /// Now let's process the learning forums
 
 if ($course->id != SITEID) {    // Only real courses have learning forums
+    // 'format_.'$course->format only applicable when not SITEID (format_site is not a format)
+    $strsectionname  = get_string('sectionname', 'format_'.$course->format);
     // Add extra field for section number, at the front
     array_unshift($learningtable->head, $strsectionname);
     array_unshift($learningtable->align, 'center');
@@ -410,7 +417,7 @@ $PAGE->set_heading($course->fullname);
 $PAGE->set_button($searchform);
 echo $OUTPUT->header();
 
-if (!isguestuser()) {
+if (!isguestuser() && isloggedin()) {
     echo $OUTPUT->box_start('subscription');
     echo html_writer::tag('div',
         html_writer::link(new moodle_url('/mod/forum/index.php', array('id'=>$course->id, 'subscribe'=>1, 'sesskey'=>sesskey())),
index 71339e4..798bc22 100644 (file)
@@ -7500,7 +7500,16 @@ function forum_extend_settings_navigation(settings_navigation $settingsnav, navi
         }
     }
 
-    if ($enrolled && !empty($CFG->enablerssfeeds) && !empty($CFG->forum_enablerssfeeds) && $forumobject->rsstype && $forumobject->rssarticles) {
+    if (!isloggedin() && $PAGE->course->id == SITEID) {
+        $userid = guest_user()->id;
+    } else {
+        $userid = $USER->id;
+    }
+
+    $hascourseaccess = ($PAGE->course->id == SITEID) || can_access_course($PAGE->course, $userid);
+    $enablerssfeeds = !empty($CFG->enablerssfeeds) && !empty($CFG->forum_enablerssfeeds);
+
+    if ($enablerssfeeds && $forumobject->rsstype && $forumobject->rssarticles && $hascourseaccess) {
 
         if (!function_exists('rss_get_url')) {
             require_once("$CFG->libdir/rsslib.php");
@@ -7511,11 +7520,7 @@ function forum_extend_settings_navigation(settings_navigation $settingsnav, navi
         } else {
             $string = get_string('rsssubscriberssposts','forum');
         }
-        if (!isloggedin()) {
-            $userid = 0;
-        } else {
-            $userid = $USER->id;
-        }
+
         $url = new moodle_url(rss_get_url($PAGE->cm->context->id, $userid, "mod_forum", $forumobject->id));
         $forumnode->add($string, $url, settings_navigation::TYPE_SETTING, null, null, new pix_icon('i/rss', ''));
     }
index 322ede9..96e1ff2 100644 (file)
@@ -153,7 +153,7 @@ class scorm_interactions_report extends scorm_default_report {
             }
 
             $params = array();
-            list($usql, $params) = $DB->get_in_or_equal($allowedlist);
+            list($usql, $params) = $DB->get_in_or_equal($allowedlist, SQL_PARAMS_NAMED);
                                     // Construct the SQL
             $select = 'SELECT DISTINCT '.$DB->sql_concat('u.id', '\'#\'', 'COALESCE(st.attempt, 0)').' AS uniqueid, ';
             $select .= 'st.scormid AS scormid, st.attempt AS attempt, ' .
index 081444d..2633deb 100644 (file)
@@ -184,9 +184,10 @@ class qformat_xml extends qformat_default {
             $data = new stdClass();
             $data->content = $filedata;
             $data->encoding = 'base64';
-            $data->name = $filename;
+            // Question file areas don't support subdirs, so convert path to filename if necessary.
+            $data->name = clean_param(str_replace('/', '_', $filename), PARAM_FILE);
             $qo->questiontextfiles[] = $data;
-            $qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $filename . '" />';
+            $qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $data->name . '" />';
         }
 
         // restore files in generalfeedback
index fc3564a..3d07083 100644 (file)
@@ -267,10 +267,7 @@ class question_dataset_dependent_items_form extends moodleform {
         $mform->closeHeaderBefore('addgrp1');
         //----------------------------------------------------------------------
         $j = $this->noofitems * count($this->datasetdefs);
-        $k = 1;
-        if ("" != optional_param('selectshow', '', PARAM_INT)) {
-            $k = optional_param('selectshow', '', PARAM_INT);
-        }
+        $k = optional_param('selectshow', 1, PARAM_INT);
         for ($i = $this->noofitems; $i >= 1; $i--) {
             if ($k > 0) {
                 $mform->addElement('header', '', "<b>" .
@@ -361,8 +358,8 @@ class question_dataset_dependent_items_form extends moodleform {
         if (isset($question->options)) {
             $answers = $question->options->answers;
             if (count($answers)) {
-                if (optional_param('updateanswers', '', PARAM_RAW) != '' ||
-                        optional_param('updatedatasets', '', PARAM_RAW) != '') {
+                if (optional_param('updateanswers', false, PARAM_BOOL) ||
+                        optional_param('updatedatasets', false, PARAM_BOOL)) {
                     foreach ($answers as $key => $answer) {
                         $fromform->tolerance[$key]= $this->_form->getElementValue(
                                 'tolerance['.$key.']');
@@ -434,8 +431,8 @@ class question_dataset_dependent_items_form extends moodleform {
         if ($this->qtypeobj->supports_dataset_item_generation()) {
             $itemnumber = $this->noofitems+1;
             foreach ($this->datasetdefs as $defid => $datasetdef) {
-                if (optional_param('updatedatasets', '', PARAM_RAW) == '' &&
-                        optional_param('updateanswers', '', PARAM_RAW)== '') {
+                if (!optional_param('updatedatasets', false, PARAM_BOOL) &&
+                        !optional_param('updateanswers', false, PARAM_BOOL)) {
                     $formdata["number[$j]"] = $this->qtypeobj->generate_dataset_item(
                             $datasetdef->options);
                 } else {
@@ -450,11 +447,11 @@ class question_dataset_dependent_items_form extends moodleform {
         }
 
         //existing records override generated data depending on radio element
-        $j = $this->noofitems * count($this->datasetdefs)+1;
-        if (!$this->regenerate && (optional_param('updatedatasets', '', PARAM_RAW) == '' &&
-                optional_param('updateanswers', '', PARAM_RAW)== '')) {
+        $j = $this->noofitems * count($this->datasetdefs) + 1;
+        if (!$this->regenerate && !optional_param('updatedatasets', false, PARAM_BOOL) &&
+                !optional_param('updateanswers', false, PARAM_BOOL)) {
             $idx = 1;
-            $itemnumber = $this->noofitems+1;
+            $itemnumber = $this->noofitems + 1;
             foreach ($this->datasetdefs as $defid => $datasetdef) {
                 if (isset($datasetdef->items[$itemnumber])) {
                     $formdata["number[$j]"] = $datasetdef->items[$itemnumber]->value;
@@ -468,7 +465,7 @@ class question_dataset_dependent_items_form extends moodleform {
 
         $comment = $this->qtypeobj->comment_on_datasetitems($this->qtypeobj, $question->id,
                 $question->questiontext, $answers, $data, ($this->noofitems + 1));
-        if (isset($comment->outsidelimit)&&$comment->outsidelimit) {
+        if (isset($comment->outsidelimit) && $comment->outsidelimit) {
             $this->outsidelimit=$comment->outsidelimit;
         }
         $key1 = 1;
index 9fb391c..76dc6cd 100644 (file)
@@ -52,11 +52,7 @@ class qtype_calculated_edit_form extends qtype_numerical_edit_form {
             $formeditable = true) {
         global $CFG, $DB;
         $this->question = $question;
-        if ('1' == optional_param('reload', '', PARAM_INT)) {
-            $this->reload = true;
-        } else {
-            $this->reload = false;
-        }
+        $this->reload = optional_param('reload', false, PARAM_BOOL);
 
         if (!$this->reload) { // use database data as this is first pass
             if (isset($this->question->id)) {
index 4b6a132..16a8785 100644 (file)
@@ -436,7 +436,7 @@ class qtype_calculated extends question_type {
                 break;
             case 'datasetitems':
                 require("$CFG->dirroot/question/type/calculated/datasetitems_form.php");
-                $regenerate = optional_param('forceregeneration', 0, PARAM_BOOL);
+                $regenerate = optional_param('forceregeneration', false, PARAM_BOOL);
                 $mform = new question_dataset_dependent_items_form(
                         "$submiturl?wizardnow=datasetitems", $question, $regenerate);
                 break;
index eec57e3..ff2b986 100644 (file)
@@ -48,11 +48,7 @@ class qtype_calculatedmulti_edit_form extends question_edit_form {
             $contexts, $formeditable = true) {
         $this->question = $question;
         $this->qtypeobj = question_bank::get_qtype('calculatedmulti');
-        if (1 == optional_param('reload', '', PARAM_INT)) {
-            $this->reload = true;
-        } else {
-            $this->reload = false;
-        }
+        $this->reload = optional_param('reload', false, PARAM_BOOL);
         if (!$this->reload) {
             // use database data as this is first pass
             if (isset($this->question->id)) {
@@ -158,11 +154,11 @@ class qtype_calculatedmulti_edit_form extends question_edit_form {
         $mform->setConstants(array('nounits'=>$nounits));
         for ($i = 0; $i < $nounits; $i++) {
             $mform->addElement('hidden', 'unit'."[$i]",
-                    optional_param('unit'."[$i]", '', PARAM_NOTAGS));
+                    optional_param("unit[$i]", '', PARAM_NOTAGS));
             $mform->setType('unit'."[$i]", PARAM_NOTAGS);
             $mform->addElement('hidden', 'multiplier'."[$i]",
-                    optional_param('multiplier'."[$i]", '', PARAM_NUMBER));
-            $mform->setType('multiplier'."[$i]", PARAM_NUMBER);
+                    optional_param("multiplier[$i]", '', PARAM_NUMBER));
+            $mform->setType("multiplier[$i]", PARAM_NUMBER);
         }
 
         $this->add_combined_feedback_fields(true);
index 5ba6cd1..d9dae12 100644 (file)
@@ -80,11 +80,7 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
         // which is not what we want so this should be removed from here
         // get priority to paramdatasets
 
-        if ("1" == optional_param('reload', '', PARAM_INT)) {
-            $this->reload = true;
-        } else {
-            $this->reload = false;
-        }
+        $this->reload = optional_param('reload', false, PARAM_BOOL);
         if (!$this->reload) { // use database data as this is first pass
             // question->id == 0 so no stored datasets
             if (!empty($question->id)) {
@@ -145,16 +141,16 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
             // should not test on adding a new answer
             // should test if there are already olddatasets or if the 'analyzequestion'
             // submit button has been clicked
-            if ('' != optional_param('datasetdef', '', PARAM_RAW) ||
-                    '' != optional_param('analyzequestion', '', PARAM_RAW)) {
+            if (optional_param_array('datasetdef', false, PARAM_BOOL) ||
+                    optional_param('analyzequestion', false, PARAM_BOOL)) {
 
-                if ($dummyform->answer = optional_param('answer', '', PARAM_NOTAGS)) {
+                if ($dummyform->answer = optional_param_array('answer', '', PARAM_NOTAGS)) {
                     // there is always at least one answer...
-                    $fraction = optional_param('fraction', '', PARAM_NUMBER);
-                    $tolerance = optional_param('tolerance', '', PARAM_NUMBER);
-                    $tolerancetype = optional_param('tolerancetype', '', PARAM_NUMBER);
-                    $correctanswerlength = optional_param('correctanswerlength', '', PARAM_INT);
-                    $correctanswerformat = optional_param('correctanswerformat', '', PARAM_INT);
+                    $fraction = optional_param_array('fraction', '', PARAM_NUMBER);
+                    $tolerance = optional_param_array('tolerance', '', PARAM_NUMBER);
+                    $tolerancetype = optional_param_array('tolerancetype', '', PARAM_NUMBER);
+                    $correctanswerlength = optional_param_array('correctanswerlength', '', PARAM_INT);
+                    $correctanswerformat = optional_param_array('correctanswerformat', '', PARAM_INT);
 
                     foreach ($dummyform->answer as $key => $answer) {
                         if (trim($answer) != '') {  // just look for non-empty
@@ -172,11 +168,11 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
                 }
                 $this->datasetdefs = array();
                 // rebuild datasetdefs from old values
-                if ($olddef = optional_param('datasetdef', '', PARAM_RAW)) {
-                    $calcmin = optional_param('calcmin', '', PARAM_NUMBER);
-                    $calclength = optional_param('calclength', '', PARAM_INT);
-                    $calcmax = optional_param('calcmax', '', PARAM_NUMBER);
-                    $oldoptions  = optional_param('defoptions', '', PARAM_RAW);
+                if ($olddef = optional_param_array('datasetdef', '', PARAM_RAW)) {
+                    $calcmin = optional_param_array('calcmin', '', PARAM_NUMBER);
+                    $calclength = optional_param_array('calclength', '', PARAM_INT);
+                    $calcmax = optional_param_array('calcmax', '', PARAM_NUMBER);
+                    $oldoptions  = optional_param_array('defoptions', '', PARAM_RAW);
                     $newdatasetvalues = false;
                     $sizeofolddef = count($olddef);
                     for ($key = 1; $key <= $sizeofolddef; $key++) {
@@ -238,7 +234,7 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
             }
         }
         $maxnumber = -1;
-        if ("" != optional_param('addbutton', '', PARAM_TEXT)) {
+        if (optional_param('addbutton', false, PARAM_BOOL)) {
             $maxnumber = optional_param('selectadd', '', PARAM_INT); //FIXME: sloppy coding
             foreach ($this->datasetdefs as $defid => $datasetdef) {
                 $datasetdef->itemcount = $maxnumber;
@@ -255,12 +251,12 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
             $this->maxnumber = $maxnumber;
         } else {
             // Handle reload dataset items
-            if ("" != optional_param('definition', '', PARAM_NOTAGS) &&
+            if (optional_param_array('definition', '', PARAM_NOTAGS) &&
                     !($datasettoremove ||$newdataset ||$newdatasetvalues)) {
                 $i = 1;
-                $fromformdefinition = optional_param('definition', '', PARAM_NOTAGS);
-                $fromformnumber = optional_param('number', '', PARAM_INT);
-                $fromformitemid = optional_param('itemid', '', PARAM_INT);
+                $fromformdefinition = optional_param_array('definition', '', PARAM_NOTAGS);
+                $fromformnumber = optional_param_array('number', '', PARAM_INT);
+                $fromformitemid = optional_param_array('itemid', '', PARAM_INT);
                 ksort($fromformdefinition);
 
                 foreach ($fromformdefinition as $key => $defid) {
@@ -320,7 +316,7 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
                 get_string('findwildcards', 'qtype_calculatedsimple'));
         $mform->registerNoSubmitButton('analyzequestion');
         $mform->closeHeaderBefore('analyzequestion');
-        if ("" != optional_param('analyzequestion', '', PARAM_RAW)) {
+        if (optional_param('analyzequestion', false, PARAM_BOOL)) {
 
             $this->wizarddisplay = true;
 
@@ -499,10 +495,7 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
 
                 //--------------------------------------------------------------
                 $j = $this->noofitems * count($this->datasetdefs);
-                $k = 1;
-                if ("" != optional_param('selectshow', '', PARAM_INT)) {
-                    $k = optional_param('selectshow', '', PARAM_INT);
-                }
+                $k = optional_param('selectshow', 1, PARAM_INT);
 
                 for ($i = $this->noofitems; $i >= 1; $i--) {
                     foreach ($this->datasetdefs as $defkey => $datasetdef) {
index d779aa7..f2cc2bf 100644 (file)
@@ -53,11 +53,7 @@ class qtype_multianswer_edit_form extends question_edit_form {
     public function __construct($submiturl, $question, $category, $contexts, $formeditable = true) {
         global $SESSION, $CFG, $DB;
         $this->regenerate = true;
-        if ("1" == optional_param('reload', '', PARAM_INT)) {
-            $this->reload = true;
-        } else {
-            $this->reload = false;
-        }
+        $this->reload = optional_param('reload', false, PARAM_BOOL);
 
         $this->used_in_quiz = false;
 
@@ -85,7 +81,7 @@ class qtype_multianswer_edit_form extends question_edit_form {
 
         // Remove meaningless defaultmark field.
         $mform->removeElement('defaultmark');
-        $this->confirm = optional_param('confirm', '0', PARAM_RAW);
+        $this->confirm = optional_param('confirm', false, PARAM_BOOL);
 
         // Make questiontext a required field for this question type.
         $mform->addRule('questiontext', null, 'required', null, 'client');
@@ -145,11 +141,10 @@ class qtype_multianswer_edit_form extends question_edit_form {
         if ($this->reload) {
             for ($sub = 1; $sub <= $countsubquestions; $sub++) {
 
-                $this->editas[$sub] = 'unknown type';
                 if (isset($this->questiondisplay->options->questions[$sub]->qtype)) {
                     $this->editas[$sub] = $this->questiondisplay->options->questions[$sub]->qtype;
-                } else if (optional_param('sub_'.$sub."_".'qtype', '', PARAM_RAW) != '') {
-                    $this->editas[$sub] = optional_param('sub_'.$sub."_".'qtype', '', PARAM_RAW);
+                } else {
+                    $this->editas[$sub] = optional_param('sub_'.$sub.'_qtype', 'unknown type', PARAM_PLUGIN);
                 }
 
                 $storemess = '';
@@ -167,43 +162,43 @@ class qtype_multianswer_edit_form extends question_edit_form {
                        '{#'.$sub.'}').'&nbsp;'.question_bank::get_qtype_name(
                         $this->questiondisplay->options->questions[$sub]->qtype).$storemess);
 
-                $mform->addElement('static', 'sub_'.$sub."_".'questiontext',
+                $mform->addElement('static', 'sub_'.$sub.'_questiontext',
                         get_string('questiondefinition', 'qtype_multianswer'));
 
                 if (isset ($this->questiondisplay->options->questions[$sub]->questiontext)) {
-                    $mform->setDefault('sub_'.$sub."_".'questiontext',
+                    $mform->setDefault('sub_'.$sub.'_questiontext',
                             $this->questiondisplay->options->questions[$sub]->questiontext['text']);
                 }
 
-                $mform->addElement('static', 'sub_'.$sub."_".'defaultmark',
+                $mform->addElement('static', 'sub_'.$sub.'_defaultmark',
                         get_string('defaultmark', 'question'));
-                $mform->setDefault('sub_'.$sub."_".'defaultmark',
+                $mform->setDefault('sub_'.$sub.'_defaultmark',
                         $this->questiondisplay->options->questions[$sub]->defaultmark);
 
                 if ($this->questiondisplay->options->questions[$sub]->qtype == 'shortanswer') {
-                    $mform->addElement('static', 'sub_'.$sub."_".'usecase',
+                    $mform->addElement('static', 'sub_'.$sub.'_usecase',
                             get_string('casesensitive', 'qtype_shortanswer'));
                 }
 
                 if ($this->questiondisplay->options->questions[$sub]->qtype == 'multichoice') {
-                    $mform->addElement('static', 'sub_'.$sub."_".'layout',
+                    $mform->addElement('static', 'sub_'.$sub.'_layout',
                             get_string('layout', 'qtype_multianswer'));
                 }
 
                 foreach ($this->questiondisplay->options->questions[$sub]->answer as $key => $ans) {
-                    $mform->addElement('static', 'sub_'.$sub."_".'answer['.$key.']',
+                    $mform->addElement('static', 'sub_'.$sub.'_answer['.$key.']',
                             get_string('answer', 'question'));
 
                     if ($this->questiondisplay->options->questions[$sub]->qtype == 'numerical' &&
                             $key == 0) {
-                        $mform->addElement('static', 'sub_'.$sub."_".'tolerance['.$key.']',
+                        $mform->addElement('static', 'sub_'.$sub.'_tolerance['.$key.']',
                                 get_string('acceptederror', 'qtype_numerical'));
                     }
 
-                    $mform->addElement('static', 'sub_'.$sub."_".'fraction['.$key.']',
+                    $mform->addElement('static', 'sub_'.$sub.'_fraction['.$key.']',
                             get_string('grade'));
 
-                    $mform->addElement('static', 'sub_'.$sub."_".'feedback['.$key.']',
+                    $mform->addElement('static', 'sub_'.$sub.'_feedback['.$key.']',
                             get_string('feedback', 'question'));
                 }
             }
@@ -490,7 +485,7 @@ class qtype_multianswer_edit_form extends question_edit_form {
 
         if (($this->negative_diff > 0 || $this->used_in_quiz &&
                 ($this->negative_diff > 0 || $this->negative_diff < 0 ||
-                        $this->qtype_change))&& $this->confirm == 0) {
+                        $this->qtype_change)) && !$this->confirm) {
             $errors['confirm'] =
                     get_string('confirmsave', 'qtype_multianswer', $this->negative_diff);
         }
index d7a5626..1f4b560 100644 (file)
@@ -43,7 +43,7 @@ a.dimmed_text:visited,
 .inline-list li,
 .block .list,
 .block .list li,
-.sitetopic .section li,
+.sitetopic .section li.activity,
 .course-content .section li.activity,
 .tabtree li {list-style: none;margin:0;padding:0;}
 
@@ -823,11 +823,11 @@ sup {vertical-align: super;}
 
 /* Fix for ordered and unordered list in course topic summary & course weekly summary */
 
-.course-content ul.weeks .content .summary ul li,
-.course-content ul.topics .content .summary ul li {list-style: disc outside none;}
+.course-content ul.weeks .content .summary ul,
+.course-content ul.topics .content .summary ul {list-style: disc outside none;}
 
-.course-content ul.weeks .content .summary ol li,
-.course-content ul.topics .content .summary ol li {list-style: decimal outside none;}
+.course-content ul.weeks .content .summary ol,
+.course-content ul.topics .content .summary ol {list-style: decimal outside none;}
 
 .dir-rtl #adminsettings #id_s__pathtodu,
 .dir-rtl #adminsettings #id_s__aspellpath,