Index: lams_admin/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -rc237005f7628b877893619745e0c166202caba89 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision c237005f7628b877893619745e0c166202caba89)
+++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -635,6 +635,12 @@
sysadmin.lesson.allow.restart =Learners can restart the lesson
sysadmin.lesson.default =Lesson default settings
config.enable.portrait.editing =Enable profile portrait editing
+admin.outcome.title =Outcomes management
+outcome.authoring.title =Learning outcomes
+outcome.authoring.input =Search and select by outcome name or code
+outcome.authoring.existing =Added outcomes
+outcome.authoring.existing.none =none
+
#======= End labels: Exported 629 labels for en AU =====
Index: lams_build/lib/lams/lams.jar
===================================================================
diff -u -r39b3310a4aa2fad6567aeaa89a08dc9ae0084196 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
Binary files differ
Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r1e612192adc45476d007a3254ee9d1903158c064 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 1e612192adc45476d007a3254ee9d1903158c064)
+++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -793,6 +793,7 @@
register.email.verify =A confirmation email will be sent before you are able to log in.
signup.email.verify.sent =A confirmation email has been sent to {0}
Check your email and follow the instructions.
+
#====== Templates
authoring.msg.close.cancel.save=Do you want to close this window without saving?
authoring.msg.list.cancel.save=Do you want to return to the template list without saving?
@@ -839,12 +840,53 @@
authoring.error.application.exercise.not.blank.and.grade=Application Exercise {0} may not be blank and must have a grade.
authoring.label.grade=Grade
authoring.label.none=None
+index.outcome.manage =Outcomes
+index.outcome.manage.tooltip =Manage learning outcomes and scales
+outcome.manage.title =Course outcomes
+outcome.manage.remove =Remove outcome
+outcome.manage.remove.confirm =Are you sure you want to remove this outcome?
+outcome.manage.add =Add outcome
+outcome.manage.edit =Edit outcome
+outcome.manage.view =View outcome
+outcome.manage.add.name =Name
+outcome.manage.add.code =Code
+outcome.manage.add.description =Description
+outcome.manage.add.global =Global
+outcome.manage.add.scale =Scale
+outcome.manage.add.save =Save
+outcome.manage.scope =Scope
+outcome.manage.scope.global =global
+outcome.manage.scope.course =course
+outcome.manage.add.error =Error while saving an outcome
+outcome.manage.add.error.name.blank =Name can not be blank
+outcome.manage.add.error.code.blank =Code can not be blank
+outcome.manage.add.error.scale.choose =You have to choose a scale
+scale.title =Scales
+scale.manage =Manage scales
+scale.manage.add =Add scale
+scale.manage.edit =Edit scale
+scale.manage.view =View scale
+scale.manage.title =Course scales
+scale.manage.remove =Remove scale
+scale.manage.remove.scale =Error while removing a scale. It is probably used in some outcomes.
+scale.manage.remove.confirm =Are you sure you want to remove this scale?
+scale.manage.add.value =Values
+scale.manage.add.value.info =Enter comma separated values in increasing order of value. For example, an A,B,C,D scale must be entered as D,C,B,A.
+scale.manage.add.value.error.blank =A value must not be blank
+scale.manage.add.error =Error while saving an outcome scale
+outcome.authoring.title =Learning outcomes
+outcome.authoring.input =Search and select by outcome name or code
+outcome.authoring.existing =Added outcomes
+outcome.authoring.existing.none =none
+outcome.export.date =Exported on:
+outcome.export =Export
+outcome.import =Import
+outcome.import.error =Error while importing outcomes or scales. Check logs.
authoring.enable.confidence.levels=Enable confidence levels
#=================== Specific to Team Based Learning (TBL) =========================#
authoring.tbl.template.title=Team Based Learning
authoring.tbl.template.description=Individual and Team Readiness Assessments followed by Application Exercises.
authoring.tbl.desc.question=These questions are for iRA and tRA. Click "Create Question" to add more questions. Turn on "Enable confidence levels" to have the learners' confidence levels from the iRA shown on the tRA screen.
authoring.tbl.desc.ae=State the questions for AE. Click "Create Question" to add more questions.
-
#======= End labels: Exported 786 labels for en AU =====
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java
===================================================================
diff -u -r73e57b8ca1a3ddd6cd15b00240d90b79c5de063a -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 73e57b8ca1a3ddd6cd15b00240d90b79c5de063a)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -44,8 +44,6 @@
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
-import org.apache.tomcat.util.json.JSONException;
-import org.apache.tomcat.util.json.JSONObject;
import org.lamsfoundation.lams.authoring.IObjectExtractor;
import org.lamsfoundation.lams.authoring.ObjectExtractorException;
import org.lamsfoundation.lams.dao.IBaseDAO;
@@ -90,7 +88,6 @@
import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
import org.lamsfoundation.lams.monitoring.service.MonitoringServiceException;
import org.lamsfoundation.lams.outcome.service.IOutcomeService;
-import org.lamsfoundation.lams.planner.dao.PedagogicalPlannerDAO;
import org.lamsfoundation.lams.tool.SystemTool;
import org.lamsfoundation.lams.tool.Tool;
import org.lamsfoundation.lams.tool.ToolContentIDGenerator;
@@ -110,18 +107,22 @@
import org.lamsfoundation.lams.usermanagement.exception.WorkspaceFolderException;
import org.lamsfoundation.lams.util.Configuration;
import org.lamsfoundation.lams.util.ConfigurationKeys;
+import org.lamsfoundation.lams.util.JsonUtil;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
+import org.lamsfoundation.lams.workspace.dto.FolderContentDTO;
import org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
/**
* @author Manpreet Minhas
*/
-public class AuthoringService implements IAuthoringService, BeanFactoryAware {
+public class AuthoringService implements IAuthoringFullService, BeanFactoryAware {
protected Logger log = Logger.getLogger(AuthoringService.class);
@@ -150,8 +151,6 @@
protected ISystemToolDAO systemToolDAO;
- protected PedagogicalPlannerDAO pedagogicalPlannerDAO;
-
protected ILamsCoreToolService lamsCoreToolService;
protected ILearningDesignService learningDesignService;
@@ -178,13 +177,8 @@
protected IBranchActivityEntryDAO branchActivityEntryDAO;
public AuthoringService() {
-
}
- public void setPedagogicalPlannerDAO(PedagogicalPlannerDAO pedagogicalPlannerDAO) {
- this.pedagogicalPlannerDAO = pedagogicalPlannerDAO;
- }
-
/***************************************************************************
* Setter Methods
**************************************************************************/
@@ -211,34 +205,10 @@
this.branchActivityEntryDAO = branchActivityEntryDAO;
}
- /**
- *
- * @return
- */
- public ICompetenceDAO getCompetenceDAO() {
- return competenceDAO;
- }
-
- /**
- *
- * @param competenceDAO
- */
public void setCompetenceDAO(ICompetenceDAO competenceDAO) {
this.competenceDAO = competenceDAO;
}
- /**
- *
- * @return
- */
- public ICompetenceMappingDAO getCompetenceMappingDAO() {
- return competenceMappingDAO;
- }
-
- /**
- *
- * @param competenceMappingDAO
- */
public void setCompetenceMappingDAO(ICompetenceMappingDAO competenceMappingDAO) {
this.competenceMappingDAO = competenceMappingDAO;
}
@@ -307,18 +277,10 @@
this.licenseDAO = licenseDAO;
}
- public ILamsCoreToolService getLamsCoreToolService() {
- return lamsCoreToolService;
- }
-
public void setLamsCoreToolService(ILamsCoreToolService lamsCoreToolService) {
this.lamsCoreToolService = lamsCoreToolService;
}
- public ILearningDesignService getLearningDesignService() {
- return learningDesignService;
- }
-
/**
* @param learningDesignService
* The Learning Design Validator Service
@@ -327,15 +289,6 @@
this.learningDesignService = learningDesignService;
}
- @Override
- public MessageService getMessageService() {
- return messageService;
- }
-
- public ILessonService getLessonService() {
- return lessonService;
- }
-
public void setLessonService(ILessonService lessonService) {
this.lessonService = lessonService;
}
@@ -368,27 +321,7 @@
this.contentIDGenerator = contentIDGenerator;
}
- /**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getLearningDesign(java.lang.Long)
- */
@Override
- public LearningDesign getLearningDesign(Long learningDesignID) {
- return learningDesignDAO.getLearningDesignById(learningDesignID);
- }
-
- /**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#saveLearningDesign(org.lamsfoundation.lams.learningdesign.LearningDesign)
- */
- @Override
- public void saveLearningDesign(LearningDesign learningDesign) {
- learningDesignDAO.insertOrUpdate(learningDesign);
- }
-
- public BeanFactory getBeanFactory() {
- return beanFactory;
- }
-
- @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
@@ -398,18 +331,29 @@
**************************************************************************/
/**
+ * Returns a populated LearningDesign object corresponding to the given learningDesignID
+ *
+ * @param learningDesignID
+ * The learning_design_id of the design which has to be fetched
+ * @return LearningDesign The populated LearningDesign object corresponding to the given learningDesignID
+ */
+ private LearningDesign getLearningDesign(Long learningDesignID) {
+ return learningDesignDAO.getLearningDesignById(learningDesignID);
+ }
+
+ /**
* Helper method to retrieve the user data. Gets the id from the user details in the shared session
*
* @return the user id
*/
- public static Integer getUserId() {
+ private static Integer getUserId() {
HttpSession ss = SessionManager.getSession();
UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER);
return learner != null ? learner.getUserID() : null;
}
/**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolOutputDefinitions(java.lang.Long, int)
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#getToolOutputDefinitions(java.lang.Long, int)
*/
@Override
public List getToolOutputDefinitions(Long toolContentID, int definitionType) {
@@ -426,7 +370,7 @@
}
/**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#setupEditOnFlyLock(LearningDesign,
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#setupEditOnFlyLock(LearningDesign,
* java.lang.Integer)
*/
@SuppressWarnings("unchecked")
@@ -467,6 +411,7 @@
}
}
+
// lock Learning Design
design.setEditOverrideLock(true);
design.setEditOverrideUser(user);
@@ -479,7 +424,7 @@
}
/**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#setupEditOnFlyGate(java.lang.Long,
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#setupEditOnFlyGate(java.lang.Long,
* java.lang.Integer)
*/
@@ -524,7 +469,6 @@
}
// only the user who is editing the design may unlock it
if (design.getEditOverrideUser().equals(user)) {
-
design.setEditOverrideLock(false);
design.setEditOverrideUser(null);
@@ -855,7 +799,7 @@
}
/**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#copyLearningDesign(org.lamsfoundation.lams.learningdesign.LearningDesign,
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#copyLearningDesign(org.lamsfoundation.lams.learningdesign.LearningDesign,
* java.lang.Integer, org.lamsfoundation.lams.usermanagement.User,
* org.lamsfoundation.lams.usermanagement.WorkspaceFolder, java.lang.Boolean, java.lang.String)
*/
@@ -906,85 +850,7 @@
}
/**
- * @throws UserException
- * @throws WorkspaceFolderException
- * @throws IOException
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#insertLearningDesign(java.lang.Long,
- * java.lang.Long, java.lang.Integer, java.lang.Boolean, java.lang.String, java.lang.Integer)
- */
- @Override
- public LearningDesign insertLearningDesign(Long originalDesignID, Long designToImportID, Integer userID,
- boolean createNewLearningDesign, String newDesignName, Integer workspaceFolderID, String customCSV)
- throws UserException, WorkspaceFolderException, IOException {
-
- User user = (User) baseDAO.find(User.class, userID);
- if (user == null) {
- throw new UserException(messageService.getMessage("no.such.user.exist", new Object[] { userID }));
- }
-
- LearningDesign mainDesign = learningDesignDAO.getLearningDesignById(originalDesignID);
- if (mainDesign == null) {
- throw new LearningDesignException(
- messageService.getMessage("no.such.learningdesign.exist", new Object[] { originalDesignID }));
- }
-
- LearningDesign designToImport = learningDesignDAO.getLearningDesignById(designToImportID);
- if (designToImport == null) {
- throw new LearningDesignException(
- messageService.getMessage("no.such.learningdesign.exist", new Object[] { designToImportID }));
- }
-
- if (createNewLearningDesign) {
- WorkspaceFolder workspaceFolder = (WorkspaceFolder) baseDAO.find(WorkspaceFolder.class, workspaceFolderID);
- if (workspaceFolder == null) {
- throw new WorkspaceFolderException(
- messageService.getMessage("no.such.workspace.exist", new Object[] { workspaceFolderID }));
- }
- if (!workspaceManagementService
- .isUserAuthorizedToModifyFolderContents(workspaceFolder.getWorkspaceFolderId(), user.getUserId())) {
- throw new UserAccessDeniedException("User with user_id of " + user.getUserId()
- + " is not authorized to store a copy a learning design into the workspace folder "
- + workspaceFolder);
- }
-
- mainDesign = copyLearningDesign(mainDesign, LearningDesign.COPY_TYPE_NONE, user, workspaceFolder, false,
- newDesignName, customCSV);
- } else {
- // updating the existing design so check the rights to the folder
- // containing the design. If this is in live edit mode
- boolean authorised = workspaceManagementService.isUserAuthorizedToModifyFolderContents(
- mainDesign.getWorkspaceFolder().getWorkspaceFolderId(), user.getUserId());
- if (!authorised) {
- authorised = (mainDesign.getEditOverrideLock() != null)
- && mainDesign.getEditOverrideLock().booleanValue()
- && userID.equals(mainDesign.getEditOverrideUser().getUserId());
- }
- if (!authorised) {
- throw new UserAccessDeniedException("User with user_id of " + user.getUserId()
- + " is not authorized to update a learning design into the workspace folder "
- + mainDesign.getWorkspaceFolder());
- }
- }
-
- // now dump the import design into our main sequence. Leave the first
- // activity ui id for the design as it is.
- int uiidOffset = mainDesign.getMaxID().intValue();
- updateDesignCompetences(designToImport, mainDesign, true);
- HashMap newActivities = updateDesignActivities(designToImport, mainDesign, uiidOffset,
- customCSV);
- updateDesignTransitions(designToImport, mainDesign, newActivities, uiidOffset);
- mainDesign.setMaxID(LearningDesign.addOffset(designToImport.getMaxID(), uiidOffset));
- mainDesign.setValidDesign(Boolean.FALSE);
- mainDesign.setLastModifiedDateTime(new Date());
- learningDesignDAO.update(mainDesign);
-
- insertCompetenceMappings(mainDesign.getCompetences(), designToImport.getCompetences(), newActivities);
-
- return mainDesign;
- }
-
- /**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#copyLearningDesignToolContent(org.lamsfoundation.lams.learningdesign.LearningDesign,
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#copyLearningDesignToolContent(org.lamsfoundation.lams.learningdesign.LearningDesign,
* org.lamsfoundation.lams.learningdesign.LearningDesign, java.lang.Integer)
*/
private LearningDesign copyLearningDesignToolContent(LearningDesign design, LearningDesign originalLearningDesign,
@@ -1017,6 +883,7 @@
// clear read only field
toolActivity.setReadOnly(false);
+
} catch (DataMissingException e) {
String error = "Unable to copy a design / initialise the lesson. Data is missing for activity "
+ activity.getActivityUIID() + " in learning design " + originalLearningDesignId
@@ -1258,7 +1125,7 @@
* @param newLearningDesign
* The copy of the originalLearningDesign
*/
- public void updateDesignTransitions(LearningDesign originalLearningDesign, LearningDesign newLearningDesign,
+ private void updateDesignTransitions(LearningDesign originalLearningDesign, LearningDesign newLearningDesign,
HashMap newActivities, int uiidOffset) {
HashSet newTransitions = new HashSet();
Set oldTransitions = originalLearningDesign.getTransitions();
@@ -1314,7 +1181,7 @@
* @param newLearningDesign
* The copy of the originalLearningDesign
*/
- public void updateDesignCompetences(LearningDesign originalLearningDesign, LearningDesign newLearningDesign,
+ private void updateDesignCompetences(LearningDesign originalLearningDesign, LearningDesign newLearningDesign,
boolean insert) {
HashSet newCompeteces = new HashSet<>();
@@ -1357,58 +1224,6 @@
}
- public void insertCompetenceMappings(Set oldCompetences, Set newCompetences,
- HashMap newActivities) {
-
- for (Integer activityKey : newActivities.keySet()) {
- Activity activity = newActivities.get(activityKey);
- if (activity.isToolActivity()) {
- Set newCompetenceMappings = new HashSet<>();
- ToolActivity newToolActivity = (ToolActivity) activity;
- if (newToolActivity.getCompetenceMappings() != null) {
- for (CompetenceMapping competenceMapping : newToolActivity.getCompetenceMappings()) {
- CompetenceMapping newMapping = new CompetenceMapping();
- newMapping.setToolActivity(newToolActivity);
-
- // Check if competence mapping title already exists as a
- // competence in the original sequence
- // If so, simply use the existing competence to map to.
- if ((oldCompetences != null) && (oldCompetences.size() > 0)
- && (getCompetenceFromSet(oldCompetences,
- competenceMapping.getCompetence().getTitle()) != null)) {
- newMapping.setCompetence(
- getCompetenceFromSet(oldCompetences, competenceMapping.getCompetence().getTitle()));
- competenceMappingDAO.insert(newMapping);
- newCompetenceMappings.add(newMapping);
- }
- // If competence was not already existing in the ld, add
- // a new mappping
- else if ((newCompetences != null) && (newCompetences.size() > 0)
- && (getCompetenceFromSet(newCompetences,
- competenceMapping.getCompetence().getTitle()) != null)) {
- newMapping.setCompetence(
- getCompetenceFromSet(newCompetences, competenceMapping.getCompetence().getTitle()));
- competenceMappingDAO.insert(newMapping);
- newCompetenceMappings.add(newMapping);
- }
- }
- }
- newToolActivity.getCompetenceMappings().addAll(newCompetenceMappings);
- }
- }
- }
-
- public Competence getCompetenceFromSet(Set competences, String title) {
- Competence ret = null;
- for (Competence competence : competences) {
- if (competence.getTitle().equals(title)) {
- ret = competence;
- break;
- }
- }
- return ret;
- }
-
/**
* Updates the competence information in the newLearningDesign based on the originalLearningDesign
*
@@ -1417,7 +1232,7 @@
* @param newLearningDesign
* The copy of the originalLearningDesign
*/
- public void updateCompetenceMappings(Set newCompetences, HashMap newActivities) {
+ private void updateCompetenceMappings(Set newCompetences, HashMap newActivities) {
for (Integer activityKey : newActivities.keySet()) {
Activity activity = newActivities.get(activityKey);
if (activity.isToolActivity()) {
@@ -1488,8 +1303,8 @@
}
@Override
- public LearningDesign saveLearningDesignDetails(JSONObject ldJSON)
- throws UserException, JSONException, WorkspaceFolderException, ObjectExtractorException, ParseException {
+ public LearningDesign saveLearningDesignDetails(ObjectNode ldJSON)
+ throws UserException, WorkspaceFolderException, ObjectExtractorException, ParseException {
User user = null;
Integer userID = AuthoringService.getUserId();
if (userID != null) {
@@ -1499,15 +1314,15 @@
throw new UserException("UserID missing or user not found.");
}
- Integer workspaceFolderID = ldJSON.getInt("workspaceFolderID");
+ Integer workspaceFolderID = JsonUtil.optInt(ldJSON, "workspaceFolderID");
WorkspaceFolder workspaceFolder = null;
boolean authorised = false;
if (workspaceFolderID != null) {
workspaceFolder = (WorkspaceFolder) baseDAO.find(WorkspaceFolder.class, workspaceFolderID);
authorised = workspaceManagementService.isUserAuthorizedToModifyFolderContents(workspaceFolderID, userID);
}
- Long learningDesignId = ldJSON.optLong(AttributeNames.PARAM_LEARNINGDESIGN_ID);
+ Long learningDesignId = JsonUtil.optLong(ldJSON, AttributeNames.PARAM_LEARNINGDESIGN_ID);
LearningDesign existingLearningDesign = learningDesignId == null ? null
: learningDesignDAO.getLearningDesignById(learningDesignId);
if (!authorised && (existingLearningDesign != null)
@@ -1526,8 +1341,7 @@
if (extractor.getMode().intValue() == 1) {
// adding the customCSV to the call if it is present
- String customCSV = ldJSON.optString("customCSV");
-
+ String customCSV = JsonUtil.optString(ldJSON, "customCSV");
copyLearningDesignToolContent(design, design, design.getCopyTypeID(), customCSV);
}
@@ -1564,35 +1378,6 @@
}
@Override
- public Vector getToolActivities(Long learningDesignId, String languageCode) {
- LearningDesign learningDesign = learningDesignDAO.getLearningDesignById(learningDesignId);
- Vector listOfAuthoringActivityDTOs = new Vector<>();
-
- for (Iterator i = learningDesign.getActivities().iterator(); i.hasNext();) {
- Activity currentActivity = (Activity) i.next();
- if (currentActivity.isToolActivity()) {
- try {
- // Normally we pass in an array for the branch mappings as
- // the second parameter to new AuthoringActivityDTO()
- // but we don't need to in this case as it is only doing it
- // for tool activities, and the extra parameter is only
- // used for branching activities
- ToolActivity toolActivity = (ToolActivity) activityDAO
- .getActivityByActivityId(currentActivity.getActivityId());
- AuthoringActivityDTO activityDTO = new AuthoringActivityDTO(toolActivity, null, languageCode);
- listOfAuthoringActivityDTOs.add(activityDTO);
- } catch (ToolException e) {
- String error = "" + e.getMessage();
- log.error(error, e);
- throw new LearningDesignException(error, e);
- }
- }
- }
-
- return listOfAuthoringActivityDTOs;
- }
-
- @Override
public Long insertToolContentID(Long toolID) {
Tool tool = toolDAO.getToolByID(toolID);
if (tool == null) {
@@ -1612,7 +1397,7 @@
}
/**
- * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getAvailableLicenses()
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#getAvailableLicenses()
*/
@Override
public Vector getAvailableLicenses() {
@@ -1627,39 +1412,6 @@
}
/**
- * Delete a learning design from the database. Does not remove any content stored in tools - that is done by the
- * LamsCoreToolService
- */
- @Override
- public void deleteLearningDesign(LearningDesign design) {
- if (design == null) {
- log.error("deleteLearningDesign: unable to delete learning design as design is null.");
- return;
- }
-
- // remove all the tool content for the learning design
- Set acts = design.getActivities();
- Iterator iter = acts.iterator();
- while (iter.hasNext()) {
- Activity activity = (Activity) iter.next();
- if (activity.isToolActivity()) {
- try {
- ToolActivity toolActivity = (ToolActivity) activityDAO
- .getActivityByActivityId(activity.getActivityId());
- lamsCoreToolService.notifyToolToDeleteContent(toolActivity);
- } catch (ToolException e) {
- log.error(
- "Unable to delete tool content for activity" + activity + " as activity threw an exception",
- e);
- }
- }
- }
-
- // remove the learning design
- learningDesignDAO.delete(design);
- }
-
- /**
* Get a unique name for a learning design, based on the names of the learning designs in the folder. If the
* learning design has duplicated name in same folder, then the new name will have a timestamp. The new name format
* will be oldname_ddMMYYYY_idx. The idx will be auto incremental index number, start from 1. Warning - this may be
@@ -1839,4 +1591,9 @@
access.setAccessDate(new Date());
learningDesignDAO.insertOrUpdate(access);
}
+
+ @Override
+ public FolderContentDTO getUserWorkspaceFolder(Integer userID) throws IOException {
+ return workspaceManagementService.getUserWorkspaceFolder(userID);
+ }
}
\ No newline at end of file
Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java
===================================================================
diff -u -rcad6ecebe29a61651bdf8c7500a6a17471c65970 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision cad6ecebe29a61651bdf8c7500a6a17471c65970)
+++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -214,6 +214,12 @@
}
}
+ if (roles.contains(Role.ROLE_AUTHOR) && orgBean.getType().equals(OrganisationType.COURSE_TYPE)) {
+ moreLinks.add(
+ new IndexLinkBean("index.outcome.manage", "javascript:showOutcomeDialog(" + organisationId + ")",
+ "fa fa-fw fa-check-circle-o", "index.outcome.manage.tooltip"));
+ }
+
if (Configuration.getAsBoolean(ConfigurationKeys.ALLOW_KUMALIVE) && org.getEnableKumalive()
&& (roles.contains(Role.ROLE_GROUP_MANAGER) || roles.contains(Role.ROLE_MONITOR)
|| roles.contains(Role.ROLE_LEARNER))) {
Index: lams_central/web/WEB-INF/struts-config.xml
===================================================================
diff -u -r5caa0c70153ab564c5d8e347c4af4baf53b01fd0 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_central/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5caa0c70153ab564c5d8e347c4af4baf53b01fd0)
+++ lams_central/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -33,6 +33,14 @@
name="uploadForm"
type="org.lamsfoundation.lams.monitoring.web.FileUploadForm"
/>
+
+
@@ -789,8 +797,29 @@
+
+
+
+
-
+
+
+
+
Index: lams_central/web/main.jsp
===================================================================
diff -u -rd961ba28b63782744357d367fddb26ecc5701a1e -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_central/web/main.jsp (.../main.jsp) (revision d961ba28b63782744357d367fddb26ecc5701a1e)
+++ lams_central/web/main.jsp (.../main.jsp) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -94,6 +94,10 @@
MARK_ORG_FAVORITE : '',
KUMALIVE_TITLE : '',
+
+ OUTCOME_MANAGE_TITLE : '',
+
+ OUTCOME_COURSE_MANAGE_TITLE : ''
},
activeOrgId = null${activeOrgId};
Index: lams_common/src/java/org/lamsfoundation/lams/commonContext.xml
===================================================================
diff -u -r5637d8bff3d19e970c3c9aa92a5895b4897f9cef -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision 5637d8bff3d19e970c3c9aa92a5895b4897f9cef)
+++ lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -14,7 +14,7 @@
-
+
@@ -644,16 +644,6 @@
-
-
-
-
-
-
-
-
-
-
Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/gradebookApplicationContext.xml
===================================================================
diff -u -r8247b17119f9b3d3c9258069313ed2510a5f0650 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/gradebookApplicationContext.xml (.../gradebookApplicationContext.xml) (revision 8247b17119f9b3d3c9258069313ed2510a5f0650)
+++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/gradebookApplicationContext.xml (.../gradebookApplicationContext.xml) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -24,6 +24,7 @@
+
Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java
===================================================================
diff -u -r471b903caa3365758fbdec0a22440b1b0b3f2947 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision 471b903caa3365758fbdec0a22440b1b0b3f2947)
+++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -75,6 +75,11 @@
import org.lamsfoundation.lams.lesson.service.ILessonService;
import org.lamsfoundation.lams.logevent.LogEvent;
import org.lamsfoundation.lams.logevent.service.ILogEventService;
+import org.lamsfoundation.lams.outcome.Outcome;
+import org.lamsfoundation.lams.outcome.OutcomeMapping;
+import org.lamsfoundation.lams.outcome.OutcomeResult;
+import org.lamsfoundation.lams.outcome.OutcomeScaleItem;
+import org.lamsfoundation.lams.outcome.service.IOutcomeService;
import org.lamsfoundation.lams.tool.ToolOutput;
import org.lamsfoundation.lams.tool.ToolOutputValue;
import org.lamsfoundation.lams.tool.ToolSession;
@@ -99,6 +104,10 @@
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.util.HtmlUtils;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
/**
*
* This service handles all gradebook-related service calls
@@ -128,6 +137,7 @@
private ILogEventService logEventService;
private static ILearnerService learnerService;
+ private IOutcomeService outcomeService;
@Override
public List getGBActivityRowsForLearner(Long lessonId, Integer userId, TimeZone userTimezone) {
@@ -189,6 +199,30 @@
}
}
+ List outcomeMappings = outcomeService.getOutcomeMappings(null, activity.getToolContentId(),
+ null);
+ if (!outcomeMappings.isEmpty()) {
+ ArrayNode outcomeMappingsJSON = JsonNodeFactory.instance.arrayNode();
+ for (OutcomeMapping outcomeMapping : outcomeMappings) {
+ ObjectNode outcomeMappingJSON = JsonNodeFactory.instance.objectNode();
+ Outcome outcome = outcomeMapping.getOutcome();
+ outcomeMappingJSON.put("mappingId", outcomeMapping.getMappingId());
+ outcomeMappingJSON.put("name", outcome.getName());
+ outcomeMappingJSON.put("code", outcome.getCode());
+ ArrayNode possibleValues = JsonNodeFactory.instance.arrayNode();
+ for (OutcomeScaleItem possibleValue : outcome.getScale().getItems()) {
+ possibleValues.add(possibleValue.getName());
+ }
+ outcomeMappingJSON.set("possibleValues", possibleValues);
+ OutcomeResult result = outcomeService.getOutcomeResult(userId, outcomeMapping.getMappingId());
+ if (result != null) {
+ outcomeMappingJSON.put("value", result.getValue());
+ }
+ outcomeMappingsJSON.add(outcomeMappingJSON);
+ }
+ activityDTO.setOutcomes(outcomeMappingsJSON.toString());
+ }
+
gradebookActivityDTOs.add(activityDTO);
}
@@ -211,9 +245,7 @@
List activityArchives = gradebookDAO.getArchivedActivityMarks(activityId, userId);
for (GradebookUserLessonArchive lessonArchive : lessonArchives) {
Date archiveDate = lessonArchive.getArchiveDate();
- Date adjustedArchiveDate = userTimezone == null ? archiveDate
- : DateUtil.convertToTimeZoneFromDefault(userTimezone, archiveDate);
- GBActivityArchiveGridRowDTO activityDTO = new GBActivityArchiveGridRowDTO(attemptOrder, adjustedArchiveDate,
+ GBActivityArchiveGridRowDTO activityDTO = new GBActivityArchiveGridRowDTO(attemptOrder,
lessonArchive.getMark());
for (GradebookUserActivityArchive activityArchive : activityArchives) {
if (archiveDate.equals(activityArchive.getArchiveDate())) {
@@ -704,7 +736,7 @@
updateUserActivityGradebookMark(lesson, learner, activity, mark, markedInGradebook, isAuditLogRequired,
gradebookUserActivity, gradebookUserLesson);
}
-
+
private void updateUserActivityGradebookMark(Lesson lesson, User learner, Activity activity, Double mark,
Boolean markedInGradebook, boolean isAuditLogRequired) {
@@ -744,7 +776,7 @@
}
return evaluations;
}
-
+
private void updateUserActivityGradebookMark(Lesson lesson, Activity activity, User learner) {
ToolSession toolSession = toolService.getToolSessionByLearner(learner, activity);
@@ -858,7 +890,7 @@
gradebookUserActivity.setUpdateDate(new Date());
gradebookDAO.insertOrUpdate(gradebookUserActivity);
}
-
+
private void updateUserActivityGradebookFeedback(Activity activity, User learner, String feedback) {
GradebookUserActivity gradebookUserActivity = gradebookDAO
@@ -1086,7 +1118,6 @@
public LinkedHashMap exportLessonGradebook(Lesson lesson) {
boolean isWeighted = toolService.isWeightedMarks(lesson.getLearningDesign());
- ;
LinkedHashMap dataToExport = new LinkedHashMap();
@@ -1306,6 +1337,8 @@
titleRow[4] = new ExcelCell(getMessage("gradebook.columntitle.mark"), true);
rowList.add(titleRow);
+ Map activityIdToName = new HashMap();
+
for (ToolActivity activity : activityToUserDTOMap.keySet()) {
//find userDto corresponding to the user
@@ -1332,6 +1365,7 @@
String activityRowName = (groupName != null && groupId != null)
? activity.getTitle() + " (" + groupName + ")"
: activity.getTitle();
+ activityIdToName.put(activity.getActivityId(), activityRowName);
String startDate = (userDto.getStartDate() == null) ? ""
: FileUtil.EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT.format(userDto.getStartDate());
@@ -1348,6 +1382,68 @@
}
}
+ // check if learner has restarted the lesson and has archived marks
+ boolean hasArchivedMarks = gradebookDAO.hasArchivedMarks(lesson.getLessonId(), learner.getUserId());
+ if (hasArchivedMarks) {
+ // "Previous attempts" row
+ ExcelCell[] attemptsRow = new ExcelCell[1];
+ attemptsRow[0] = new ExcelCell(getMessage("gradebook.columntitle.attempts"), true);
+ rowList.add(attemptsRow);
+
+ List lessonArchives = gradebookDAO
+ .getArchivedLessonMarks(lesson.getLessonId(), learner.getUserId());
+ int attemptOrder = lessonArchives.size();
+ // go through each lesson attempt
+ for (GradebookUserLessonArchive lessonArchive : lessonArchives) {
+ // lesson attempt header
+ ExcelCell[] attemptRow = new ExcelCell[4];
+ attemptRow[0] = new ExcelCell(getMessage("gradebook.columntitle.attempt"), true);
+ attemptRow[1] = new ExcelCell(attemptOrder, true);
+ attemptRow[1].setAlignment(ExcelCell.ALIGN_LEFT);
+ attemptRow[2] = new ExcelCell(getMessage("gradebook.columntitle.lesson.mark"), true);
+ attemptRow[3] = new ExcelCell(lessonArchive.getMark(), false);
+ rowList.add(attemptRow);
+
+ // go throuch each activity and see if there is an archived mark for it
+ for (ToolActivity activity : activityToUserDTOMap.keySet()) {
+ ExcelCell[] activityDataRow = null;
+ List activityArchives = gradebookDAO
+ .getArchivedActivityMarks(activity.getActivityId(), learner.getUserId());
+ Date archiveDate = lessonArchive.getArchiveDate();
+ for (GradebookUserActivityArchive activityArchive : activityArchives) {
+ // if it matches, we found an archived mark for this activity and this attempt
+ if (archiveDate.equals(activityArchive.getArchiveDate())) {
+ LearnerProgressArchive learnerProgress = learnerProgressDAO.getLearnerProgressArchive(
+ lesson.getLessonId(), learner.getUserId(), lessonArchive.getArchiveDate());
+ activityDataRow = new ExcelCell[5];
+ activityDataRow[0] = new ExcelCell(activityIdToName.get(activity.getActivityId()),
+ false);
+ Date startDate = getActivityStartDate(learnerProgress, activity, null);
+ activityDataRow[1] = new ExcelCell(
+ startDate == null ? ""
+ : FileUtil.EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT.format(startDate),
+ false);
+ Date finishDate = getActivityFinishDate(learnerProgress, activity, null);
+ activityDataRow[2] = new ExcelCell(
+ finishDate == null ? ""
+ : FileUtil.EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT.format(finishDate),
+ false);
+ activityDataRow[3] = new ExcelCell(
+ getActivityDuration(learnerProgress, activity) / 1000, false);
+ activityDataRow[4] = new ExcelCell(activityArchive.getMark(), false);
+ break;
+ }
+ }
+ if (activityDataRow == null) {
+ activityDataRow = new ExcelCell[1];
+ activityDataRow[0] = new ExcelCell(activityIdToName.get(activity.getActivityId()), false);
+ }
+ rowList.add(activityDataRow);
+ }
+ attemptOrder--;
+ }
+ }
+
rowList.add(GradebookService.EMPTY_ROW);
}
@@ -1850,7 +1946,7 @@
}
}
}
-
+
@Override
public void updateActivityMark(Double mark, String feedback, Integer userID, Long toolSessionID,
Boolean markedInGradebook) {
@@ -2570,4 +2666,8 @@
public void setMessageService(MessageService messageService) {
this.messageService = messageService;
}
+
+ public void setOutcomeService(IOutcomeService outcomeService) {
+ this.outcomeService = outcomeService;
+ }
}
\ No newline at end of file
Index: lams_monitoring/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -rba0681dd1dd7fe2e323b821a63dca75415a142cd -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ba0681dd1dd7fe2e323b821a63dca75415a142cd)
+++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -471,6 +471,9 @@
label.reset =Reset
label.time.is.expired =Time has expired.
lesson.task.tool =Tool contribution
+outcome.authoring.title =Learning outcomes
+outcome.authoring.input =Search and select by outcome name or code
+outcome.authoring.existing =Added outcomes
+outcome.authoring.existing.none =none
-
#======= End labels: Exported 465 labels for en AU =====
Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/action/NbAuthoringAction.java
===================================================================
diff -u -r8236da64800893104429c9b88f89d500c505a9a1 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/action/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision 8236da64800893104429c9b88f89d500c505a9a1)
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/action/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -155,6 +155,7 @@
}
request.setAttribute(FORM, nbForm);
+ request.setAttribute("outcomes", null);
return mapping.findForward(NoticeboardConstants.AUTHOR_PAGE);
}
Index: lams_tool_zoom/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r78b2c47972525e5dc3615852c907b1722c4c7ea2 -rab8e7f342fae4b67ebbd6078f4deee402a7defd6
--- lams_tool_zoom/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 78b2c47972525e5dc3615852c907b1722c4c7ea2)
+++ lams_tool_zoom/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6)
@@ -67,5 +67,8 @@
error.api.none.configured =There are no Zoom API keys configured by the administrator. You are not able to create a Zoom meeting.
error.api.reuse =All configured API keys are in use at the moment. If you decide to start your meeting, another teacher's meeting will be stopped.
sysadmin.maintain= Back to admin panel
-
+outcome.authoring.title =Learning outcomes
+outcome.authoring.input =Search and select by outcome name or code
+outcome.authoring.existing =Added outcomes
+outcome.authoring.existing.none =none
#======= End labels: Exported 64 labels for en AU =====
Fisheye: Tag ab8e7f342fae4b67ebbd6078f4deee402a7defd6 refers to a dead (removed) revision in file `lams_central/web/css/outcome.css'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag ab8e7f342fae4b67ebbd6078f4deee402a7defd6 refers to a dead (removed) revision in file `lams_central/web/css/outcome.scss'.
Fisheye: No comparison available. Pass `N' to diff?