Skip to content
Snippets Groups Projects
Commit 7d08395f authored by srosse's avatar srosse
Browse files

OO-2822: latex formatting in QTI statistics and in question pool

parent 66759f92
No related branches found
No related tags found
No related merge requests found
Showing
with 34 additions and 22 deletions
...@@ -28,6 +28,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormBasicController; ...@@ -28,6 +28,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.Formatter;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.Util; import org.olat.core.util.Util;
import org.olat.core.util.filter.impl.NekoHTMLFilter; import org.olat.core.util.filter.impl.NekoHTMLFilter;
...@@ -134,9 +135,10 @@ public class QTI12MetadataController extends FormBasicController { ...@@ -134,9 +135,10 @@ public class QTI12MetadataController extends FormBasicController {
for(Response response:responses) { for(Response response:responses) {
String responseSummary = getResponseSummary(response); String responseSummary = getResponseSummary(response);
if(responseSummary != null) { if(responseSummary != null) {
boolean correct = response.isCorrect(); boolean correct = response.isCorrect();
String points = Float.toString(response.getPoints()); String points = Float.toString(response.getPoints());
ResponseAndPoints responseInfos = new ResponseAndPoints(responseSummary, points, correct); ResponseAndPoints responseInfos = new ResponseAndPoints(Formatter.formatLatexFormulas(responseSummary), points, correct);
responsesPoints.add(responseInfos); responsesPoints.add(responseInfos);
} }
} }
...@@ -154,7 +156,7 @@ public class QTI12MetadataController extends FormBasicController { ...@@ -154,7 +156,7 @@ public class QTI12MetadataController extends FormBasicController {
if(response.isCorrect()) { if(response.isCorrect()) {
String responseSummary = getResponseSummary(response); String responseSummary = getResponseSummary(response);
if(responseSummary != null) { if(responseSummary != null) {
correctResponseNames.add(responseSummary); correctResponseNames.add(Formatter.formatLatexFormulas(responseSummary));
} }
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<h3><i class="o_icon $series.itemCss""> </i> $title</h3> <h3><i class="o_icon $series.itemCss""> </i> $title</h3>
#if ($question && $question != "") #if ($question && $question != "")
<h4>$r.translate("chart.item")</h4> <h4>$r.translate("chart.item")</h4>
<div class="o_qti_statistics_question clearfix">$question</div> <div class="o_qti_statistics_question clearfix">$r.formatLatexFormulas($question)</div>
#end #end
<h4>$r.translate("fig.title")</h4> <h4>$r.translate("fig.title")</h4>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<strong>$responseInfo.label.</strong> <strong>$responseInfo.label.</strong>
#if($responseInfo.points) $r.translate("answer.points", $responseInfo.formattedPoints) #end #if($responseInfo.points) $r.translate("answer.points", $responseInfo.formattedPoints) #end
#if($responseInfo.wrongAnswersAvailable) #if($responseInfo.wrongAnswersAvailable)
<span class="o_qti_statistics_answer"><strong>$responseInfo.text</strong></span> <span class="o_qti_statistics_answer"><strong>$r.formatLatexFormulas($responseInfo.text)</strong></span>
<p class="o_qti_statistics_wrong_answer">#if($responseInfo.survey) <p class="o_qti_statistics_wrong_answer">#if($responseInfo.survey)
<i>$r.translate("fib.answer")</i> <i>$r.translate("fib.answer")</i>
#else #else
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#end #end
$responseInfo.formattedWrongAnswers</p> $responseInfo.formattedWrongAnswers</p>
#else #else
<span class="o_qti_statistics_answer">$responseInfo.text</span> <span class="o_qti_statistics_answer">$r.formatLatexFormulas($responseInfo.text)</span>
#end #end
</li> </li>
#end #end
......
...@@ -9,11 +9,10 @@ ...@@ -9,11 +9,10 @@
<h5>$r.translate("section"): $r.escapeHtml($sectionTitle)</h5> <h5>$r.translate("section"): $r.escapeHtml($sectionTitle)</h5>
#end #end
<h3><i class="o_icon $itemCss""> </i> $r.escapeHtml($title)</h3> <h3><i class="o_icon $itemCss""> </i> $r.escapeHtml($title)</h3>
#if ($question && $question != "") #if($r.isNotEmpty($question))
<h4>$r.translate("chart.item")</h4> <h4>$r.translate("chart.item")</h4>
<div class="o_qti_statistics_question clearfix">$r.escapeHtml($question)</div> <div class="o_qti_statistics_question clearfix">$r.escapeHtml($question)</div>
#end #end
<h4>$r.translate("fig.title")</h4> <h4>$r.translate("fig.title")</h4>
<table class="o_qti_statistics_figures"><tbody> <table class="o_qti_statistics_figures"><tbody>
#if($numOfParticipants) #if($numOfParticipants)
......
...@@ -23,8 +23,8 @@ import java.util.List; ...@@ -23,8 +23,8 @@ import java.util.List;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.Formatter;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.filter.FilterFactory;
import org.olat.ims.qti.statistics.model.StatisticsItem; import org.olat.ims.qti.statistics.model.StatisticsItem;
import org.olat.ims.qti21.model.statistics.ChoiceStatistics; import org.olat.ims.qti21.model.statistics.ChoiceStatistics;
import org.olat.ims.qti21.model.xml.AssessmentHtmlBuilder; import org.olat.ims.qti21.model.xml.AssessmentHtmlBuilder;
...@@ -65,7 +65,7 @@ public class HottextInteractionStatisticsController extends ChoiceInteractionSta ...@@ -65,7 +65,7 @@ public class HottextInteractionStatisticsController extends ChoiceInteractionSta
String text = choice.getLabel(); String text = choice.getLabel();
if(!StringHelper.containsNonWhitespace(text)) { if(!StringHelper.containsNonWhitespace(text)) {
text = new AssessmentHtmlBuilder().inlineStaticString(((Hottext)choice).getInlineStatics()); text = new AssessmentHtmlBuilder().inlineStaticString(((Hottext)choice).getInlineStatics());
text = FilterFactory.getHtmlTagsFilter().filter(text); text = Formatter.formatLatexFormulas(text);
} }
return text; return text;
} }
......
...@@ -29,8 +29,8 @@ import org.olat.core.gui.components.velocity.VelocityContainer; ...@@ -29,8 +29,8 @@ import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Event; import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.controller.BasicController; import org.olat.core.gui.control.controller.BasicController;
import org.olat.core.util.Formatter;
import org.olat.core.util.Util; import org.olat.core.util.Util;
import org.olat.core.util.filter.FilterFactory;
import org.olat.ims.qti.statistics.QTIType; import org.olat.ims.qti.statistics.QTIType;
import org.olat.ims.qti.statistics.ui.ResponseInfos; import org.olat.ims.qti.statistics.ui.ResponseInfos;
import org.olat.ims.qti.statistics.ui.Series; import org.olat.ims.qti.statistics.ui.Series;
...@@ -129,7 +129,7 @@ public class KPrimStatisticsController extends BasicController { ...@@ -129,7 +129,7 @@ public class KPrimStatisticsController extends BasicController {
for(SimpleAssociableChoice choice:fourMatchSet.getSimpleAssociableChoices()) { for(SimpleAssociableChoice choice:fourMatchSet.getSimpleAssociableChoices()) {
if(choice.getIdentifier().equals(choiceIdentifier)) { if(choice.getIdentifier().equals(choiceIdentifier)) {
String textFlow = assessmentHtmlBuilder.flowStaticString(choice.getFlowStatics()); String textFlow = assessmentHtmlBuilder.flowStaticString(choice.getFlowStatics());
text = FilterFactory.getHtmlTagAndDescapingFilter().filter(textFlow); text = Formatter.formatLatexFormulas(textFlow);
} }
} }
responseInfos.add(new ResponseInfos(label, text, null, correctRight, survey, true)); responseInfos.add(new ResponseInfos(label, text, null, correctRight, survey, true));
......
...@@ -236,6 +236,7 @@ public class MatchStatisticsController extends BasicController { ...@@ -236,6 +236,7 @@ public class MatchStatisticsController extends BasicController {
this.choice = choice; this.choice = choice;
this.choiceIdentifier = choice.getIdentifier(); this.choiceIdentifier = choice.getIdentifier();
summary = assessmentHtmlBuilder.flowStaticString(choice.getFlowStatics()); summary = assessmentHtmlBuilder.flowStaticString(choice.getFlowStatics());
} }
public Identifier getChoiceIdentifier() { public Identifier getChoiceIdentifier() {
......
...@@ -23,8 +23,8 @@ import java.util.List; ...@@ -23,8 +23,8 @@ import java.util.List;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.Formatter;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.filter.FilterFactory;
import org.olat.ims.qti.statistics.model.StatisticsItem; import org.olat.ims.qti.statistics.model.StatisticsItem;
import org.olat.ims.qti21.model.statistics.ChoiceStatistics; import org.olat.ims.qti21.model.statistics.ChoiceStatistics;
import org.olat.ims.qti21.model.xml.AssessmentHtmlBuilder; import org.olat.ims.qti21.model.xml.AssessmentHtmlBuilder;
...@@ -62,7 +62,7 @@ public class SimpleChoiceInteractionStatisticsController extends ChoiceInteracti ...@@ -62,7 +62,7 @@ public class SimpleChoiceInteractionStatisticsController extends ChoiceInteracti
String text = choice.getLabel(); String text = choice.getLabel();
if(!StringHelper.containsNonWhitespace(text)) { if(!StringHelper.containsNonWhitespace(text)) {
text = new AssessmentHtmlBuilder().flowStaticString(((SimpleChoice)choice).getFlowStatics()); text = new AssessmentHtmlBuilder().flowStaticString(((SimpleChoice)choice).getFlowStatics());
text = FilterFactory.getHtmlTagsFilter().filter(text); text = Formatter.formatLatexFormulas(text);
} }
return text; return text;
} }
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
<tr> <tr>
<th></th> <th></th>
#foreach($targetChoice in $targetChoices) #foreach($targetChoice in $targetChoices)
<th>${targetChoice.getSummary()} <th>$r.formatLatexFormulas(${targetChoice.getSummary()})</th>
#end #end
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
#foreach($sourceChoice in $sourceChoices) #foreach($sourceChoice in $sourceChoices)
<tr> <tr>
<th>${sourceChoice.getSummary()}</th> <th>$r.formatLatexFormulas(${sourceChoice.getSummary()})</th>
#foreach($targetChoice in $targetChoices) #foreach($targetChoice in $targetChoices)
<td> <td>
#set($scoreWrapper = $r.get("${sourceChoice.getChoiceIdentifier().toString()}-${targetChoice.getChoiceIdentifier().toString()}")) #set($scoreWrapper = $r.get("${sourceChoice.getChoiceIdentifier().toString()}-${targetChoice.getChoiceIdentifier().toString()}"))
......
...@@ -1071,6 +1071,16 @@ ul.testPartDrilldown { ...@@ -1071,6 +1071,16 @@ ul.testPartDrilldown {
margin-top: 0.5em; margin-top: 0.5em;
} }
/* Statistics */
.o_qti_statistics_answer {
background: #F5F5F5;
padding: 1px 2px;
width: 90%;
p {
display: inline-block;
}
}
/* Results reporting / detailed assessment results */ /* Results reporting / detailed assessment results */
......
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
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