Skip to content
Snippets Groups Projects
Verified Commit 03caa8b7 authored by Marcel Behrmann's avatar Marcel Behrmann
Browse files

Add Reports

parent 858c625a
Branches
Tags
No related merge requests found
Showing
with 533 additions and 7 deletions
<?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/>.
/*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace local_learning_analytics\local\routing;
class route {
public function __construct($target, $handler) {
}
}
\ No newline at end of file
<?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/>.
/*
* Router
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace local_learning_analytics\local\routing;
class router {
/**
* @var route[]
*/
private $routes;
/**
* router constructor.
*
* @param route[] $routes
*/
public function __construct(array $routes) {
$this->routes = $routes;
}
public function get_active_route() : route {
}
}
\ No newline at end of file
<?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/>.
/**
* Learning Analytics Base Output
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace local_learning_analytics;
abstract class output_base {
abstract function print() : string;
}
\ No newline at end of file
<?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/>.
/**
* Learning Analytics Output plugin definition
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace local_learning_analytics\plugininfo;
use core\plugininfo\base;
defined('MOODLE_INTERNAL') || die();
class laoutput extends base {
public function is_uninstall_allowed() {
return !$this->is_standard();
}
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ use core\plugininfo\base;
defined('MOODLE_INTERNAL') || die();
class learning_analytics_report extends base {
class lareport extends base {
public function is_uninstall_allowed() {
return true;
}
......
<?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/>.
/**
* Learning Analytics Base Report
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace local_learning_analytics;
abstract class report_base {
}
\ No newline at end of file
......@@ -25,5 +25,6 @@
*/
$subplugins = [
'learning_analytics_report' => 'local/learning_analytics/report'
'lareport' => 'local/learning_analytics/reports',
'laoutput' => 'local/learning_analytics/outputs'
];
\ No newline at end of file
......@@ -24,4 +24,36 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
echo 'Hallo Welt';
\ No newline at end of file
use local_learning_analytics\local\routing\router;
use local_learning_analytics\local\routing\route;
require(__DIR__ . '/../../config.php');
defined('MOODLE_INTERNAL') || die;
require_login();
global $PAGE;
$output = $PAGE->get_renderer('local_learning_analytics');
$reports = core_component::get_plugin_list('lareport');
echo $output->header();
echo $output->render_from_template('local_learning_analytics/base', ['reports' => $reports]);
echo $output->footer();
/*
$router = new router([
new route('/', function () {
})
]);
$router->get_active_route();
*/
\ No newline at end of file
......@@ -26,5 +26,9 @@
$string['pluginname'] = 'Learning Analytics';
$string['subplugintype_learning_analytics_report'] = 'Learning Analytics Report';
$string['subplugintype_learning_analytics_report'] = 'Learning Analytics Reports';
$string['learning_analytics'] = 'Learning Analytics';
$string['subplugintype_lareport'] = 'Report';
$string['subplugintype_lareport_plural'] = 'Reports';
$string['subplugintype_laoutput'] = 'Output';
$string['subplugintype_laoutput_plural'] = 'Outputs';
......@@ -25,3 +25,25 @@
*/
defined('MOODLE_INTERNAL') || die();
// Callback to extend navigation
/**
* @param global_navigation $nav
* @throws coding_exception
* @throws moodle_exception
*/
function local_learning_analytics_extend_navigation(global_navigation $nav) {
global $PAGE;
// Only extend navigation inside courses - 1 is the base system 'course'
if ($PAGE->context->contextlevel === CONTEXT_COURSE) {
$node = $nav->find($PAGE->context->instanceid, navigation_node::TYPE_COURSE);
if ($node) {
$node->add_node(navigation_node::create(
get_string('learning_analytics'),
new moodle_url('/local/learning_analytics/index.php')
));
}
}
}
\ No newline at end of file
<?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/>.
/**
* Strings for la_html
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['pluginname'] = 'Static HTML';
\ No newline at end of file
<?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/>.
/**
* Version info for output HTML
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'laoutput_html';
$plugin->version = '2018041204';
$plugin->requires = '2017111302';
<?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/>.
/**
* Strings for laoutput_table
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['pluginname'] = 'Table';
\ No newline at end of file
<?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/>.
use local_learning_analytics\output_base;
/**
* Learning Analytics Table Output
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class laoutput_table extends output_base {
private $table;
public function __construct() {
$this->table = new html_table();
}
public function set_header(array $header) {
$this->table->head = $header;
}
/**
* @param array $header
* @param $report
* @throws coding_exception
*/
public function set_header_local(array $header, $report) {
$this->table->head = [];
foreach ($header as $head) {
$this->table->head[] = get_string($head, $report);
}
}
function print(): string {
return html_writer::table($this->table);
}
}
\ No newline at end of file
<?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/>.
/**
* Version info for output Table
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'laoutput_table';
$plugin->version = '2018041204';
$plugin->requires = '2017111302';
<?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/>.
/**
* Strings for lareport_topmodules
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['pluginname'] = 'Top Modules';
\ No newline at end of file
<?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/>.
/**
* Version info for the Top Modules Report
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use local_learning_analytics\report_base;
class lareport_topmodules extends report_base {
}
\ No newline at end of file
<?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/>.
/**
* Version info for the Top Modules Report
*
* @package local_learning_analytics
* @copyright 2018 Lehr- und Forschungsgebiet Ingenieurhydrologie - RWTH Aachen University
* @author Marcel Behrmann <behrmann@lfi.rwth-aachen.de>
* @author Thomas Dondorf <dondorf@lfi.rwth-aachen.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'lareport_topmodules';
$plugin->version = '2018041204';
$plugin->requires = '2017111302';
$plugin->dependencies = [
'laoutput_table' => 2018041200,
];
\ No newline at end of file
<nav class="navbar navbar-dark bg-primary">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Courses</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Reports</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Need help</a>
</li>
</ul>
</nav>
\ No newline at end of file
......@@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die;
$plugin->component = 'local_learning_analytics';
$plugin->version = '2018040101';
$plugin->version = '2018041204';
$plugin->release = 'v0.1.0-dev';
$plugin->maturity = MATURITY_ALPHA;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment