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

OO-3432: load the auto save plugin in the preview tab for essay

parent c61075a1
No related branches found
No related tags found
No related merge requests found
...@@ -76,10 +76,10 @@ public class AssessmentItemComponentRenderer extends AssessmentObjectComponentRe ...@@ -76,10 +76,10 @@ public class AssessmentItemComponentRenderer extends AssessmentObjectComponentRe
renderTerminated(sb, translator); renderTerminated(sb, translator);
} else { } else {
/* Look up most recent event */ /* Look up most recent event */
final CandidateEvent latestEvent = candidateSessionContext.getLastEvent();// assertSessionEntered(candidateSession); final CandidateEvent latestEvent = candidateSessionContext.getLastEvent();
/* Load the ItemSessionState */ /* Load the ItemSessionState */
final ItemSessionState itemSessionState = cmp.getItemSessionController().getItemSessionState();// candidateDataService.loadItemSessionState(latestEvent); final ItemSessionState itemSessionState = cmp.getItemSessionController().getItemSessionState();
/* Touch the session's duration state if appropriate */ /* Touch the session's duration state if appropriate */
if (itemSessionState.isEntered() && !itemSessionState.isEnded() && !itemSessionState.isSuspended()) { if (itemSessionState.isEntered() && !itemSessionState.isEnded() && !itemSessionState.isSuspended()) {
...@@ -162,7 +162,7 @@ public class AssessmentItemComponentRenderer extends AssessmentObjectComponentRe ...@@ -162,7 +162,7 @@ public class AssessmentItemComponentRenderer extends AssessmentObjectComponentRe
sb.append("<h4 class='itemTitle'>"); sb.append("<h4 class='itemTitle'>");
renderItemStatus(renderer, sb, itemSessionState, translator); renderItemStatus(renderer, sb, itemSessionState, translator);
sb.append(StringHelper.escapeHtml(assessmentItem.getTitle())).append("</h4>") sb.append(StringHelper.escapeHtml(assessmentItem.getTitle())).append("</h4>")
.append("<div id='itemBody' class='clearfix'>"); .append("<div id='itemBody' class='o_qti_item_body clearfix'>");
//TODO prompt //TODO prompt
......
...@@ -27,6 +27,7 @@ import java.util.Map; ...@@ -27,6 +27,7 @@ import java.util.Map;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent;
import org.olat.core.gui.components.velocity.VelocityContainer; 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;
...@@ -74,7 +75,14 @@ public class AssessmentItemPreviewController extends BasicController { ...@@ -74,7 +75,14 @@ public class AssessmentItemPreviewController extends BasicController {
mainVC = createVelocityContainer("assessment_item_preview"); mainVC = createVelocityContainer("assessment_item_preview");
mainVC.contextPut("outcomes", new ArrayList<>()); mainVC.contextPut("outcomes", new ArrayList<>());
mainVC.contextPut("responses", new ArrayList<>()); mainVC.contextPut("responses", new ArrayList<>());
mainVC.contextPut("showOutcomes", new Boolean(showOutcomes)); mainVC.contextPut("showOutcomes", Boolean.valueOf(showOutcomes));
String[] jss = new String[] {
"js/jquery/qti/jquery.qtiAutosave.js"
};
JSAndCSSComponent js = new JSAndCSSComponent("js", jss, null);
mainVC.put("js", js);
putInitialPanel(mainVC); putInitialPanel(mainVC);
} }
...@@ -110,10 +118,10 @@ public class AssessmentItemPreviewController extends BasicController { ...@@ -110,10 +118,10 @@ public class AssessmentItemPreviewController extends BasicController {
protected void event(UserRequest ureq, Component source, Event event) { protected void event(UserRequest ureq, Component source, Event event) {
if("show".equals(event.getCommand())) { if("show".equals(event.getCommand())) {
showOutcomes = true; showOutcomes = true;
ureq.getUserSession().putEntryInNonClearedStore(DEBUG_OUTCOMES, new Boolean(showOutcomes)); ureq.getUserSession().putEntryInNonClearedStore(DEBUG_OUTCOMES, Boolean.valueOf(showOutcomes));
} else if("hide".equals(event.getCommand())) { } else if("hide".equals(event.getCommand())) {
showOutcomes = false; showOutcomes = false;
ureq.getUserSession().putEntryInNonClearedStore(DEBUG_OUTCOMES, new Boolean(showOutcomes)); ureq.getUserSession().putEntryInNonClearedStore(DEBUG_OUTCOMES, Boolean.valueOf(showOutcomes));
} }
} }
...@@ -129,7 +137,7 @@ public class AssessmentItemPreviewController extends BasicController { ...@@ -129,7 +137,7 @@ public class AssessmentItemPreviewController extends BasicController {
} }
Collections.sort(responses); Collections.sort(responses);
mainVC.contextPut("responses", responses); mainVC.contextPut("responses", responses);
mainVC.contextPut("showOutcomes", new Boolean(showOutcomes)); mainVC.contextPut("showOutcomes", Boolean.valueOf(showOutcomes));
mainVC.setDirty(true); mainVC.setDirty(true);
} }
...@@ -143,7 +151,7 @@ public class AssessmentItemPreviewController extends BasicController { ...@@ -143,7 +151,7 @@ public class AssessmentItemPreviewController extends BasicController {
} }
Collections.sort(outcomes); Collections.sort(outcomes);
mainVC.contextPut("outcomes", outcomes); mainVC.contextPut("outcomes", outcomes);
mainVC.contextPut("showOutcomes", new Boolean(showOutcomes)); mainVC.contextPut("showOutcomes", Boolean.valueOf(showOutcomes));
mainVC.setDirty(true); mainVC.setDirty(true);
} }
} }
......
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