Skip to content

Commit

Permalink
SAM-1999 Show Last Modified date after import
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/sam/trunk@314891 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
juanjmerono committed Oct 24, 2014
1 parent 05b2bcb commit c4954b2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.FileNotFoundException;
import java.io.Serializable;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;

Expand All @@ -50,6 +51,7 @@
import org.sakaiproject.tool.assessment.integration.context.IntegrationContextFactory;
import org.sakaiproject.tool.assessment.integration.helper.ifc.GradebookServiceHelper;
import org.sakaiproject.tool.assessment.qti.constants.QTIVersion;
import org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil;
import org.sakaiproject.tool.assessment.qti.util.XmlUtil;
import org.sakaiproject.tool.assessment.services.assessment.AssessmentService;
import org.sakaiproject.tool.assessment.services.qti.QTIService;
Expand Down Expand Up @@ -345,10 +347,19 @@ private void processFile(String fileName, String uploadFile, boolean isRespondus

ArrayList list = assessmentService.getBasicInfoOfAllActiveAssessments(
AssessmentFacadeQueries.TITLE,true);
TimeUtil tu = new TimeUtil();
String display_dateFormat= ContextUtil.getLocalizedString("org.sakaiproject.tool.assessment.bundle.GeneralMessages","output_data_picker_w_sec");
SimpleDateFormat displayFormat = new SimpleDateFormat(display_dateFormat, new ResourceLoader().getLocale());
Iterator iter = list.iterator();
while (iter.hasNext()) {
AssessmentFacade assessmentFacade= (AssessmentFacade) iter.next();
assessmentFacade.setTitle(FormattedText.convertFormattedTextToPlaintext(assessmentFacade.getTitle()));
try {
String lastModifiedDateDisplay = tu.getDisplayDateTime(displayFormat, assessmentFacade.getLastModifiedDate());
assessmentFacade.setLastModifiedDateForDisplay(lastModifiedDateDisplay);
} catch (Exception ex) {
log.warn("Unable to format date: " + ex.getMessage());
}
}
authorBean.setAssessments(list);
}
Expand Down

0 comments on commit c4954b2

Please sign in to comment.