Commit ac0aee9c authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic

Bug 1800421: Allow peer instructions for HTML export

Also allow embedded image export for Leap2A

This is for fixing points 2 and 3 on comment #3

behatnotneeded

Change-Id: I0f793c307b7cab978045881045722fd2150ded48
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit a86fb46a)
(cherry picked from commit dfd374da)
parent 2bec90d0
......@@ -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);
$smarty->assign('addassessmentfeedbackform', pieform($feedbackform));
......
......@@ -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;
}
......
......@@ -7,6 +7,13 @@
<span class="icon icon-plus" role="presentation" aria-hidden="true"></span>
{str tag=addpeerassessment section=blocktype.peerassessment/peerassessment}
</a>
{elseif $exporter}
{if $instructions}
<div>{str tag='instructions' section='view'}</div>
<div class="viewinstruction-export">
{$instructions|safe}
</div>
{/if}
{/if}
</div>
{/if}
......
......@@ -13,7 +13,12 @@
{/if}
<p id="view-description">{$viewdescription|clean_html|safe}</p>
<p id="view-instructions">{$viewinstructions|clean_html|safe}</p>
{if $viewinstructions}
<div>{str tag='instructions' section='view'}</div>
<div class="viewinstruction-export">
{$viewinstructions|clean_html|safe}
</div>
{/if}
{$view|safe}
......
......@@ -633,7 +633,12 @@ div.toolbarhtml {
background-color: $gray-lighter !important;
}
}
.viewinstruction-export {
border: 1px solid $card-border-color;
padding: 10px 15px;
margin-bottom: -1px; //remove double border
background-color: $gray-100 !important;
}
.releaseviewform {
position: relative;
top: 15px;
......
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