Skip to content

Commit 9d3976d

Browse files
authored
Merge pull request #3 from bycs-lp/MBS-10572-Improvements_during_moodle_publishing
MBS-10572: Improvements during moodle publishing
2 parents d09d4d4 + 5bab3d4 commit 9d3976d

File tree

15 files changed

+1010
-127
lines changed

15 files changed

+1010
-127
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ It depends on block_ai_chat and basically wrapps an block_ai_chat instance in an
1010

1111
https://github.com/bycs-lp/moodle-block_ai_chat, https://github.com/bycs-lp/moodle-local_ai_manager and https://github.com/bycs-lp/moodle-tiny_ai need to be installed.
1212

13+
For being able to actually use AI tools, you will need to have a (paid) subscription to one of the AI services supported by local_ai_manager.
14+
1315
## Installing via uploaded ZIP file ##
1416

1517
1. Log in to your Moodle site as an admin and go to _Site administration >

amd/build/embedded_modal.min.js

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/embedded_modal.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/embedded_modal.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
// You should have received a copy of the GNU General Public License
1414
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1515

16+
/**
17+
* Module to initialize the aichat frontend.
18+
*
19+
* @module mod_aichat/embedded_modal
20+
* @copyright 2026 ISB Bayern
21+
* @author Philipp Memmel
22+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+
*/
24+
1625
import * as ReactiveInit from 'block_ai_chat/reactive_init';
1726
import Templates from 'core/templates';
1827

backup/moodle2/backup_aichat_stepslib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
class backup_aichat_structure_step extends backup_activity_structure_step {
2626
/**
2727
* Define structure.
28+
*
29+
* @return backup_nested_element
2830
*/
2931
protected function define_structure() {
3032
$userinfo = $this->get_setting_value('users');

backup/moodle2/restore_aichat_stepslib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
class restore_aichat_structure_step extends restore_activity_structure_step {
2828
/**
2929
* Define structure.
30+
*
31+
* @return array
3032
*/
3133
protected function define_structure() {
3234
$paths = [];
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
namespace mod_aichat\event;
18+
19+
/**
20+
* Event course_module_viewed
21+
*
22+
* @package mod_aichat
23+
* @copyright 2026 ISB Bayern
24+
* @author Philipp Memmel
25+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26+
*/
27+
class course_module_viewed extends \core\event\course_module_viewed {
28+
/**
29+
* Init method.
30+
*/
31+
protected function init() {
32+
parent::init();
33+
$this->data['objecttable'] = 'aichat';
34+
}
35+
36+
/**
37+
* Creates an instance of the course_module_viewed_event
38+
*
39+
* @param \stdClass $record the aichat record
40+
* @param \cm_info|\stdClass $cm the cm info record
41+
* @param \stdClass $course the course object
42+
* @return course_module_viewed the created event instance
43+
*/
44+
public static function create_from_record($record, $cm, $course) {
45+
/** @var course_module_viewed $event */
46+
$event = self::create([
47+
'objectid' => $record->id,
48+
'context' => \context_module::instance($cm->id),
49+
]);
50+
$event->add_record_snapshot('course_modules', $cm);
51+
$event->add_record_snapshot('course', $course);
52+
$event->add_record_snapshot('aichat', $record);
53+
return $event;
54+
}
55+
}

0 commit comments

Comments
 (0)