Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // Initialize the first code tab as visible
+ document.getElementById('messaging-code').classList.add('active');
+
+ // Sample code content (would be replaced with actual Moodle modifications)
+ document.getElementById('messaging-code').textContent = `// messaging/lib.php modifications
+ function moodleinnovate_extend_messaging() {
+ // Added real-time typing indicators
+ $PAGE->requires->js_call_amd('mod_moodleinnovate/typing', 'init');
+
+ // Integrated sentiment analysis
+ $PAGE->requires->js_call_amd('mod_moodleinnovate/sentiment', 'analyze');
+
+ // Added message threading
+ return array(
+ 'message_threading' => true,
+ 'typing_indicators' => true
+ );
+ }`;
+
+ document.getElementById('jobs-code').textContent = `// local/jobs/db/install.php
+ function xmldb_local_jobs_install() {
+ global $DB;
+
+ // Create new competency-job mapping table
+ $dbman = $DB->get_manager();
+ $table = new xmldb_table('local_jobs_mapping');
+
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+ $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('jobid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('matchscore', XMLDB_TYPE_NUMBER, '10,2', null, XMLDB_NOTNULL, null, null);
+
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+ $table->add_index('competency_job', XMLDB_INDEX_UNIQUE, array('competencyid', 'jobid'));
+
+ $dbman->create_table($table);
+
+ return true;
+ }`;
+
+ document.getElementById('video-code').textContent = `// mod/videoroom/view.php
+ require_once(__DIR__.'/lib.php');
+
+ // Our custom video room rendering
+ function moodleinnovate_render_videoroom($cm, $context) {
+ global $PAGE, $OUTPUT;
+
+ $PAGE->requires->js_call_amd('mod_videoroom/room', 'init', array(
+ 'roomId' => $cm->instance,
+ 'userId' => $USER->id,
+ 'capabilities' => array(
+ 'screenShare' => has_capability('mod/videoroom:screenshare', $context),
+ 'moderate' => has_capability('mod/videoroom:moderate', $context)
+ ));
+
+ return $OUTPUT->render_from_template('mod_videoroom/room', array(
+ 'title' => format_string($videoroom->name),
+ 'description' => format_text($videoroom->intro, $videoroom->introformat)
+ ));
+ }`;
+ });
+
+ function showTab(tabId) {
+ // Hide all code examples
+ document.querySelectorAll('.code-example').forEach(tab => {
+ tab.classList.remove('active');
+ });
+
+ // Deactivate all buttons
+ document.querySelectorAll('.tab-button').forEach(button => {
+ button.classList.remove('active');
+ });
+
+ // Show selected tab and activate button
+ document.getElementById(tabId + '-code').classList.add('active');
+ event.currentTarget.classList.add('active');
+ }