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
.
/**
* Callback and other methods for viewquestionname plugin.
*
* @package qbank_viewquestionname
* @copyright 2022 Catalyst IT Australia Pty Ltd
* @author Safat Shahin
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* In place editing callback for question name.
*
* @param string $itemtype type of the item, questionname for this instance
* @param int $itemid question id to change the title
* @param string $newvalue the changed question title
* @return \core\output\inplace_editable
*/
function qbank_viewquestionname_inplace_editable ($itemtype, $itemid, $newvalue) : \core\output\inplace_editable {
if ($itemtype === 'questionname') {
global $CFG, $DB;
require_once($CFG->libdir . '/questionlib.php');
// Get the question data and to confirm any invalud itemid is not passed.
$record = $DB->get_record('question', ['id' => $itemid], '*', MUST_EXIST);
// Load question data from question engine.
$question = question_bank::load_question($record->id);
question_require_capability_on($question, 'edit');
// Context validation.
\external_api::validate_context(context::instance_by_id($question->contextid));
// Now update the question data.
$record->name = $newvalue;
$DB->update_record('question', $record);
// Trigger events.
question_bank::notify_question_edited($record->id);
$event = \core\event\question_updated::create_from_question_instance($question);
$event->trigger();
// Prepare the element for the output.
return new \qbank_viewquestionname\output\questionname($record);
}
}