Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* Helper functions and callbacks.
*
* @package qbank_usage
* @copyright 2021 Catalyst IT Australia Pty Ltd
* @author Safat Shahin
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Question usage fragment callback.
*
* @param array $args
* @return string rendered output
*/
function qbank_usage_output_fragment_question_usage(array $args): string {
global $USER, $PAGE, $CFG, $DB;
require_once($CFG->dirroot . '/question/engine/bank.php');
$displaydata = [];
$question = question_bank::load_question($args['questionid']);
$quba = question_engine::make_questions_usage_by_activity('core_question_preview', context_user::instance($USER->id));
$options = new \qbank_previewquestion\question_preview_options($question);
$quba->set_preferred_behaviour($options->behaviour);
$slot = $quba->add_question($question, $options->maxmark);
$quba->start_question($slot, $options->variant);
$transaction = $DB->start_delegated_transaction();
question_engine::save_questions_usage_by_activity($quba);
$transaction->allow_commit();
$displaydata['question'] = $quba->render_question($slot, $options, '1');
$questionusagetable = new \qbank_usage\tables\question_usage_table('question_usage_table', $question);
$questionusagetable->baseurl = new moodle_url('');
if (isset($args['querystring'])) {
$querystring = preg_replace('/^\?/', '', $args['querystring']);
$params = [];
parse_str($querystring, $params);
if (isset($params['page'])) {
$questionusagetable->currpage = $params['page'];
}
}
$displaydata['tablesql'] = $questionusagetable->export_for_fragment();
$selector = \core_question\output\question_version_selection::make_for_question('question_usage_version_dropdown',
$args['questionid']);
$qbankrenderer = $PAGE->get_renderer('core_question', 'bank');
$displaydata['versionselection'] = $selector->export_for_template($qbankrenderer);
return $PAGE->get_renderer('qbank_usage')->render_usage_fragment($displaydata);
}