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

OO-2617: pass a synthetic user request to the high score by reload from the SCORM itself

parent 3f642cd4
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ highscore.further=plus
highscore.histogram=Histogramme
highscore.listing=Liste des meilleurs r\u00E9sultats
highscore.podium=Podium
highscore.position=Titre des congratulations
highscore.position=Titre avec congratulations
highscore.position.congratulation=F\u00E9licitations
highscore.position.inrelation={0} participants ont obtenu moins de points que vous\!
highscore.position.yourposition=Vous \u00EAtes en {0} position.
......@@ -30,7 +30,7 @@ highscore.tablesize=Nombre des meilleurs utilisateurs
highscore.title=HighScore
highscore.total=Total
highscore.unavail=pas occup\u00E9
highscore.void=s
highscore.void=
integerelement.noint=Votre entr\u00E9e n'est pas un nombre. Choisissez un nombre entre 1 et 100000.
integerelement.toobig=Votre entr\u00E9e est trop grande. Choisissez un nombre entre 1 et 100000.
integerelement.toosmall=Votre entr\u00E9e est trop petite. Choisissez un nombre entre 1 et 100000.
......
......@@ -43,10 +43,12 @@ import org.olat.core.gui.control.controller.BasicController;
import org.olat.core.gui.control.generic.iframe.DeliveryOptions;
import org.olat.core.gui.control.generic.messages.MessageController;
import org.olat.core.gui.control.generic.messages.MessageUIFactory;
import org.olat.core.gui.util.SyntheticUserRequest;
import org.olat.core.logging.AssertException;
import org.olat.core.util.CodeHelper;
import org.olat.core.util.Formatter;
import org.olat.core.util.StringHelper;
import org.olat.core.util.UserSession;
import org.olat.core.util.Util;
import org.olat.core.util.event.GenericEventListener;
import org.olat.course.assessment.AssessmentHelper;
......@@ -97,6 +99,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
private boolean isAssessable;
private String assessableType;
private DeliveryOptions deliveryOptions;
private final UserSession userSession;//need for high score
/**
* Use this constructor to launch a CP via Repository reference key set in
......@@ -119,6 +122,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
this.userCourseEnv = userCourseEnv;
this.config = config;
this.scormNode = scormNode;
userSession = ureq.getUserSession();
deliveryOptions = (DeliveryOptions)config.get(ScormEditController.CONFIG_DELIVERY_OPTIONS);
addLoggingResourceable(LoggingResourceable.wrap(scormNode));
......@@ -249,6 +253,9 @@ public class ScormRunController extends BasicController implements ScormAPICallb
}
startPage.contextPut("attempts", scormNode.getUserAttempts(userCourseEnv));
if(ureq == null) {// High score need one
ureq = new SyntheticUserRequest(getIdentity(), getLocale(), userSession);
}
HighScoreRunController highScoreCtr = new HighScoreRunController(ureq, getWindowControl(), userCourseEnv, scormNode);
if (highScoreCtr.isViewHighscore()) {
Component highScoreComponent = highScoreCtr.getInitialComponent();
......@@ -357,6 +364,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
* @see org.olat.modules.scorm.ScormAPICallback#lmsCommit(java.lang.String,
* java.util.Properties)
*/
@Override
public void lmsCommit(String olatSahsId, Properties scoreProp, Properties lessonStatusProp) {
//
}
......@@ -365,6 +373,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
* @see org.olat.modules.scorm.ScormAPICallback#lmsFinish(java.lang.String,
* java.util.Properties)
*/
@Override
public void lmsFinish(String olatSahsId, Properties scoreProp, Properties lessonStatusProp) {
if (config.getBooleanSafe(ScormEditController.CONFIG_CLOSE_ON_FINISH, false)) {
doStartPage(null);
......@@ -390,6 +399,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
/**
* @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
*/
@Override
protected void doDispose() {
//
}
......
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