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

Merge remote-tracking branch 'origin/OpenOLAT_12.5' into OpenOLAT_13.2

parents ec4bee46 d8a916af
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,7 @@ import org.olat.ims.qti21.QTI21Service; ...@@ -70,6 +70,7 @@ import org.olat.ims.qti21.QTI21Service;
import org.olat.ims.qti21.model.InMemoryOutcomeListener; import org.olat.ims.qti21.model.InMemoryOutcomeListener;
import org.olat.ims.qti21.ui.AssessmentTestDisplayController; import org.olat.ims.qti21.ui.AssessmentTestDisplayController;
import org.olat.ims.qti21.ui.QTI21OverrideOptions; import org.olat.ims.qti21.ui.QTI21OverrideOptions;
import org.olat.ims.qti21.ui.event.RestartEvent;
import org.olat.modules.ModuleConfiguration; import org.olat.modules.ModuleConfiguration;
import org.olat.modules.iq.IQManager; import org.olat.modules.iq.IQManager;
import org.olat.modules.iq.IQPreviewSecurityCallback; import org.olat.modules.iq.IQPreviewSecurityCallback;
...@@ -326,6 +327,12 @@ public class IQConfigurationController extends BasicController { ...@@ -326,6 +327,12 @@ public class IQConfigurationController extends BasicController {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) { if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT); fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
} }
} else if(source == previewQTI21Ctrl) {
if(event instanceof RestartEvent) {
stackPanel.popContent();
cleanUpQti21PreviewSession();
doPreview(urequest);
}
} }
} }
...@@ -383,10 +390,10 @@ public class IQConfigurationController extends BasicController { ...@@ -383,10 +390,10 @@ public class IQConfigurationController extends BasicController {
private void doPreview(UserRequest ureq) { private void doPreview(UserRequest ureq) {
removeAsListenerAndDispose(previewLayoutCtr); removeAsListenerAndDispose(previewLayoutCtr);
removeAsListenerAndDispose(previewQTI21Ctrl);
RepositoryEntry re = getIQReference(); RepositoryEntry re = getIQReference();
if(re != null) { if(re != null) {
Controller previewController;
if(QTIResourceTypeModule.isOnyxTest(re.getOlatResource())) { if(QTIResourceTypeModule.isOnyxTest(re.getOlatResource())) {
showError("error.onyx"); showError("error.onyx");
} else if(ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) { } else if(ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
...@@ -402,7 +409,7 @@ public class IQConfigurationController extends BasicController { ...@@ -402,7 +409,7 @@ public class IQConfigurationController extends BasicController {
stackPanel.pushController(translate("preview"), previewQTI21Ctrl); stackPanel.pushController(translate("preview"), previewQTI21Ctrl);
} else { } else {
long courseResId = course.getResourceableId().longValue(); long courseResId = course.getResourceableId().longValue();
previewController = iqManager.createIQDisplayController(moduleConfiguration, new IQPreviewSecurityCallback(), ureq, getWindowControl(), courseResId, courseNode.getIdent(), null); Controller previewController = iqManager.createIQDisplayController(moduleConfiguration, new IQPreviewSecurityCallback(), ureq, getWindowControl(), courseResId, courseNode.getIdent(), null);
previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewController); previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewController);
stackPanel.pushController(translate("preview"), previewLayoutCtr); stackPanel.pushController(translate("preview"), previewLayoutCtr);
} }
......
...@@ -1797,6 +1797,7 @@ public class AssessmentTestDisplayController extends BasicController implements ...@@ -1797,6 +1797,7 @@ public class AssessmentTestDisplayController extends BasicController implements
private AssessmentTestTimerFormItem timerEl; private AssessmentTestTimerFormItem timerEl;
private ProgressBarItem scoreProgress, questionProgress; private ProgressBarItem scoreProgress, questionProgress;
private FormLink endTestPartButton, closeTestButton, cancelTestButton, suspendTestButton, closeResultsButton; private FormLink endTestPartButton, closeTestButton, cancelTestButton, suspendTestButton, closeResultsButton;
private FormLink restartTest;
private String menuWidth; private String menuWidth;
private boolean resultsVisible = false; private boolean resultsVisible = false;
...@@ -1866,6 +1867,11 @@ public class AssessmentTestDisplayController extends BasicController implements ...@@ -1866,6 +1867,11 @@ public class AssessmentTestDisplayController extends BasicController implements
closeResultsButton.setIconLeftCSS("o_icon o_icon-fw o_icon_qti_close_results"); closeResultsButton.setIconLeftCSS("o_icon o_icon-fw o_icon_qti_close_results");
closeResultsButton.setPrimary(true); closeResultsButton.setPrimary(true);
closeResultsButton.setVisible(false); closeResultsButton.setVisible(false);
restartTest = uifactory.addFormLink("restartTest", "assessment.test.restart.test", null, formLayout, Link.BUTTON);
restartTest.setTitle("assessment.test.restart.test.explanation");
restartTest.setElementCssClass("o_sel_restart_test");
restartTest.setVisible(false);
ResourceLocator fileResourceLocator = new PathResourceLocator(fUnzippedDirRoot.toPath()); ResourceLocator fileResourceLocator = new PathResourceLocator(fUnzippedDirRoot.toPath());
final ResourceLocator inputResourceLocator = final ResourceLocator inputResourceLocator =
...@@ -2050,6 +2056,8 @@ public class AssessmentTestDisplayController extends BasicController implements ...@@ -2050,6 +2056,8 @@ public class AssessmentTestDisplayController extends BasicController implements
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if(closeResultsButton == source) { if(closeResultsButton == source) {
doCloseResults(ureq); doCloseResults(ureq);
} else if(restartTest == source) {
restartTest(ureq);
} else if(!timeLimitBarrier(ureq)) { } else if(!timeLimitBarrier(ureq)) {
if(endTestPartButton == source) { if(endTestPartButton == source) {
doEndTestPart(ureq); doEndTestPart(ureq);
...@@ -2181,7 +2189,6 @@ public class AssessmentTestDisplayController extends BasicController implements ...@@ -2181,7 +2189,6 @@ public class AssessmentTestDisplayController extends BasicController implements
* @return true if the results are visible * @return true if the results are visible
*/ */
private boolean updateStatusAndResults(UserRequest ureq) { private boolean updateStatusAndResults(UserRequest ureq) {
//updateButtons();
resultsVisible = false; resultsVisible = false;
if(testSessionController.getTestSessionState().isEnded() if(testSessionController.getTestSessionState().isEnded()
&& deliveryOptions.isShowAssessmentResultsOnFinish() && deliveryOptions.isShowAssessmentResultsOnFinish()
...@@ -2189,11 +2196,15 @@ public class AssessmentTestDisplayController extends BasicController implements ...@@ -2189,11 +2196,15 @@ public class AssessmentTestDisplayController extends BasicController implements
&& !deliveryOptions.getAssessmentResultsOptions().none()) { && !deliveryOptions.getAssessmentResultsOptions().none()) {
removeAsListenerAndDispose(resultCtrl); removeAsListenerAndDispose(resultCtrl);
// show results in anonym mode to hide the user info table - user knows who he is (same as on test start page) // show results in anonym mode to hide the user info table - user knows who he is (same as on test start page)
AssessmentTestSession candidateSession = AssessmentTestDisplayController.this.getCandidateSession();
resultCtrl = new AssessmentResultController(ureq, getWindowControl(), assessedIdentity, true, resultCtrl = new AssessmentResultController(ureq, getWindowControl(), assessedIdentity, true,
AssessmentTestDisplayController.this.getCandidateSession(), candidateSession, fUnzippedDirRoot, mapperUri, null,
fUnzippedDirRoot, mapperUri, null, deliveryOptions.getAssessmentResultsOptions(), false, true, true); deliveryOptions.getAssessmentResultsOptions(), false, true, true);
listenTo(resultCtrl); listenTo(resultCtrl);
flc.add("qtiResults", resultCtrl.getInitialFormItem()); flc.add("qtiResults", resultCtrl.getInitialFormItem());
if(candidateSession.isAuthorMode()) {
restartTest.setVisible(true);
}
resultsVisible = true; resultsVisible = true;
} }
......
...@@ -58,7 +58,11 @@ ...@@ -58,7 +58,11 @@
<div id="o_main_center"> <div id="o_main_center">
<a id="o_content"></a> <a id="o_content"></a>
<div id="o_main_center_content" class="clearfix o_scrollblock"> <div id="o_main_center_content" class="clearfix o_scrollblock">
<div id="o_main_center_content_inner">$r.render("qtiResults")</div> <div id="o_main_center_content_inner">$r.render("qtiResults")
#if($r.visible("restartTest"))
<div class="o_button_group">$r.render("restartTest")</div>
#end
</div>
</div> </div>
</div> </div>
#elseif($r.visible("qtitree")) #elseif($r.visible("qtitree"))
......
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