Skip to content

Commit

Permalink
SAM-2962 Can not save automatic submission settings in template as ad…
Browse files Browse the repository at this point in the history
…min on Oracle (sakaiproject#3971)
  • Loading branch information
alejandrogj authored and ottenhoff committed Feb 24, 2017
1 parent 560336b commit 2ea6eb6
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Optional;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
Expand Down Expand Up @@ -351,15 +352,18 @@ public boolean updateAssessment(TemplateBean templateBean)
delegate.deleteAllMetaData((AssessmentTemplateData)template);

LOG.debug("**** after deletion of meta data");
HashSet set = new HashSet();
HashSet<AssessmentMetaData> set = new HashSet<>();
Iterator iter = templateBean.getValueMap().keySet().iterator();
while (iter.hasNext())
{
String label = (String) iter.next();
String value = (String) templateBean.getValueMap().get(label).toString();
//log.info("Label: " + label + ", Value: " + value);
AssessmentMetaData data =
new AssessmentMetaData(template, label, value);

Object value = templateBean.getValueMap().get(label);
String metadata = Optional.ofNullable(value)
.map(Object::toString)
.orElse("");

AssessmentMetaData data = new AssessmentMetaData(template, label, metadata);
set.add(data);
}
template.setAssessmentMetaDataSet(set);
Expand Down

0 comments on commit 2ea6eb6

Please sign in to comment.