Commit c46b241f authored by Robert Lyon's avatar Robert Lyon

Bug 1409546: More adjustments

1) Saving framework setting when copying collection

2) Removing the ability of site admins from setting an institution only
framework to a different institution

3) Made standard tooltip be like element tooltip

4) Added owner's name to the matrix.page

5) Added the framework name as a 'page' in the list for
collection/index.php

6) Updated the matrix completed count before page reload

7) Allowed basic html in .matrix descriptions

8) Replaced example.matrix with 2 new .matrix files

9) Fixed issue where framework evidence was not being restricted to a
collection

Change-Id: I171ff55482191e19b9b734907af7a86bfd1ccede
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1f9af265
......@@ -240,17 +240,17 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
safe_require('module', 'framework');
$framework = new Framework($collection->get('framework'));
$standards = $framework->standards();
$evidence = $framework->get_evidence($instance->get('id'));
$evidence = $framework->get_evidence($collection->get('id'), $instance->get('id'));
$selectoptions = array();
$selectdesciptions = array();
foreach ($standards['standards'] as $standard) {
if (isset($standard->options)) {
$selectoptions[$standard->id] = array(
'label' => $standard->shortname . ' ' . $standard->name,
'label' => $standard->name,
'options' => array(),
);
foreach ($standard->options as $option) {
$selectoptions[$standard->id]['options'][$option->id] = $option->shortname . ' ' . $option->name;
$selectoptions[$standard->id]['options'][$option->id] = $option->name;
$selectdescriptions[$option->id] = $option->description;
}
}
......
......@@ -68,6 +68,11 @@ foreach ($data->data as $value) {
if (!empty($views)) {
$value->views = $views['views'];
}
if ($collection->get('framework')) {
safe_require('module', 'framework');
$framework = new Framework($collection->get('framework'));
$value->frameworkname = $framework->get('name');
}
}
$smarty = smarty_core();
$smarty->assign('canedit', $canedit);
......
......@@ -96,6 +96,11 @@ foreach ($data->data as $value) {
if (!empty($views)) {
$value->views = $views['views'];
}
if ($collection->get('framework')) {
safe_require('module', 'framework');
$framework = new Framework($collection->get('framework'));
$value->frameworkname = $framework->get('name');
}
}
$pagination = build_pagination(array(
......
......@@ -275,6 +275,7 @@ class Collection {
else {
$data->owner = $userid;
}
$data->framework = $colltemplate->get('framework');
$collection = self::save($data);
......
......@@ -1616,7 +1616,7 @@ function plugin_types() {
static $pluginstocheck;
if (empty($pluginstocheck)) {
// ORDER MATTERS! artefact has to be before blocktype
$pluginstocheck = array('artefact', 'auth', 'notification', 'search', 'blocktype', 'interaction', 'grouptype', 'import', 'export', 'module');
$pluginstocheck = array('artefact', 'auth', 'notification', 'search', 'module', 'blocktype', 'interaction', 'grouptype', 'import', 'export');
}
return $pluginstocheck;
}
......
......@@ -277,6 +277,7 @@ class Framework {
$sfordb->{$v} = isset($standard->{$v}) ? $standard->{$v} : null;
}
if (!empty($standard->id)) {
$sfordb->id = $standard->id;
update_record('framework_standard', $sfordb, 'id');
}
else {
......@@ -296,6 +297,7 @@ class Framework {
$sofordb->{$ov} = isset($option->{$ov}) ? $option->{$ov} : null;
}
if (!empty($option->id)) {
$sofordb->id = $option->id;
$prevoption = $option->id;
update_record('framework_standard', $sofordb, 'id');
}
......@@ -441,10 +443,6 @@ class Framework {
public function get_frameworks($institution = 'any', $shared = false) {
global $USER;
if ($USER->get('admin')) {
$institution = 'any'; // make sure site admin can get full list regardless
}
$sql = "SELECT * FROM {framework}";
$values = array();
if ($institution != 'any') {
......@@ -467,21 +465,25 @@ class Framework {
* Add/update an annotation block on a view via the framework matrix page.
* This hooks into using the annotation block's config form.
*
* @param int $collectionid
* @param int $annotationid
*
* @return evidence(s)
*/
public function get_evidence($annotationid = false) {
$evidence = get_records_array('framework_evidence', 'framework', $this->id);
if (!empty($annotationid) && $evidence) {
foreach ($evidence as $e) {
if ($e->annotation === $annotationid) {
return $e;
public function get_evidence($collectionid, $annotationid = false) {
if ($viewids = get_column('collection_view', 'view', 'collection', $collectionid)) {
$evidence = get_records_sql_array('SELECT * FROM {framework_evidence} WHERE framework = ? AND view IN (' . join(',', $viewids) . ')', array($this->id));
if (!empty($annotationid) && $evidence) {
foreach ($evidence as $e) {
if ($e->annotation === $annotationid) {
return $e;
}
}
return false;
}
return false;
return $evidence;
}
return $evidence;
return false;
}
public static function annotation_config_form($data) {
......
{"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
{"framework":
{"institution":"all",
"name":"Career Readiness",
"description":"NACE (National Association of Colleges and Employers) in the U.S.A. identified seven competencies associated with career readiness. Source: http://www.naceweb.org/knowledge/career-readiness-competencies.aspx",
"selfassess":false,
"standards":
[
{
"shortname":"Career Readiness",
"name":"Career Readiness Competencies",
"description":"Career readiness is the attainment and demonstration of requisite competencies that broadly prepare college graduates for a successful transition into the workplace.",
"priority":1,
"standardelement":
[
{
"shortname":"Critical Thinking",
"name":"Critical Thinking/Problem Solving",
"description":"Exercise sound reasoning to analyze issues, make decisions, and overcome problems. The individual is able to obtain, interpret, and use knowledge, facts, and data in this process, and may demonstrate originality and inventiveness.",
"priority":1,
"parent":false
},
{
"shortname":"Communication",
"name":"Oral/Written Communications",
"description":"Articulate thoughts and ideas clearly and effectively in written and oral forms to persons inside and outside of the organization. The individual has public speaking skills; is able to express ideas to others; and can write/edit memos, letters, and complex technical reports clearly and effectively.",
"priority":2,
"parent":false
},
{
"shortname":"Teamwork",
"name":"Teamwork/Collaboration",
"description":"Build collaborative relationships with colleagues and customers representing diverse cultures, races, ages, genders, religions, lifestyles, and viewpoints. The individual is able to work within a team structure, and can negotiate and manage conflict.",
"priority":3,
"parent":false
},
{
"shortname":"Info Tech",
"name":"Information Technology Application",
"description":"Select and use appropriate technology to accomplish a given task. The individual is also able to apply computing skills to solve problems.",
"priority":4,
"parent":false
},
{
"shortname":"Leadership",
"name":"Leadership",
"description":"Leverage the strengths of others to achieve common goals, and use interpersonal skills to coach and develop others. The individual is able to assess and manage his/her emotions and those of others; use empathetic skills to guide and motivate; and organize, prioritize, and delegate work.",
"priority":5,
"parent":false
},
{
"shortname":"Professionalism",
"name":"Professionalism/Work Ethics",
"description":"Demonstrate personal accountability and effective work habits, e.g., punctuality, working productively with others, and time workload management, and understand the impact of non-verbal communication on professional work image. The individual demonstrates integrity and ethical behavior, acts responsibly with the interests of the larger community in mind, and is able to learn from his/her mistakes.",
"priority":6,
"parent":false
},
{
"shortname":"Career Management",
"name":"Career Management",
"description":"Identify and articulate one's skills, strengths, knowledge, and experiences relevant to the position desired and career goals, and identify areas necessary for professional growth. The individual is able to navigate and explore job options, understands and can take the steps necessary to pursue opportunities, and understands how to self-advocate for opportunities in the workplace.",
"priority":3,
"parent":false
}
]
}
]
}
}
{"framework":
{"institution":"all",
"name":"Practising Teacher Criteria",
"description":"<p>The Practising Teacher Criteria describe the criteria for quality teaching that are to be met by all fully certificated teachers in Aotearoa New Zealand.</p><p>The Practising Teacher Criteria recognise that teaching is a highly complex activity, drawing on repertoires of knowledge, practices, professional attributes and values to facilitate academic, social and cultural learning for diverse education settings. The criteria and indicators should be viewed as interdependent and overlapping. <i>Source: http://educationcouncil.org.nz/content/registered-teacher-criteria-1</i></p>",
"selfassess":false,
"standards":
[
{
"shortname":"Professional relationships and professional values",
"name":"Professional relationships and professional values",
"description":"Fully certificated teachers engage in appropriate professional relationships and demonstrate commitment to professional values.",
"priority":1,
"standardelement":
[
{
"shortname":"1",
"name":"Establish and maintain effective professional relationships focused on the learning and well-being of ākonga",
"description":"<ol type=\"i\"><li>engage in ethical, respectful, positive and collaborative professional relationships with: <ul><li>ākonga</li><li>teaching colleagues, support staff and other professionals</li><li>whānau and other carers of ākonga</li><li>agencies, groups and individuals in the community</li></ul></li></ol>
",
"priority":1,
"parent":false
},
{
"shortname":"2",
"name":"Demonstrate commitment to promoting the well-being of all ākonga",
"description":"<ol type=\"i\"><li>take all reasonable steps to provide and maintain a teaching and learning environment that is physically, socially, culturally and emotionally safe</li><li>acknowledge and respect the languages, heritages and cultures of all ākonga</li><li>comply with relevant regulatory and statutory requirements</li></ol>",
"priority":2,
"parent":false
},
{
"shortname":"3",
"name":"Demonstrate commitment to bicultural partnership in Aotearoa New Zealand",
"description":"<ol type=\"i\"><li>demonstrate respect for the heritages, languages and cultures of both partners to the Treaty of Waitangi</li></ol>",
"priority":3,
"parent":true
},
{
"shortname":"4",
"name":"Demonstrate commitment to ongoing professional learning and development of personal professional practice",
"description":"<ol type=\"i\"><li>identify professional learning goals in consultation with colleagues</li><li>participate responsively in professional learning opportunities within the learning community</li><li>initiate learning opportunities to advance personal professional knowledge and skills</li></ol>",
"priority":4,
"parent":false
},
{
"shortname":"5",
"name":"Show leadership that contributes to effective teaching and learning",
"description":"<ol type=\"i\"><li>actively contribute to the professional learning community</li><li>undertake areas of responsibility effectively</li></ol>",
"priority":5,
"parent":false
}
]
},
{
"shortname":"Professional knowledge in practice",
"name":"Professional knowledge in practice",
"description":"Fully certificated teachers make use of their professional knowledge and understanding to build a stimulating, challenging and supportive learning environment that promotes learning and success for all ākonga.",
"priority":2,
"standardelement":
[
{
"shortname":"6",
"name":"Conceptualise, plan and implement an appropriate learning programme",
"description":"<ol type=\"i\"><li>articulate clearly the aims of their teaching, give sound professional reasons for adopting these aims, and implement them in their practice</li><li>through their planning and teaching, demonstrate their knowledge and understanding of relevant content, disciplines and curriculum documents</li></ol>",
"priority":1,
"parent":false
},
{
"shortname":"7",
"name":"Promote a collaborative, inclusive and supportive learning environment",
"description":"<ol type=\"i\"><li>demonstrate effective management of the learning setting which incorporates successful strategies to engage and motivate ākonga</li><li>foster trust, respect and cooperation with and among ākonga</li></ol>",
"priority":2,
"parent":false
},
{
"shortname":"8",
"name":"Demonstrate in practice their knowledge and understanding of how ākonga learn",
"description":"<ol type=\"i\"><li>enable ākonga to make connections between their prior experiences and learning and their current learning activities</li><li>provide opportunities and support for ākonga to engage with, practise and apply new learning to different contexts</li><li>encourage ākonga to take responsibility for their own learning and behaviour</li><li>assist ākonga to think critically about information and ideas and to reflect on their learning</li></ol>",
"priority":3,
"parent":false
},
{
"shortname":"9",
"name":"Respond effectively to the diverse language and cultural experiences, and the varied strengths, interests and needs of individuals and groups of ākonga",
"description":"<ol type=\"i\"><li>demonstrate knowledge and understanding of social and cultural influences on learning, by working effectively in the bicultural and multicultural contexts of learning in Aotearoa New Zealand</li><li>select teaching approaches, resources, technologies and learning and assessment activities that are inclusive and effective for diverse ākonga</li><li>modify teaching approaches to address the needs of individuals and groups of ākonga</li></ol>",
"priority":4,
"parent":false
},
{
"shortname":"10",
"name":"Work effectively within the bicultural context of Aotearoa New Zealand",
"description":"<ol type=\"i\"><li>practise and develop the relevant use of te reo Māori me ngā tikanga-a-iwi in context</li><li>specifically and effectively address the educational aspirations of ākonga Māori, displaying high expectations for their learning</li></ol>",
"priority":5,
"parent":false
},
{
"shortname":"11",
"name":"Analyse and appropriately use assessment information, which has been gathered formally and informally",
"description":"<ol type=\"i\"><li>analyse assessment information to identify progress and ongoing learning needs of ākonga</li><li>use assessment information to give regular and ongoing feedback to guide and support further learning</li><li>analyse assessment information to reflect on and evaluate the effectiveness of the teaching</li><li>communicate assessment and achievement information to relevant members of the learning community</li><li>foster involvement of whānau in the collection and use of information about the learning of ākonga</li></ol>",
"priority":6,
"parent":false
},
{
"shortname":"12",
"name":"Use critical inquiry and problem-solving effectively in their professional practice",
"description":"<ol type=\"i\"><li>systematically and critically engage with evidence and professional literature to reflect on and refine practice</li><li>respond professionally to feedback from members of their learning community</li><li>critically examine their own beliefs, including cultural beliefs, and how they impact on their professional practice and the achievement of ākonga</li></ol>",
"priority":7,
"parent":false
}
]
}
]
}
}
......@@ -101,7 +101,7 @@ if ($collection) {
}
}
$evidence = $framework->get_evidence();
$evidence = $framework->get_evidence($collection->get('id'));
if (!$evidence) {
$evidence = array();
}
......@@ -256,6 +256,7 @@ jQuery(function($) {
values['view'] = params.view;
values['option'] = params.option;
values['action'] = 'update';
tinyMCE.execCommand('mceRemoveEditor', false, "instconf_text");
editmatrix_update(values);
dock.hide();
});
......@@ -314,6 +315,8 @@ jQuery(function($) {
.attr('class', results.data.class)
.data('option', results.data.option)
.data('view', results.data.view).empty();
var completed = parseInt($('#tablematrix tr:eq(' + celly + ') td.completedcount').text(), 10);
$('#tablematrix tr:eq(' + celly + ') td.completedcount').text(completed + results.data.completed);
}
if (results.data.tablerows) {
if ($("#matrixfeedbacklist").has(".annotationfeedbacktable").length == 0) {
......@@ -328,7 +331,8 @@ jQuery(function($) {
// Setup
carousel_matrix();
$('.code div').hover(
// show / hide tooltips for standard elements
$('td.code div, tr.standard div').hover(
function() {
$(this).find('span').removeClass('hidden');
},
......@@ -353,5 +357,18 @@ $smarty->assign('standardscount', $standards['count']);
$smarty->assign('framework', $collection->get('framework'));
$smarty->assign('views', $views['views']);
$smarty->assign('viewcount', $views['count']);
if ($view->is_anonymous()) {
$smarty->assign('PAGEAUTHOR', get_string('anonymoususer'));
$smarty->assign('author', get_string('anonymoususer'));
if ($view->is_staff_or_admin_for_page()) {
$smarty->assign('realauthor', $view->display_author());
}
$smarty->assign('anonymous', TRUE);
}
else {
$smarty->assign('PAGEAUTHOR', $view->formatted_owner());
$smarty->assign('author', $view->display_author());
$smarty->assign('anonymous', FALSE);
}
$smarty->display('module:framework:matrix.tpl');
......@@ -27,7 +27,7 @@ $framework = param_integer('framework');
$option = param_integer('option');
$view = param_integer('view');
$action = param_alphanum('action', 'form');
form_validate(param_variable('sesskey', null));
$evidence = get_record('framework_evidence', 'framework', $framework, 'element', $option, 'view', $view);
if ($action == 'update') {
......@@ -71,6 +71,7 @@ if ($action == 'update') {
$data = (object) array('id' => $id,
'class' => $class,
'view' => $view,
'completed' => 0,
'option' => $option
);
json_reply(false, array('message' => $message, 'data' => $data));
......@@ -81,17 +82,25 @@ else if ($action == 'evidence') {
if (!$evidence->id) {
// problem need to return error
}
$oldstate = $evidence->state;
$reviewer = null;
$assessment = param_alphanum('assessment', 0);
if (Framework::EVIDENCE_COMPLETED === (int) $assessment) {
$reviewer = $USER->get('id');
}
$id = Framework::save_evidence($evidence->id, null, null, null, $evidence->annotation, $assessment, $USER->get('id'));
$message = get_string('matrixpointupdated', 'module.framework');
$completed = 0;
// If we are changing from completed to not completed
if ((Framework::EVIDENCE_COMPLETED === (int) $oldstate) && (Framework::EVIDENCE_COMPLETED !== (int) $assessment)) {
$completed = -1;
}
if (Framework::EVIDENCE_COMPLETED === (int) $assessment) {
$class = 'icon icon-circle completed';
$completed = 1;
}
else if (Framework::EVIDENCE_PARTIALCOMPLETE === (int) $assessment) {
$class = 'icon icon-adjust partial';
......@@ -106,6 +115,7 @@ else if ($action == 'evidence') {
$data = (object) array('id' => $id,
'class' => $class,
'view' => $view,
'completed' => $completed,
'option' => $option
);
json_reply(false, array('message' => $message, 'data' => $data));
......
......@@ -7,7 +7,11 @@
<h1 id="viewh1" class="page-header">
<span class="section-heading">{$name}</span>
</h1>
<p>{$description}</p>
<div class="with-heading text-small">
{include file=author.tpl}
</div>
<p>{$description|clean_html|safe}</p>
<p>{str tag="addpages" section="module.framework"}</p>
<table class="fullwidth table tablematrix" id="tablematrix">
<tr>
......@@ -32,13 +36,15 @@
</tr>
{foreach from=$standards key=sk item=standard}
<tr class="standard">
<td colspan="{$viewcount + 2}" title="{$standard->description}">{$standard->shortname} {$standard->name}</td>
<td colspan="{$viewcount + 2}">
<div>{$standard->name} <span class="hidden matrixtooltip">{$standard->shortname}<br>{$standard->description|clean_html|safe}</span></div>
</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 matrixtooltip">{$option->name}<br>{$option->description}</span></div></td>
<td>{if $completed[$option->id]}{$completed[$option->id]}{else}0{/if}</td>
<td class="code"><div>{$option->shortname} <span class="hidden matrixtooltip">{$option->name}<br>{$option->description|clean_html|safe}</span></div></td>
<td class="completedcount">{if $completed[$option->id]}{$completed[$option->id]}{else}0{/if}</td>
{foreach from=$views key=vk item=view}
<td class="mid"><span data-view="{$view->id}" data-option="{$option->id}"
{if $evidence[$framework][$option->id][$view->id].completed}
......
......@@ -14,6 +14,9 @@
<div class="detail">
<span class="lead text-small">{str tag=Views section=view}:</span>
{if $collection->views}
{if $collection->framework}
<a href="{$collection->fullurl}">{$collection->frameworkname}</a>,
{/if}
{foreach from=$collection->views item=view name=cviews}
<a href="{$view->fullurl}" class="inner-link">{$view->title}</a>{if !$.foreach.cviews.last}, {/if}
{/foreach}
......
......@@ -57,6 +57,7 @@ Scenario: Installing framework module and activating for an institution
# Testing the collection navigation and matrix carousel
And I follow "CollA"
And I should see "You are on page 1/9"
And I should see "by Admin User (admin)"
And I press "Next" in the "table#tablematrix" "css_element"
Then I should see "PageF"
And I press "Prev" in the "table#tablematrix" "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