Skip to content
Snippets Groups Projects
Commit f5b45179 authored by gnaegi's avatar gnaegi
Browse files

Merge with 85a120db40e7e2f935a50addf36d0c2104fa58e4

parents 471ceec2 5dae949c
No related branches found
No related tags found
No related merge requests found
Showing
with 273 additions and 64 deletions
#Sat Oct 26 20:36:08 CEST 2013
#Wed Dec 04 16:40:06 CET 2013
Directory=Dossier
FileDeleteFailed=fichier/dossier <b>{0}</b> n'a pas pu \u00EAtre supprim\u00E9.
FileDeleted=Le fichier/dossier <b>{0}</b> a \u00E9t\u00E9 supprim\u00E9 avec succ\u00E8s.
......@@ -61,11 +61,13 @@ chelp.how11=Groupes du type $\:chelp.buddy, $\:chelp.learn et $\:chelp.right, da
chelp.how12=Vous deux dossiers personnels ($\:chelp.private et $\:chelp.public)
chelp.how13=Toutes les ressources didactiques du type $\:chelp.repResFol que vous poss\u00E9dez. Ceci ne concerne g\u00E9n\u00E9ralement que les auteurs de OLAT.
chelp.how2=En attendant, des applications diverses (p.ex. Macromedia Dreamweaver, Adobe Golive et InDesign) proposent la fonctionnalit\u00E9 WebDAV.
chelp.how21=Selon les applications, les fichiers peuvent \u00EAtre verrouill\u00E9s sur le serveur pendant le traitement. Les autres utilisateurs ne peuvent plus lire ou \u00E9craser les modifications du m\u00EAme fichier. Les fichiers verrouill\u00E9s sont marqu\u00E9s dans la vue Web d'OpenOLAT par une serrure.
chelp.how3=Pour atteindre un dossier sur OLAT via WebDAV, vous avez besoin de\:
chelp.how4=L'adresse (URL) de la ressource sur serveur\: employez l'URL, telle qu'elle est marqu\u00E9e sous les dossiers OLAT compatibles avec WebDAV.
chelp.how4a=Nom d'utilisateur\: Utilisez votre nom d'utilisateur OLAT (le nom qui s'affiche sur l'\u00E9cran en bas \u00E0 gauche).
chelp.how5=Mot de passe WebDAV\: utilisez votre mot de passe WebDav. Vous avez la possibilit\u00E9 de modifier votre mot de passe sous Page d'accueil -> WebDAV. Si vous avez un mot de passe OLAT, utilisez-le pour l'acc\u00E8s \u00E0 WebDAV.
chelp.how8=Connectez-vous maintenant gr\u00E2ce \u00E0 l'adresse URL indiqu\u00E9, le nom d'utilisateur et le mot de passe \u00E0 votre instance OLAT.
chelp.how8.win=Essayez, si possible, d'abord \u00E9tablir une connexion avec l'URL commence par https\://. Seulement si cela ne fonctionne pas, vous devez utiliser l'alternative par http\://. Cette derni\u00E8re devrait \u00EAtre n\u00E9cessaire sous Windows.
chelp.how81=Vous trouvez un guide \u00E9tape par \u00E9tape dans le manuel OLAT au chapitre "Utiliser WebDAV".
chelp.how9=Sur votre bureau s'ouvre un r\u00E9pertoire qui contient les sous-r\u00E9pertoires suivants\:
chelp.learn=<i>$org.olat.group.ui\:LearningGroup</i>
......@@ -160,6 +162,8 @@ unzip.alreadyexists=Un dossier avec le nom {0} existe d\u00E9j\u00E0. Vous avez
versions=Versions
versions.revisions=Versions
webdav.link=WebDAV Link
webdav.link.http=Pour le client natif sous Window, il est parfois plus facile d'utiliser ce
webdav.link.https=En principe, nous vous recommandons ce lien
zip=Zipper
zip.alreadyexists=Un fichier avec le nom {0} existe d\u00E9j\u00E0. Choisissez un autre diff\u00E9rent, svp.
zip.button=Zipper
......
......@@ -41,6 +41,7 @@ import org.olat.core.commons.services.webdav.WebDAVManager;
import org.olat.core.commons.services.webdav.WebDAVModule;
import org.olat.core.commons.services.webdav.WebDAVProvider;
import org.olat.core.commons.services.webdav.servlets.WebResourceRoot;
import org.olat.core.helpers.Settings;
import org.olat.core.id.Identity;
import org.olat.core.id.Roles;
import org.olat.core.id.User;
......@@ -247,9 +248,13 @@ public class WebDAVManagerImpl implements WebDAVManager {
// and cache them so that it doesn't have to
// prompt you again.
response.addHeader("WWW-Authenticate", "Basic realm=\"" + BASIC_AUTH_REALM + "\"");
String nonce = UUID.randomUUID().toString().replace("-", "");
response.addHeader("WWW-Authenticate", "Digest realm=\"" + BASIC_AUTH_REALM + "\", qop=\"auth\", nonce=\"" + nonce + "\"");
if(request.isSecure() || Settings.isJUnitTest()) {
response.addHeader("WWW-Authenticate", "Basic realm=\"" + BASIC_AUTH_REALM + "\"");
}
if(webdavModule.isDigestAuthenticationEnabled()) {
String nonce = UUID.randomUUID().toString().replace("-", "");
response.addHeader("WWW-Authenticate", "Digest realm=\"" + BASIC_AUTH_REALM + "\", qop=\"auth\", nonce=\"" + nonce + "\"");
}
response.setStatus(401);
return null;
}
......
#Wed Dec 04 16:36:37 CET 2013
admin.menu.title=WebDAV
admin.menu.title.alt=Acc\u00E8s WebDAV
admin.webdav.description=Gr\u00E2ce \u00E0 WebDAV, les dossiers OpenOLAT peuvent appara\u00EEtre sur votre bureau local et \u00EAtre utilis\u00E9s. Vous devez configurer cette fonction pour la rendre disponible \u00E0 tous les utilisateurs du syst\u00E8me. S'il vous pla\u00EEt lisez l'aide contextuelle pour plus d'informations.
chelp.webdav.digest=Pour utiliser WebDAV sous Windows directement, sans importer manuellement des certificats, il est n\u00E9cessaire d'utiliser WebDAV sans SSL. Dans ce cas, les fichiers sont transf\u00E9r\u00E9s en clair. Pour chiffrer le mot de passe transmis au server, le m\u00E9canisme d'authentification Digest doit \u00EAtre utilis\u00E9, sinon WebDAV ne peut pas \u00EAtre utilis\u00E9 sous Windows.
chelp.webdav.digest.disclaimer=Le cryptage de l'authentification Digest ne fournit pas de cryptographie forte et peut \u00EAtre craqu\u00E9 avec suffisamment de temps et d'efforts. Pour des exigences \u00E9lev\u00E9es de s\u00E9curit\u00E9, l'acc\u00E8s HTTPS avec le chiffrement SSL doit toujours \u00EAtre utilis\u00E9. Sous Windows, il faut malheureusement importer manuellement les certificats ou utiliser des programmes WebDAV d\u00E9di\u00E9s.
chelp.webdav.link=Ind\u00E9pendamment de la fonction WebDAV, cette option vous permet de d\u00E9cider si le lien WebDAV sera affich\u00E9 dans les dossiers ou non. Lorsque cette fonction est d\u00E9sactiv\u00E9e, WebDAV peut continuer \u00E0 \u00EAtre utilis\u00E9, seul le lien n'appara\u00EEtra pas.
chelp.webdav.module=Activez ou d\u00E9sactivez l'acc\u00E8s WebDAV l'\u00E9chelle du syst\u00E8me. Lorsque le module est activ\u00E9, tous les utilisateurs peuvent utiliser le syst\u00E8me OpenOLAT via WebDAV (recommand\u00E9).
chelp.webdav.more=Pour plus d'informations sur l'utilisation de WebDAV dans OpenOLAT\:
chelp.webdav.usage=Utilisation
chelp.webdavconfig.intro=Le module WebDAV peut \u00EAtre activ\u00E9e ou d\u00E9sactiv\u00E9e pour l'ensemble du syst\u00E8me OpenOLAT. Les configurations suivantes sont possibles\:
chelp.webdavconfig.title=Configuration du module WebDAV
core.webdav=WebDAV
help.hover.webdavconfig=Aide \u00E0 la configuration du module WebDAV
webdav.digest=Utilise l'authentification Digest pour l'acc\u00E8s HTTP
webdav.link=Montre les liens WebDAV
webdav.module=Acc\u00E8s WebDAV
webdav.on=on
......@@ -122,7 +122,7 @@ public class TabbedPaneRenderer implements ComponentRenderer {
public void renderHeaderIncludes(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderingState rstate) {
TabbedPane tp = (TabbedPane)source;
int cnt = tp.getTabCount();
if (cnt > 0) {
if (cnt > 0 && tp.getSelectedPane() < cnt) {
Component toRender = tp.getTabAt(tp.getSelectedPane());
// delegate header rendering to the selected pane
renderer.renderHeaderIncludes(sb, toRender, rstate);
......
#Sat Oct 26 20:38:40 CEST 2013
#Wed Dec 04 16:41:55 CET 2013
add.email=Ajouter
chelp.customizeMailTemplate.content=Sera remplac\u00E9 par le contenu r\u00E9el du courriel. Le texte est habituellement ajust\u00E9 \u00E0 la langue du destinataire.
chelp.customizeMailTemplate.footer=Sera remplac\u00E9 par le pied de page g\u00E9n\u00E9rique. Le pied de page est adapt\u00E9 \u00E0 la langue du destinataire et peut \u00EAtre adapt\u00E9 avec l'outil d'adaptation linguistique pour chaque langue. (Voir footer.no.userdata et footer.with.userdata du paquet org.olat.core.util.mail)
chelp.customizeMailTemplate.variables=Les variables suivantes peuvent figurer dans le mod\u00E8le\:
chelp.customizeMailTemplate1=Vous pouvez personnaliser ce mod\u00E8le de courriel.
chelp.mail-admin-template.title=Informations sur le mod\u00E8le de courriel
chelp.mail-admin.title=$\:mail.admin.title
......@@ -17,8 +20,8 @@ chelp.sendMail6=description du groupe
chelp.sendMail7=Liste des cours qui utilisent le groupe.
chelp.sendMail8=Liste des cours utilisant ce groupe.
contact.cp.from=Copie \u00E0 l'exp\u00E9diteur
footer.no.userdata=<p>Ce message a \u00E9t\u00E9 envoy\u00E9 automatiquement via la plateforme d'apprentissage OpenOLAT: {0}</p>
footer.with.userdata=<p>Expéditeur: {2} {3} ({0}), {4} {5}</p><p>Ce message a \u00E9t\u00E9 envoy\u00E9 via la plateforme d'apprentissage OpenOLAT: {1}</p>
footer.no.userdata=<p>Ce message a \u00E9t\u00E9 envoy\u00E9 automatiquement via la plateforme d'apprentissage OpenOLAT\: {0}</p>
footer.with.userdata=<p>Exp\u00E9diteur\: {2} {3} ({0}), {4} {5}</p><p>Ce message a \u00E9t\u00E9 envoy\u00E9 via la plateforme d'apprentissage OpenOLAT\: {1}</p>
help.hover.mail-templ=Aide pour l'utilisation de l'e-mail mod\u00E8le
mail.action.emtpy=S\u00E9lectionnez au moins une adresse e-mail pour d\u00E9clencher un effet.
mail.action.mark=Signaler
......
......@@ -56,6 +56,9 @@ import org.olat.course.nodes.AssessableCourseNode;
*/
public class ValidationStepForm extends StepFormBasicController {
private static final String[] userPropsToSearch = new String[]{ UserConstants.EMAIL, UserConstants.INSTITUTIONALEMAIL, UserConstants.INSTITUTIONALUSERIDENTIFIER };
private ValidDataModel validModel;
private ValidDataModel invalidModel;
private FlexiTableElement validTableEl;
......@@ -141,7 +144,19 @@ public class ValidationStepForm extends StepFormBasicController {
Identity identity = securityManager.findIdentityByName(assessedId);
if(identity != null) {
idToIdentityMap.put(assessedId, identity);
continue;
}
Map<String, String> userProperties = new HashMap<String,String>();
for(String prop : userPropsToSearch) {
userProperties.put(prop, assessedId);
List<Identity> identities = securityManager.getIdentitiesByPowerSearch(null, userProperties, false, null, null, null, null, null, null, null, null);
if(!identities.isEmpty()) {
idToIdentityMap.put(assessedId, identities.get(0));
break;
}
userProperties.clear();
}
}
return idToIdentityMap;
......
......@@ -31,6 +31,8 @@ package org.olat.course.condition.interpreter;
* @author Felix Jost
*/
public class ArgumentParseException extends RuntimeException {
private static final long serialVersionUID = 7135633046896613748L;
/**
* Errorcode if the function needs more arguments
*/
......
......@@ -40,8 +40,8 @@ import java.util.Stack;
public class ConditionExpression {
private String expressionString;
private String id;
private Stack errorStack;
private Map softReferences;
private Stack<Exception> errorStack;
private Map<String, Set<String>> softReferences;
public ConditionExpression(String idName, String expression) {
this(idName);
......@@ -50,8 +50,8 @@ public class ConditionExpression {
public ConditionExpression(String idName) {
this.id = idName;
errorStack = new Stack();
softReferences = new HashMap();
errorStack = new Stack<Exception>();
softReferences = new HashMap<>();
}
public String getId() {
......@@ -71,11 +71,11 @@ public class ConditionExpression {
}
public void addSoftReference(String category, String softReference) {
Set catSoftRefs;
Set<String> catSoftRefs;
if (softReferences.containsKey(category)) {
catSoftRefs = (HashSet) softReferences.get(category);
catSoftRefs = softReferences.get(category);
} else {
catSoftRefs = new HashSet();
catSoftRefs = new HashSet<String>();
}
catSoftRefs.add(softReference);
softReferences.put(category, catSoftRefs);
......@@ -84,7 +84,7 @@ public class ConditionExpression {
public Set<String> getSoftReferencesOf(String category) {
Set<String> catSoftRefs;
if (softReferences.containsKey(category)) {
catSoftRefs = (HashSet) softReferences.get(category);
catSoftRefs = softReferences.get(category);
} else {
catSoftRefs = new HashSet<String>();
}
......@@ -92,20 +92,19 @@ public class ConditionExpression {
}
public Exception[] getExceptions() {
Exception[] retVal = new Exception[errorStack.size()];
return (Exception[]) errorStack.toArray(retVal);
return errorStack.toArray(new Exception[errorStack.size()]);
}
public String toString() {
String retVal = "";
String softRefStr ="";
Set keys = softReferences.keySet();
for (Iterator iter = keys.iterator(); iter.hasNext();) {
String category = (String) iter.next();
Set<String> keys = softReferences.keySet();
for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
String category = iter.next();
softRefStr += "["+category+"::";
Set catSoftRefs = (Set) softReferences.get(category);
for (Iterator iterator = catSoftRefs.iterator(); iterator.hasNext();) {
String srs = (String) iterator.next();
Set<String> catSoftRefs = softReferences.get(category);
for (Iterator<String> iterator = catSoftRefs.iterator(); iterator.hasNext();) {
String srs = iterator.next();
softRefStr +=srs+",";
}
softRefStr +="]";
......
......@@ -105,7 +105,7 @@ public class ConditionInterpreter {
env.addFunction(DateFunction.name, new DateFunction(userCourseEnv));
env.addFunction("inGroup", new InLearningGroupFunction(userCourseEnv, "inGroup")); // legacy
env.addFunction("inLearningGroup", new InLearningGroupFunction(userCourseEnv, "inLearningGroup"));
env.addFunction("isLearningGroupFull", new IsLearningGroupFullFunction(userCourseEnv, "isLearningGroupFull"));
env.addFunction("isLearningGroupFull", new IsLearningGroupFullFunction(userCourseEnv));
env.addFunction(InRightGroupFunction.name, new InRightGroupFunction(userCourseEnv));
env.addFunction(InLearningAreaFunction.name, new InLearningAreaFunction(userCourseEnv));
env.addFunction(IsUserFunction.name, new IsUserFunction(userCourseEnv));
......@@ -133,6 +133,8 @@ public class ConditionInterpreter {
env.addFunction(IsCourseParticipantFunction.name, new IsCourseParticipantFunction(userCourseEnv));
env.addFunction(IsCourseAdministratorFunction.name, new IsCourseAdministratorFunction(userCourseEnv));
env.addFunction(GetCourseBeginDateFunction.name, new GetCourseBeginDateFunction(userCourseEnv));
env.addFunction(GetCourseEndDateFunction.name, new GetCourseEndDateFunction(userCourseEnv));
env.addFunction(GetInitialCourseLaunchDateFunction.name, new GetInitialCourseLaunchDateFunction(userCourseEnv));
env.addFunction(GetRecentCourseLaunchDateFunction.name, new GetRecentCourseLaunchDateFunction(userCourseEnv));
......
......@@ -33,6 +33,7 @@ import java.util.regex.Pattern;
import org.olat.core.id.Identity;
import org.olat.core.id.IdentityEnvironment;
import org.olat.core.logging.OLATRuntimeException;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.run.userview.UserCourseEnvironment;
......@@ -43,6 +44,8 @@ import org.olat.course.run.userview.UserCourseEnvironment;
*/
public class EvalAttributeFunction extends AbstractFunction {
private static final OLog log = Tracing.createLoggerFor(EvalAttributeFunction.class);
/***************************************************************
* Function types *
* *
......@@ -113,9 +116,9 @@ public class EvalAttributeFunction extends AbstractFunction {
String[] b = multiValueSeparatorValue.split(values); // split on ;
if (a == null || (a.length == 1 && a[0] == "")) return false; // empty array?
if (b == null || (b.length == 1 && b[0] == "")) return false; // empty array?
if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
Tracing.logDebug("a: " + Arrays.toString(a), EvalAttributeFunction.class);
Tracing.logDebug("b: " + Arrays.toString(b), EvalAttributeFunction.class);
if (log.isDebug()) {
log.debug("a: " + Arrays.toString(a));
log.debug("b: " + Arrays.toString(b));
}
if (type == FUNCTION_TYPE_HAS_ATTRIBUTE) {
List<String> l = Arrays.asList(a);
......@@ -195,15 +198,16 @@ public class EvalAttributeFunction extends AbstractFunction {
IdentityEnvironment ienv = getUserCourseEnv().getIdentityEnvironment();
Identity ident = ienv.getIdentity();
Map attributes = ienv.getAttributes();
Map<String, String> attributes = ienv.getAttributes();
if (attributes == null) return ConditionInterpreter.INT_FALSE;
String value = (String)attributes.get(attName);
String value = attributes.get(attName);
boolean match = false;
if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
Tracing.logDebug("value : " + value, EvalAttributeFunction.class);
Tracing.logDebug("attrValue: " + attValue, EvalAttributeFunction.class);
Tracing.logDebug("fT : " + functionType, EvalAttributeFunction.class);
boolean debug = log.isDebug();
if (debug) {
log.debug("value : " + value);
log.debug("attrValue: " + attValue);
log.debug("fT : " + functionType);
}
if (value != null) {
if (functionType <= FUNCTION_TYPE_IS_NOT_IN_ATTRIBUTE) {
......@@ -213,9 +217,9 @@ public class EvalAttributeFunction extends AbstractFunction {
}
}
if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
Tracing.logDebug("identity '" + ident.getName() + "' tested on attribute '" + attName + "' to have value '" +
attValue + "' user's value was '" + value + "', match=" + match, EvalAttributeFunction.class);
if (debug) {
log.debug("identity '" + ident.getName() + "' tested on attribute '" + attName + "' to have value '" +
attValue + "' user's value was '" + value + "', match=" + match);
}
return match ? ConditionInterpreter.INT_TRUE : ConditionInterpreter.INT_FALSE;
}
......
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.condition.interpreter;
import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.repository.model.RepositoryEntryLifecycle;
/**
*
* Description:<br>
* Function to get the begin date of the course
* lifecycle.
* <P>
* Initial Date: 4.12.2013 <br>
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class GetCourseBeginDateFunction extends AbstractFunction {
public static final String name = "getCourseBeginDate";
/**
* Default constructor to use the get initial enrollment date
* @param userCourseEnv
*/
public GetCourseBeginDateFunction(UserCourseEnvironment userCourseEnv) {
super(userCourseEnv);
}
/**
* @see com.neemsoft.jmep.FunctionCB#call(java.lang.Object[])
*/
@Override
public Object call(Object[] inStack) {
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if(cev != null) {
return defaultValue();
}
RepositoryEntryLifecycle lifecycle = getUserCourseEnv().getLifecycle();
if (lifecycle != null && lifecycle.getValidFrom() != null) {
return Double.valueOf(lifecycle.getValidFrom().getTime());
} else {
// what to do in case of no date available??? -> return date in the future
return new Double(Double.POSITIVE_INFINITY);
}
}
@Override
protected Object defaultValue() {
return new Double(Double.MIN_VALUE);
}
}
\ No newline at end of file
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.condition.interpreter;
import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.repository.model.RepositoryEntryLifecycle;
/**
*
* Description:<br>
* Function to get the end date of the course
* lifecycle.
* <P>
* Initial Date: 4.12.2013 <br>
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class GetCourseEndDateFunction extends AbstractFunction {
public static final String name = "getCourseEndDate";
/**
* Default constructor to use the get initial enrollment date
* @param userCourseEnv
*/
public GetCourseEndDateFunction(UserCourseEnvironment userCourseEnv) {
super(userCourseEnv);
}
/**
* @see com.neemsoft.jmep.FunctionCB#call(java.lang.Object[])
*/
@Override
public Object call(Object[] inStack) {
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if(cev != null) {
return defaultValue();
}
RepositoryEntryLifecycle lifecycle = getUserCourseEnv().getLifecycle();
if (lifecycle != null && lifecycle.getValidTo() != null) {
return Double.valueOf(lifecycle.getValidTo().getTime());
} else {
// what to do in case of no date available??? -> return date in the future
return new Double(Double.POSITIVE_INFINITY);
}
}
@Override
protected Object defaultValue() {
return new Double(Double.MIN_VALUE);
}
}
\ No newline at end of file
......@@ -50,7 +50,7 @@ public class IsLearningGroupFullFunction extends AbstractFunction {
/**
* @param userCourseEnv
*/
public IsLearningGroupFullFunction(UserCourseEnvironment userCourseEnv, String fnName) {
public IsLearningGroupFullFunction(UserCourseEnvironment userCourseEnv) {
super(userCourseEnv);
}
......
......@@ -82,7 +82,9 @@ public class OnlyGroupConditionInterpreter extends ConditionInterpreter{
env.addFunction(IsCourseAdministratorFunction.name, new DummyBooleanFunction(userCourseEnv));
env.addFunction(GetAttemptsFunction.name, new DummyIntegerFunction(userCourseEnv));
env.addFunction(GetCourseBeginDateFunction.name, new GetCourseBeginDateFunction(userCourseEnv));
env.addFunction(GetCourseEndDateFunction.name, new GetCourseEndDateFunction(userCourseEnv));
env.addFunction(GetInitialCourseLaunchDateFunction.name, new GetInitialCourseLaunchDateFunction(userCourseEnv));
env.addFunction(GetRecentCourseLaunchDateFunction.name, new GetRecentCourseLaunchDateFunction(userCourseEnv));
......
......@@ -54,39 +54,25 @@ public class GetScoreWithCourseIdFunction extends AbstractFunction {
* @see com.neemsoft.jmep.FunctionCB#call(java.lang.Object[])
*/
public Object call(Object[] inStack) {
/*
* argument check
*/
if (inStack.length > 2) {
if (inStack.length > 2) {//need > 2 for compatibility reason
return handleException(new ArgumentParseException(ArgumentParseException.NEEDS_FEWER_ARGUMENTS, name, "", "error.fewerargs",
"solution.provideone.nodereference"));
} else if (inStack.length < 2) { return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_MORE_ARGUMENTS, name, "",
} else if (inStack.length < 1) { return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_MORE_ARGUMENTS, name, "",
"error.moreargs", "solution.provideone.nodereference")); }
/*
* argument type check
*/
//TODO argument check courseRepoEntryKey
Long courseRepoEntryKey;
try{
courseRepoEntryKey = Long.decode((String) inStack[0]) ;
}catch(NumberFormatException nfe) {
} catch(NumberFormatException nfe) {
return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
}
if (!(inStack[1] instanceof String)) return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
String childId = (String) inStack[1];
/*
* no integrity check can be done - other course might not exist anymore
*/
// no integrity check can be done - other course might not exist anymore
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if (cev != null) { return defaultValue(); }
/*
* the real function evaluation which is used during run time
*/
// the real function evaluation which is used during run time
EfficiencyStatementManager esm = EfficiencyStatementManager.getInstance();
UserEfficiencyStatement es = esm.getUserEfficiencyStatementLight(courseRepoEntryKey, getUserCourseEnv().getIdentityEnvironment().getIdentity());
if (es == null) return defaultValue();
......
......@@ -28,9 +28,14 @@ package org.olat.course.editor;
import org.olat.core.id.IdentityEnvironment;
import org.olat.core.logging.AssertException;
import org.olat.course.condition.interpreter.ConditionInterpreter;
import org.olat.course.groupsandrights.CourseGroupManager;
import org.olat.course.run.environment.CourseEnvironment;
import org.olat.course.run.scoring.ScoreAccounting;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryManager;
import org.olat.repository.model.RepositoryEntryLifecycle;
import org.olat.resource.OLATResource;
/**
* Description:<br>
......@@ -45,12 +50,13 @@ public class EditorUserCourseEnvironmentImpl implements UserCourseEnvironment {
private CourseEditorEnv courseEditorEnv;
private ConditionInterpreter ci;
private ScoreAccounting sa;
private RepositoryEntryLifecycle lifecycle;
EditorUserCourseEnvironmentImpl(CourseEditorEnv courseEditorEnv){
this.courseEditorEnv = courseEditorEnv;
this.ci = new ConditionInterpreter(this);
this.courseEditorEnv.setConditionInterpreter(ci);
this.sa = new ScoreAccounting(this);
ci = new ConditionInterpreter(this);
courseEditorEnv.setConditionInterpreter(ci);
sa = new ScoreAccounting(this);
}
/**
......@@ -108,4 +114,17 @@ public class EditorUserCourseEnvironmentImpl implements UserCourseEnvironment {
public boolean isParticipant() {
return false;
}
@Override
public RepositoryEntryLifecycle getLifecycle() {
if(lifecycle == null) {
CourseGroupManager cgm = courseEditorEnv.getCourseGroupManager();
OLATResource courseResource = cgm.getCourseResource();
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(courseResource, false);
if(re != null) {
lifecycle = re.getLifecycle();
}
}
return lifecycle;
}
}
......@@ -70,6 +70,9 @@
<tr>
<td><b>(getRecentCourseLaunchDate(0) + 10min > now </b> <br/>$r.translate("chelp.egR16") <br/><br/></td>
</tr>
<tr>
<td><b>(getCourseBeginDate(0) &lt;= now) | (getCourseEndDate(0) &gt;= now)</b> <br/>$r.translate("chelp.egR17") <br/><br/></td>
</tr>
</tbody>
</table>
<br/>
......
......@@ -168,6 +168,7 @@ chelp.egR13=Gibt $\:chelp.wordTrue f\u00FCr diejenigen Kursteilnehmer, die sich
chelp.egR14=Gibt $\:chelp.wordTrue w\u00E4hrend zwei Stunden ab Einschreibezeitpunkt f\u00FCr diejenigen Kursteilnehmer, die sich \u00FCber den Kursbaustein $\:chelp.en mit spezifizierter ID in eine zur Auswahl stehende Gruppe eingeschrieben haben. So kann abgebildet werden, dass jeder Kursteilnehmer nur w\u00E4hrend einer bestimmten Zeitdauer z.B. ein Skript bearbeiten kann.
chelp.egR15=Gibt $\:chelp.wordTrue, wenn der Kursteilnehmer den Kurs noch nicht besucht hat oder w\u00E4hrend zwei Stunden seit dem ersten Kursbesuch. So kann abgebildet werden, dass jeder Kursteilnehmer nur w\u00E4hrend einer bestimmten Zeitdauer den Kurs sehen kann.
chelp.egR16=Gibt $\:chelp.wordTrue, wenn sich der Benutzer seit mehr als 10 Minuten im Kurs bewegt.
chelp.egR17=Gibt den Wert $\:chelp.wordTrue zur\u00FCck, wenn das heutige Datum zwischen Beginn- und Enddatum des Durchf\u00FChrungszeitraums des Kurses liegt.
chelp.egR2=Mit Ausnahme der Gruppe <i>&laquo;$\:chelp.deb&raquo;</i> ist der Kursbaustein f\u00FCr alle Kursteilnehmer sichtbar.
chelp.egR3=Der Kursbaustein ist zwischen dem 22.03.2004 und 23.08.2004 f\u00FCr alle Kursteilnehmer sichtbar, w\u00E4hrend er f\u00FCr Mitglieder der Lerngruppe <i>&laquo;$\:chelp.coach&raquo;</i> jederzeit sichtbar ist.
chelp.egR4=Der Kursbaustein ist zwischen dem 03.09.2004 und 13.10.2004 f\u00FCr alle Kursteilnehmer der Rechtegruppe <i>&laquo;$\:chelp.asses&raquo;</i> sichtbar, w\u00E4hrend er f\u00FCr die Person mit dem Benutzernamen <i>&laquo;$\:chelp.author&raquo;</i> jederzeit sichtbar ist.
......
#Tue Oct 29 21:06:41 CET 2013
#Wed Dec 04 16:44:31 CET 2013
access.form.label=Avoir acc\u00E8s au cours entier.
access.legend=Modifier l'acc\u00E8s au cours entier
alternative=Chercher un \u00E9l\u00E9ment de cours alternatif
......@@ -156,6 +156,7 @@ chelp.egR13=Donne $\:chelp.wordTrue pour les participants au cours qui se sont i
chelp.egR14=Donne $\:chelp.wordTrue pendant deux heures \u00E0 partir du moment de l'inscription pour ces participants au cours qui se sont inscrits dans un des groupes mis \u00E0 disposition en passant par l'\u00E9l\u00E9ment de cours $\:chelp.en avec l'ID sp\u00E9cifi\u00E9. On peut ainsi voir que chaque participant au cours ne peut par exemple travailler sur un script que pendant une p\u00E9riode de temps d\u00E9termin\u00E9e.
chelp.egR15=Donne $\:chelp.wordTrue, si un participant \u00E0 un cours n'a pas encore visit\u00E9 le cours ou durant les deux heures qui suivent la premi\u00E8re visite. De cette mani\u00E8re, il est possible repr\u00E9senter que chaque participant au cours peut voir le cours durant une p\u00E9riode de temps d\u00E9fini seulement.
chelp.egR16=Donne $\:chelp.wordTrue, si l'utilisateur navigue dans le cours depuis plus de 10 minutes.
chelp.egR17=Retourne la valeur de $\:chelp.wordTrue si la date d'aujourd'hui se trouve entre les dates de d\u00E9but et de fin de la p\u00E9riode de cours si celles-ci se sont utilis\u00E9es.
chelp.egR2=A l'exception du groupe <i>&laquo;$\:chelp.deb&raquo;</i>, l'\u00E9l\u00E9ment de cours est visible par tous les participants au cours
chelp.egR3=L'\u00E9l\u00E9ment de cours est visible pour tous les participants au cours entre le 22.03.2004 et le 23.08.2004, tout en \u00E9tant visible \u00E0 tout moment pour les membres du groupe d'\u00E9tude <i>&laquo;$\:chelp.coach&raquo;</i>.
chelp.egR4=L'\u00E9l\u00E9ment de cours est visible pour tous les participants au cours du groupe de droits <i>&laquo;$\:chelp.asses&raquo;</i> entre le 03.09.2004 et le 13.10.2004, tout en \u00E9tant visible \u00E0 tout moment pour la personne avec le nom d'utilisateur <i>&laquo;$\:chelp.author&raquo;</i>.
......
......@@ -30,6 +30,7 @@ import org.olat.course.condition.interpreter.ConditionInterpreter;
import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.run.environment.CourseEnvironment;
import org.olat.course.run.scoring.ScoreAccounting;
import org.olat.repository.model.RepositoryEntryLifecycle;
/**
* @author Felix Jost
......@@ -60,5 +61,7 @@ public interface UserCourseEnvironment {
public boolean isParticipant();
public boolean isIdentityInCourseGroup(Long groupKey);
public RepositoryEntryLifecycle getLifecycle();
}
\ No newline at end of file
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