diff --git a/htdocs/artefact/peerassessment/blocktype/peerassessment/lib.php b/htdocs/artefact/peerassessment/blocktype/peerassessment/lib.php index 0a95e2941ef6c3f586d065d66c57c91a060c3150..616df69b0b34275b74969eb71dde73112469f8be 100644 --- a/htdocs/artefact/peerassessment/blocktype/peerassessment/lib.php +++ b/htdocs/artefact/peerassessment/blocktype/peerassessment/lib.php @@ -43,7 +43,7 @@ class PluginBlocktypePeerassessment extends MaharaCoreBlocktype { } public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) { - global $USER; + global $USER, $exporter; $configdata = $instance->get('configdata'); $instructions = false; @@ -76,6 +76,7 @@ class PluginBlocktypePeerassessment extends MaharaCoreBlocktype { $smarty = smarty_core(); $smarty->assign('blockid', $instance->get('id')); + $smarty->assign('exporter', ($exporter ? true : false)); $smarty->assign('instructions', $instructions); $smarty->assign('allowfeedback', $feedback->canedit && !$versioning); $smarty->assign('addassessmentfeedbackform', pieform($feedbackform)); diff --git a/htdocs/artefact/peerassessment/lib.php b/htdocs/artefact/peerassessment/lib.php index 213a4c77707a6cecee515de26c2c2de0ef804566..f656566fb73faf0c641fe25dcf6f432e3a44f228 100644 --- a/htdocs/artefact/peerassessment/lib.php +++ b/htdocs/artefact/peerassessment/lib.php @@ -99,6 +99,22 @@ class PluginArtefactPeerassessment extends PluginArtefact { WHERE artefact IN (' . join(',', $artefacts). ')')) { $artefacts = array_merge($artefacts, $attachments); } + if ($embeds = get_column_sql(" + SELECT afe.fileid + FROM {artefact_file_embedded} afe + JOIN {artefact_peer_assessment} apa ON apa.assessment = afe.resourceid + WHERE afe.resourcetype IN (?) + AND apa.view IN (" . join(',', array_map('intval', $viewids)) . ") + UNION + SELECT afe.fileid + FROM {artefact_file_embedded} afe + JOIN {artefact_peer_assessment} apa ON apa.block = afe.resourceid + WHERE afe.resourcetype in(?) + AND apa.view IN (" . join(',', array_map('intval', $viewids)) . ")" + , array('assessment', 'peerinstruction'))) { + $artefacts = array_merge($artefacts, $embeds); + } + return $artefacts; } diff --git a/htdocs/theme/raw/plugintype/artefact/peerassessment/blocktype/peerassessment/templates/peerassessment.tpl b/htdocs/theme/raw/plugintype/artefact/peerassessment/blocktype/peerassessment/templates/peerassessment.tpl index 0e20b935ef2bc1a4a294d45f513afab48d8d1dd5..4ac3943f6716533b0bfcd8c1b77730b89148e347 100644 --- a/htdocs/theme/raw/plugintype/artefact/peerassessment/blocktype/peerassessment/templates/peerassessment.tpl +++ b/htdocs/theme/raw/plugintype/artefact/peerassessment/blocktype/peerassessment/templates/peerassessment.tpl @@ -7,6 +7,13 @@ {str tag=addpeerassessment section=blocktype.peerassessment/peerassessment} + {elseif $exporter} + {if $instructions} +
{$viewdescription|clean_html|safe}
-{$viewinstructions|clean_html|safe}
+{if $viewinstructions} +