Commit c5881ea3 authored by Robert Lyon's avatar Robert Lyon

Bug 1409546: Adding in the framework module

Installs the framework plugin and add in a basic .maxtrix file

Change-Id: I059ceb523d88894b0b68e3d54dde91f7c441adcc
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 242dbb39
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="2013010705" COMMENT="XMLDB file for Smart Evidence Framework mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="framework">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="all" />
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="description" TYPE="text" NOTNULL="false" />
<FIELD NAME="selfassess" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
</KEYS>
</TABLE>
<TABLE NAME="framework_standard">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="framework" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" />
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="description" TYPE="text" NOTNULL="false" />
<FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
<KEY NAME="frameworkfk" TYPE="foreign" FIELDS="framework" REFTABLE="framework" REFFIELDS="id" />
</KEYS>
</TABLE>
<TABLE NAME="framework_standard_element">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="standard" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" />
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="description" TYPE="text" NOTNULL="false" />
<FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
<KEY NAME="frameworkstandardfk" TYPE="foreign" FIELDS="standard" REFTABLE="framework_standard" REFFIELDS="id" />
</KEYS>
</TABLE>
<TABLE NAME="framework_evidence">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="annotation" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="framework" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="element" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="state" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="reviewer" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
<KEY NAME="annotationfk" TYPE="foreign" FIELDS="annotation" REFTABLE="block_instance" REFFIELDS="id" />
<KEY NAME="frameworkfk" TYPE="foreign" FIELDS="framework" REFTABLE="framework" REFFIELDS="id" />
<KEY NAME="elementfk" TYPE="foreign" FIELDS="element" REFTABLE="framework_standard_element" REFFIELDS="id" />
<KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
<KEY NAME="reviewerfk" TYPE="foreign" FIELDS="reviewer" REFTABLE="usr" REFFIELDS="id" />
<KEY NAME="namepluginuk" TYPE="unique" FIELDS="framework, element, view" />
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
<?php
/**
*
* @package mahara
* @subpackage module-framework
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
defined('INTERNAL') || die();
$string['accessdeniedsmartevidencenotallowed'] = 'SmartEvidence needs to be enabled for the institution "%s".';
$string['taskscompleted'] = 'Tasks completed';
$string['addpages'] = 'Add more pages to this collection if you want them to show up here in the SmartEvidence map.';
\ No newline at end of file
This diff is collapsed.
{"framework":
{"institution":"all",
"name":"SmartEvidence",
"description":"This is the example SmartEvidence matrix",
"selfassess":true,
"standards":
[
{
"shortname":"Professional knowledge 1.",
"name":"Know the students and how they learn",
"description":"",
"priority":1,
"standardelement":
[
{
"shortname":"1.1",
"name":"one point one",
"description":"This is the first sub standard of standard 1",
"priority":1,
"parent":false
},
{
"shortname":"1.2",
"name":"one point two",
"description":"This is the second sub standard of standard 1",
"priority":2,
"parent":false
},
{
"shortname":"1.2.1",
"name":"one point two point one",
"description":"This is the second sub standard of standard 1 with sub clause one",
"priority":3,
"parent":true
},
{
"shortname":"1.3",
"name":"one point three",
"description":"This is the third sub standard of standard 1",
"priority":4,
"parent":false
}
]
},
{
"shortname":"Professional knowledge 2.",
"name":"Know the content and how to teach it",
"description":"Special descritpion for this one",
"priority":2,
"standardelement":
[
{
"shortname":"2.1",
"name":"two point one",
"description":"This is the first sub standard of standard 2",
"priority":1,
"parent":false
},
{
"shortname":"2.2",
"name":"two point two",
"description":"This is the second sub standard of standard 2",
"priority":2,
"parent":false
},
{
"shortname":"2.3",
"name":"two point three",
"description":"This is the third sub standard of standard 2",
"priority":3,
"parent":false
},
{
"shortname":"2.4",
"name":"two point four",
"description":"This is the fourth sub standard of standard 2",
"priority":4,
"parent":false
},
{
"shortname":"2.5",
"name":"two point five",
"description":"This is the fifth sub standard of standard 2",
"priority":5,
"parent":false
},
{
"shortname":"2.6",
"name":"two point six",
"description":"This is the sixth sub standard of standard 2",
"priority":6,
"parent":false
}
]
},
{
"shortname":"Unused standard 1.",
"name":"Will add standardelements later",
"description":"This is an empty standard",
"priority":3
},
{
"shortname":"Professional practice 1.",
"name":"Plan for and implement effective teaching and learning",
"description":"",
"priority":4,
"standardelement":
[
{
"shortname":"4.1",
"name":"four point one",
"description":"This is the first sub standard of standard 4",
"priority":1,
"parent":false
},
{
"shortname":"4.2",
"name":"four point two",
"description":"This is the second sub standard of standard 4",
"priority":2,
"parent":false
}
]
}
]
}
}
\ No newline at end of file
<?php
/**
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
define('INTERNAL', 1);
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'framework');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once(get_config('libroot') . 'view.php');
require_once(get_config('libroot') . 'collection.php');
require_once(get_config('libroot') . 'institution.php');
safe_require('module', 'framework');
safe_require('artefact', 'comment');
// This page should only be viewable if:
// 1). The collection has_framework() return true
// 2). The institution the collection owner belongs to has 'Smart Evidence' turned on.
// 3). The collection is able to be viewed by the user.
$collectionid = param_integer('id');
$collection = new Collection($collectionid);
$owner = $collection->get('owner');
$institution = $collection->get('institution');
if (!$collection->has_framework()) {
$errorstr = get_string('accessdenied', 'error');
throw new AccessDeniedException($errorstr);
}
if ($owner) {
// Find what institution they belong to
// Use first one if they belong to multiple
$user = new User();
$user->find_by_id($owner);
$institutions = array_keys($user->get('institutions'));
$institution = (!empty($institutions)) ? $institutions[0] : 'mahara';
}
$institution = new Institution($institution);
// Check that smart evidence is enabled for the institution
if (!$institution->allowinstitutionsmartevidence) {
$errorstr = get_string('accessdeniedsmartevidencenotallowed', 'module.framework', $institution->displayname);
throw new AccessDeniedException($errorstr);
}
$views = $collection->get('views');
// Get the first view from the collection
$firstview = $views['views'][0];
$view = new View($firstview->id);
if (!can_view_view($view->get('id'))) {
$errorstr = get_string('accessdenied', 'error');
throw new AccessDeniedException($errorstr);
}
$framework = new Framework($collection->get('framework'));
$standards = $framework->standards();
define('TITLE', $collection->get('name'));
$javascript = array('js/collection-navigation.js');
// Set up theme
$viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
$headers = array();
$headers[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/smoothness/jquery-ui.min.css') . '">';
// Set up skin, if the page has one
$viewskin = $view->get('skin');
$issiteview = $view->get('institution') == 'mahara';
if ($viewskin && get_config('skins') && can_use_skins($owner, false, $issiteview) && (!isset($THEME->skins) || $THEME->skins !== false)) {
$skin = array('skinid' => $viewskin, 'viewid' => $view->get('id'));
}
else {
$skin = false;
}
$headers[] = '<meta name="robots" content="noindex">'; // Tell search engines not to index this page
$smarty = smarty(
$javascript,
$headers,
array('View' => 'view',
'Collection' => 'collection'),
array(
'sidebars' => false,
'skin' => $skin
)
);
$evidence = $framework->get_evidence();
if (!$evidence) {
$evidence = array();
}
$evidencematrix = $completed = array();
foreach ($evidence as $e) {
$evidencematrix[$e->framework][$e->element][$e->view] = Framework::get_state_array($e->state);
if (!isset($completed[$e->element])) {
$completed[$e->element] = 0;
}
if ((int) $e->state === Framework::EVIDENCE_COMPLETED) {
$completed[$e->element] ++;
}
}
// $smarty->assign('INLINEJAVASCRIPT', $javascript . $inlinejs);
$smarty->assign('maintitle', $collection->get('name'));
$smarty->assign('owner', $owner);
$smarty->assign('PAGEHEADING', null);
$smarty->assign('name', $framework->get('name'));
$smarty->assign('description', $framework->get('description'));
$smarty->assign('standards', $standards['standards']);
$smarty->assign('evidence', $evidencematrix);
$smarty->assign('completed', $completed);
$smarty->assign('standardscount', $standards['count']);
$smarty->assign('framework', $collection->get('framework'));
$smarty->assign('views', $views['views']);
$smarty->assign('viewcount', $views['count']);
$smarty->assign('totalcompleted', array_sum($completed));
$smarty->display('module:framework:matrix.tpl');
<?php
/**
*
* @package mahara
* @subpackage module-framework
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2016071400;
$config->release = '1.0.0';
{include file="header.tpl"}
{if $collection}
{include file=collectionnav.tpl}
{/if}
<h1 id="viewh1" class="page-header">
<span class="section-heading">{$name}</span>
</h1>
<p>{$description}</p>
<p>{str tag="addpages" section="module.framework"}</p>
<table class="fullwidth table tablematrix">
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
{foreach from=$views key=vk item=view}
<th class="viewtab"><a href="{$view->fullurl}">{$view->title}</a></th>
{/foreach}
</tr>
{foreach from=$standards key=sk item=standard}
<tr class="standard">
<td colspan="{$viewcount + 2}" title="{$standard->description}">{$standard->shortname} {$standard->name}</td>
</tr>
{if $standard->options}
{foreach from=$standard->options key=ok item=option}
<tr{if $option->parent} class="sub"{/if}>
<td class="code"><div>{$option->shortname} <span class="hidden">{$option->name}<br>{$option->description}</span></div></td>
<td>{if $completed[$option->id]}{$completed[$option->id]}{else}0{/if}</td>
{foreach from=$views key=vk item=view}
<td class="mid">{if $evidence[$framework][$option->id][$view->id].completed}
<span class="icon icon-circle completed"></span>
{elseif $evidence[$framework][$option->id][$view->id].partialcomplete}
<span class="icon icon-adjust partial"></span>
{elseif $evidence[$framework][$option->id][$view->id].incomplete}
<span class="icon icon-circle-o incomplete"></span>
{elseif $evidence[$framework][$option->id][$view->id].begun}
<span class="icon icon-circle-o begun"></span>
{else}
<span>&bull;</span>
{/if}
</td>
{/foreach}
</tr>
{/foreach}
{/if}
{/foreach}
<tr>
<td>{str tag="taskscompleted" section="module.framework"}</td>
<td>{$totalcompleted}</td>
<td colspan="{$viewcount}">&nbsp;</td>
</tr>
</table>
{include file="footer.tpl"}
\ No newline at end of file
.tablematrix {
tr.standard {
background: darken($table-bg-accent, 2%) !important;
}
tr.sub {
background: lighten($table-bg-accent, 1%) !important;
}
th.viewtab {
text-align: center;
}
td {
&.mid {
text-align: center;
vertical-align: middle;
span {
&.begun {
color: #5b9aa9;
}
&.incomplete {
color: $brand-danger;
}
&.partial {
color: $brand-warning;
}
&.completed {
color: $brand-success;
}
}
}
&.code {
width: 20%;
}
}
}
\ No newline at end of file
......@@ -71,6 +71,7 @@
@import "../components/toggles";
@import "../components/tags";
@import "../components/user-icon";
@import "../components/framework"; // For the framework matrix
// Feature related sass. We avoid this where we can in favour of reusable components
......
@javascript @core @core_administration
Feature: Make sure 'framework' module is installed and active
In order to use SmartEvidence
As an admin
So I can benefit from the recording/marking of SmartEvidence in Mahara
Scenario: Installing framework module
Given I log in as "admin" with password "Kupuhipa1"
And I follow "Administration"
And I choose "Plugin administration" in "Extensions"
Then I should see "Hide" in the "form#activate_module_framework" "css_element"
# Also make sure the annotation blocktype plugin is active
And I press "Show" in the "form#activate_blocktype_annotation" "css_element"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment