Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/completion/criteria/completion_criteria_activity.php

    r136 r1331  
    6161     */
    6262    public function config_form_display(&$mform, $data = null) {
    63         $mform->addElement('checkbox', 'criteria_activity['.$data->id.']', ucfirst(self::get_mod_name($data->module)).' - '.$data->name);
     63        $modnames = get_module_types_names();
     64        $mform->addElement('checkbox', 'criteria_activity['.$data->id.']',
     65                $modnames[self::get_mod_name($data->module)].
     66                ' - '.
     67                format_string($data->name));
    6468
    6569        if ($this->id) {
     
    148152
    149153        // If the activity is complete
    150         if (in_array($data->completionstate, array(COMPLETION_COMPLETE, COMPLETION_COMPLETE_PASS))) {
     154        if (in_array($data->completionstate, array(COMPLETION_COMPLETE, COMPLETION_COMPLETE_PASS, COMPLETION_COMPLETE_FAIL))) {
    151155            if ($mark) {
    152156                $completion->mark_complete();
     
    178182        $activity = $DB->get_record($this->module, array('id' => $module->instance));
    179183
    180         return shorten_text(urldecode($activity->name));
     184        return shorten_text(format_string($activity->name, true,
     185                array('context' => context_module::instance($module->id))));
    181186    }
    182187
     
    230235                mc.completionstate = '.COMPLETION_COMPLETE.'
    231236             OR mc.completionstate = '.COMPLETION_COMPLETE_PASS.'
     237             OR mc.completionstate = '.COMPLETION_COMPLETE_FAIL.'
    232238                )
    233239        ';
     
    283289        return $details;
    284290    }
     291
     292    /**
     293     * Return pix_icon for display in reports.
     294     *
     295     * @param string $alt The alt text to use for the icon
     296     * @param array $attributes html attributes
     297     * @return pix_icon
     298     */
     299    public function get_icon($alt, array $attributes = null) {
     300        return new pix_icon('icon', $alt, 'mod_'.$this->module, $attributes);
     301    }
    285302}
Note: See TracChangeset for help on using the changeset viewer.