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

OO-2290: if the test cannot be found, show a message instead of a red screen

parent c6af109e
No related branches found
No related tags found
No related merge requests found
......@@ -123,10 +123,16 @@ public class IQManager implements UserDataDeletable {
// -- VERY RARE CASE -- 1) qti is open in an editor session right now on the screen (or session on the way to timeout)
// -- 99% of cases -- 2) qti is ready to be run as test/survey
String repositorySoftkey = (String) moduleConfiguration.get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftkey, true);
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(re.getOlatResource(), null)){
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftkey, false);
if(re == null) {
log.error("The test repository entry with this soft key could not be found: " + repositorySoftkey);
Translator translator = Util.createPackageTranslator(this.getClass(), ureq.getLocale());
//so this resource is locked, let's find out who locked it
String title = translator.translate("error.test.deleted.title");
String msg = translator.translate("error.test.deleted.msg");
return MessageUIFactory.createInfoMessage(ureq, wControl, title, msg);
} else if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(re.getOlatResource(), null)){
Translator translator = Util.createPackageTranslator(this.getClass(), ureq.getLocale());
//so this resource is locked, let's find out who locked it
LockResult lockResult = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(re.getOlatResource(), ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockResult.getOwner());
return MessageUIFactory.createInfoMessage(ureq, wControl, translator.translate("status.currently.locked.title"),
......
......@@ -23,6 +23,8 @@ confirmCancel=Wollen Sie wirklich abbrechen? Es werden keine Daten gespeichert\!
confirmSubmit=Wollen Sie wirklich abschliessen?
confirmSuspend=Wollen Sie wirklich unterbrechen?
couldNotDisplayItem=Die Frage ist geschlossen und kann daher nicht mehr angezeigt werden.
error.test.deleted.title=Fehlende Test
error.test.deleted.msg=Der Test wurde gel\u00F6scht oder konnte nicht gefunden werden.
itemclosed=Frage geschlossen
noMaxScore=Kein Maximum
question=Frage
......
......@@ -24,6 +24,8 @@ confirmCancel=Do you really want to cancel? No data will be saved\!
confirmSubmit=Do you really want to submit?
confirmSuspend=Do you really want to suspend?
couldNotDisplayItem=This question is closed and can therefore not be displayed anymore.
error.test.deleted.title=Missing Test
error.test.deleted.msg=The Testwas deleted or it cannot be found.
itemclosed=Question closed
noMaxScore=No maximum
qti.marker.title={0} solution attempt(s), not marked
......
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