Skip to content
Snippets Groups Projects
Commit 8a24ef83 authored by srosse's avatar srosse
Browse files

OO-1593: alternative layout for KPrim

parent 8cf97644
No related branches found
No related tags found
No related merge requests found
......@@ -552,10 +552,21 @@ public abstract class AssessmentObjectComponentRenderer extends DefaultComponent
}
private String getInteractionTemplate(QtiNode interaction) {
String interactionName = interaction.getClass().getSimpleName();
String interactionName;
switch(interaction.getQtiClassName()) {
case "matchInteraction": {
MatchInteraction matchInteraction = (MatchInteraction)interaction;
interactionName = interaction.getQtiClassName();
if(matchInteraction.getResponseIdentifier().toString().startsWith("KPRIM_")) {
interactionName += "_kprim";
}
break;
}
default: interactionName = interaction.getQtiClassName(); break;
}
String templateName = interactionName.substring(0, 1).toLowerCase().concat(interactionName.substring(1));
String page = velocity_root + "/" + templateName + ".html";
return page;
return velocity_root + "/" + templateName + ".html";
}
/*
......
#set($identifier = $r.toString($interaction.identifier))
#set($responseIdentifier = $r.toString($interaction.responseIdentifier))
#set($orderedSet1 = $r.getVisibleOrderedChoices($interaction,0))
#set($orderedSet2 = $r.getVisibleOrderedChoices($interaction,1))
<input name="qtiworks_presented_${responseIdentifier}" type="hidden" value="1"/>
<div class="$localName">
#if($interaction.getPrompt())
<div class="prompt">
$r.renderPrompt($interaction.getPrompt())
</div>
#end
#if($r.isInvalidResponse($interaction.responseIdentifier))
<div class="o_error badResponse">
Please complete this interaction as directed.
</div>
#end
<table class="table o_qti_item_kprim">
<thead>
<tr>
#foreach($choice2 in $orderedSet2)
<th class="o_qti_item_kprim_input">$r.renderFlowStatics($choice2.getFlowStatics())</th>
#end
<th class="o_qti_item_kprim_text"/>
</tr>
</thead>
<tbody>
#foreach($choice1 in $orderedSet1)
#set($set1Identifier = $r.toString($choice1.identifier))
<tr>
#foreach($choice2 in $orderedSet2)
#set($set2Identifier = $r.toString($choice2.identifier))
#set($responseValue = $set1Identifier + " " + $set2Identifier)
#set($responseChecked = $r.getResponseValue($interaction.responseIdentifier))
<td class="o_qti_item_kprim_input">
<input type="checkbox" name="qtiworks_response_${responseIdentifier}" value="${responseValue}" #if($r.valueContains($responseChecked,$responseValue)) checked #end #if($r.isItemSessionEnded()) disabled #end/>
</td>
#end
<td class="o_qti_item_kprim_text">$r.renderFlowStatics($choice1.getFlowStatics())</td>
</tr>
#end
</tbody>
</table>
#if($r.isItemSessionOpen())
<script type='text/javascript'>
QtiWorksRendering.registerMatchInteraction('$responseIdentifier', $interaction.maxAssociations,
{#foreach($choice1 in $orderedSet1) #if($foreach.count > 1),#end $choice1.identifier:$choice1.matchMax #end},
{#foreach($choice2 in $orderedSet2) #if($foreach.count > 1),#end $choice2.identifier:$choice2.matchMax #end}
);
</script>
#end
</div>
......@@ -10,6 +10,10 @@ td.o_qti_item_kprim_input, th.o_qti_item_kprim_input {
}
}
td.o_qti_item_kprim_text {
width: 80%;
}
/* space in menu between sections */
div.o_qti_menu_section, div.o_qti_menu_section_clickable, div.o_qti_menu_section_active {
margin-top: $padding-large-vertical;
......
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment