Quantcast
Channel: Assignment
Viewing all articles
Browse latest Browse all 9615

Re: A tip to hide 'Assignment (2.2)' at chooser

$
0
0
by Monica Franz.  

Hi,
trying this for Moodle 2.5 I got the debugging message:

  Notice: Undefined variable: module in /local/hosting/moodle/course/renderer.php on line 253 Notice: Trying to get property of non-object in /local/hosting/moodle/course/renderer.php on line 253 Notice: Undefined variable: module in /local/hosting/moodle/course/renderer.php on line 253 Notice: Trying to get property of non-object in /local/hosting/moodle/course/renderer.php on line 253

The code looks like this:

   /**
     * Build the HTML for a specified set of modules
     *
     * @param array $modules A set of modules as used by the
     * course_modchooser_module function
     * @return string The composed HTML for the module
     */
    protected function course_modchooser_module_types($modules) {
 if (in_array($module->name,array('assignment','upload','online','uploadsingle','offline'))){ return ''; }  <-- Line 253
      $return = '';
       foreach ($modules as $module) {
            if (!isset($module->types)) {
               $return .= $this->course_modchooser_module($module);
            } else {
                $return .= $this->course_modchooser_module($module, array('nonoption'));
                foreach ($module->types as $type) {
                    $return .= $this->course_modchooser_module($type, array('option', 'subtype'));
                }
            }
 
        }
        return $return;
    }

What do I have to change to get this working?

Cheers,

Monica

 

 

 


Viewing all articles
Browse latest Browse all 9615

Trending Articles