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

Merge branch 'OpenOLAT_14.0' of...

Merge branch 'OpenOLAT_14.0' of ssh://srosse@office.frentix.com/home/srosse/repositories/OpenOLAT.git into OpenOLAT_14.0
parents 36e256ca 07a5b8f1
No related branches found
No related tags found
No related merge requests found
Showing with 78 additions and 83 deletions
......@@ -532,9 +532,7 @@ public class MSCourseNode extends AbstractAccessableCourseNode implements Persis
@Override
public boolean hasResultsDetails() {
ModuleConfiguration config = getModuleConfiguration();
String scoreConfig = config.getStringValue(CONFIG_KEY_SCORE);
return CONFIG_VALUE_SCORE_EVAL_FORM_SUM.equals(scoreConfig) || CONFIG_VALUE_SCORE_EVAL_FORM_AVG.equals(scoreConfig);
return getModuleConfiguration().getBooleanSafe(CONFIG_KEY_EVAL_FORM_ENABLED);
}
@Override
......
......@@ -525,6 +525,11 @@ public class MSConfigController extends FormBasicController {
}
private void doCalculateMinMax() {
if (formEntry == null) {
formMinMax = MinMax.of(Float.valueOf(0), Float.valueOf(0));
return;
};
String scoreKey = scoreEl != null && scoreEl.isOneSelected()
? scoreEl.getSelectedKey()
: config.getStringValue(MSCourseNode.CONFIG_KEY_SCORE);
......
......@@ -248,12 +248,11 @@ public class MSCourseNodeRunController extends BasicController implements Activa
myContent.put("download", download);
}
}
}
if (courseNode.hasResultsDetails()) {
detailsCtrl = courseNode.getResultDetailsController(ureq, getWindowControl(), userCourseEnv);
listenTo(detailsCtrl);
myContent.put("details", detailsCtrl.getInitialComponent());
if (courseNode.hasResultsDetails()) {
detailsCtrl = courseNode.getResultDetailsController(ureq, getWindowControl(), userCourseEnv);
listenTo(detailsCtrl);
myContent.put("details", detailsCtrl.getInitialComponent());
}
}
}
......
......@@ -24,14 +24,10 @@ import java.util.List;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.controller.BasicController;
import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController;
import org.olat.core.id.Identity;
import org.olat.core.util.StringHelper;
import org.olat.course.assessment.AssessmentHelper;
......@@ -57,9 +53,7 @@ import org.springframework.beans.factory.annotation.Autowired;
public class MSResultDetailsController extends BasicController {
private final VelocityContainer mainVC;
private final Link openLink;
private CloseableModalController cmc;
private EvaluationFormExecutionController formCtrl;
private EvaluationFormSession session;
......@@ -70,6 +64,8 @@ public class MSResultDetailsController extends BasicController {
public MSResultDetailsController(UserRequest ureq, WindowControl wControl,
UserCourseEnvironment assessedUserCourseEnv, MSCourseNode msCourseNode) {
super(ureq, wControl);
mainVC = createVelocityContainer("result_details");
ModuleConfiguration config = msCourseNode.getModuleConfiguration();
RepositoryEntry formEntry = MSCourseNode.getEvaluationForm(config);
......@@ -79,26 +75,33 @@ public class MSResultDetailsController extends BasicController {
UserNodeAuditManager auditManager = assessedUserCourseEnv.getCourseEnvironment().getAuditManager();
AuditEnv auditEnv = AuditEnv.of(auditManager , msCourseNode, assessedIdentity, getIdentity(), Role.coach);
session = msService.getOrCreateSession(formEntry, ores, nodeIdent, assessedIdentity, auditEnv);
List<RubricStatistic> statistics = msService.getRubricStatistics(session);
String scoreConfig = config.getStringValue(MSCourseNode.CONFIG_KEY_SCORE);
String scaleConfig = config.getStringValue(MSCourseNode.CONFIG_KEY_EVAL_FORM_SCALE);
float scale = Float.parseFloat(scaleConfig);
List<RubricWrapper> rubricWrappers = new ArrayList<>(statistics.size());
for (int i = 0; i < statistics.size(); i++) {
RubricStatistic statistic = statistics.get(i);
String name = getName(statistic.getRubric(), i+1);
String value = getValue(statistic, scoreConfig, scale);
RubricWrapper rubricWrapper = new RubricWrapper(name, value);
rubricWrappers.add(rubricWrapper);
boolean pointsFromEvaluationForm = MSCourseNode.CONFIG_VALUE_SCORE_EVAL_FORM_SUM.equals(scoreConfig)
|| MSCourseNode.CONFIG_VALUE_SCORE_EVAL_FORM_AVG.equals(scoreConfig);
if (pointsFromEvaluationForm) {
String scaleConfig = config.getStringValue(MSCourseNode.CONFIG_KEY_EVAL_FORM_SCALE);
float scale = Float.parseFloat(scaleConfig);
List<RubricStatistic> statistics = msService.getRubricStatistics(session);
List<RubricWrapper> rubricWrappers = new ArrayList<>(statistics.size());
for (int i = 0; i < statistics.size(); i++) {
RubricStatistic statistic = statistics.get(i);
String name = getName(statistic.getRubric(), i+1);
String value = getValue(statistic, scoreConfig, scale);
RubricWrapper rubricWrapper = new RubricWrapper(name, value);
rubricWrappers.add(rubricWrapper);
}
mainVC.contextPut("rubrics", rubricWrappers);
}
mainVC = createVelocityContainer("result_details");
mainVC.contextPut("rubrics", rubricWrappers);
openLink = LinkFactory.createButton("result.details.open", mainVC, this);
putInitialPanel(mainVC);
formCtrl = new EvaluationFormExecutionController(ureq, getWindowControl(), session, true, false);
listenTo(formCtrl);
mainVC.put("evaluationForm", formCtrl.getInitialComponent());
putInitialPanel(mainVC);
}
private String getName(Rubric rubric, int index) {
......@@ -128,40 +131,10 @@ public class MSResultDetailsController extends BasicController {
}
return AssessmentHelper.getRoundedScore(0f);
}
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == openLink) {
doOpenEvaluationForm(ureq);
}
}
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == formCtrl) {
cmc.deactivate();
cleanUp();
} else if (source == cmc) {
cleanUp();
}
super.event(ureq, source, event);
}
private void cleanUp() {
removeAsListenerAndDispose(formCtrl);
removeAsListenerAndDispose(cmc);
formCtrl = null;
cmc = null;
}
private void doOpenEvaluationForm(UserRequest ureq) {
formCtrl = new EvaluationFormExecutionController(ureq, getWindowControl(), session, true, false);
listenTo(formCtrl);
String title = translate("result.details.title");
cmc = new CloseableModalController(getWindowControl(), "close", formCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
protected void event(UserRequest ureq, Component source, Event event) {
//
}
@Override
......
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">$r.translate("result.details.title")</h4>
#if($r.isNotNull($rubrics))
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">$r.translate("result.details.title")</h4>
</div>
<table class="table">
<tbody>
#foreach($rubric in $rubrics)
<tr>
<th>$rubric.getName()</th>
<td>$rubric.getValue()</td>
</tr>
#end
</tbody>
</table>
</div>
<table class="table">
<tbody>
#foreach($rubric in $rubrics)
<tr>
<th>$rubric.getName()</th>
<td>$rubric.getValue()</td>
</tr>
#end
</tbody>
</table>
</div>
<div class="o_button_group">
$r.render("result.details.open")
</div>
\ No newline at end of file
#end
#if($r.available("evaluationForm"))
<div class="panel panel-default o_disclaimer">
<div class="panel-heading" data-toggle="collapse" data-target="#collapseForm">
<h4 class="panel-title">
<i id="collapseFormToggler" class="o_icon o_icon-fw o_icon_close_togglebox"> </i>
$r.translate("result.details.form")
</h4>
</div>
<div id="collapseForm" class="panel-collapse collapse in"><div class="panel-body">
$r.render("evaluationForm")
</div></div>
</div>
<script>
/* <![CDATA[ */
jQuery('#collapseForm').on('hide.bs.collapse', function () {
jQuery('#collapseFormToggler').removeClass('o_icon_close_togglebox').addClass('o_icon_open_togglebox');
})
jQuery('#collapseForm').on('show.bs.collapse', function () {
jQuery('#collapseFormToggler').removeClass('o_icon_open_togglebox').addClass('o_icon_close_togglebox');
})
/* ]]> */
</script>
#end
\ No newline at end of file
......@@ -52,7 +52,7 @@ passed.nopassed=Information nicht verf\u00FCgbar
passed.title=Ergebnis
passed.yes=Bestanden
passed.yourpassed=Status
result.details.open=Details anzeigen
result.details.form=Beurteilungsformular
result.details.score=Punktzahl in Rubrik {0}
result.details.title=Rubrik-Bewertungen
segment.all=Alle Teilnehmer
......@@ -78,7 +78,7 @@ tool.stats.sliders.enabled=Fragen anzeigen
tool.stats.table.footer=Durchschnitt
tool.stats.table.title.blank=
tool.stats.table.title.slider=F{0}.{1}
tool.stats.table.title.rubric=R{0}
tool.stats.table.title.=R{0}
tool.stats.table.title.username=Benutzername
tool.stats.table.title.total=Total
warn.nodedelete=Achtung\: Alle bisher angefallenen Daten dieses Kursbausteines werden gel\u00F6scht.
......@@ -52,7 +52,7 @@ passed.nopassed=Information not available
passed.title=Result
passed.yes=Passed
passed.yourpassed=Status
result.details.open=Open details
result.details.form=Assessment form
result.details.score=Score in rubric {0}
result.details.title=Rubric assessments
segment.all=All participants
......
......@@ -51,7 +51,6 @@ passed.nopassed=Information non disponible
passed.title=R\u00E9sultat
passed.yes=Oui
passed.yourpassed=Statut
result.details.open=Afficher les d\u00E9tails
result.details.score=Nombre de points de la rubrique {0}
result.details.title=Evaluation des rubriques
score.max=Maximum de points
......
......@@ -51,7 +51,6 @@ passed.nopassed=Informa\u00E7\u00E3o n\u00E3o dispon\u00EDvel
passed.title=Passou
passed.yes=Passou
passed.yourpassed=Voc\u00EA passou
result.details.open=Abrir detalhes
result.details.score=Pontua\u00E7\u00E3o na rubrica {0}
result.details.title=Avalia\u00E7\u00F5es de Rubrica
score.max=Pontua\u00E7\u00E3o m\u00E1xima
......
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