Index: lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java
===================================================================
diff -u -r5129d828c41c0731ee7889271cffde6421e2146c -r208bc1639c1a44dc829d9f5c70d6f82ce9ceb0e0
--- lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c)
+++ lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision 208bc1639c1a44dc829d9f5c70d6f82ce9ceb0e0)
@@ -31,7 +31,7 @@
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.outcome.Outcome;
+import org.lamsfoundation.lams.outcome.service.IOutcomeService;
import org.lamsfoundation.lams.qb.model.QbCollection;
import org.lamsfoundation.lams.qb.model.QbQuestion;
import org.lamsfoundation.lams.qb.service.IQbService;
@@ -65,6 +65,9 @@
@Autowired
private IQbService qbService;
+ @Autowired
+ private IOutcomeService outcomeService;
+
@RequestMapping("/show")
public String showUserCollections(Model model) throws Exception {
Integer userId = getUserId();
@@ -152,7 +155,8 @@
: null;
boolean hasVersions = qbService.countQuestionVersions(question.getQuestionId()) > 1;
String learningOutcomes = view.equalsIgnoreCase("single")
- ? question.getOutcomes().stream().map(Outcome::getName).collect(Collectors.joining("
"))
+ ? outcomeService.getOutcomeMappings(null, null, null, question.getQuestionId()).stream()
+ .map(m -> m.getOutcome().getName()).collect(Collectors.joining("
"))
: null;
String[] data = { question.getQuestionId().toString(),
Index: lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java
===================================================================
diff -u -r5129d828c41c0731ee7889271cffde6421e2146c -r208bc1639c1a44dc829d9f5c70d6f82ce9ceb0e0
--- lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c)
+++ lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision 208bc1639c1a44dc829d9f5c70d6f82ce9ceb0e0)
@@ -12,9 +12,6 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -24,7 +21,6 @@
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.lamsfoundation.lams.qb.service.IQbService;
-import org.lamsfoundation.lams.outcome.Outcome;
/**
* A question in Question Bank.
@@ -69,7 +65,7 @@
@Column(name = "create_date")
private Date createDate = new Date();
-
+
@Column(name = "content_folder_id")
private String contentFolderId;
@@ -143,12 +139,6 @@
@Fetch(FetchMode.SUBSELECT)
private List units = new ArrayList<>();
- // read-only collection of learning outcomes
- @ManyToMany(fetch = FetchType.EAGER)
- @Fetch(FetchMode.SUBSELECT)
- @JoinTable(name = "lams_outcome_mapping", joinColumns = @JoinColumn(name = "qb_question_id", referencedColumnName = "question_id", updatable = false, insertable = false), inverseJoinColumns = @JoinColumn(name = "outcome_id"))
- private List outcomes = new ArrayList<>();
-
// checks if important parts of another question are the same as current question's.
// And if not, determines whether another question/version be created.
public int isQbQuestionModified(QbQuestion oldQuestion) {
@@ -288,7 +278,7 @@
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
-
+
public String getContentFolderId() {
return contentFolderId;
}
@@ -478,12 +468,4 @@
public void setUnits(List units) {
this.units = units;
}
-
- public List getOutcomes() {
- return outcomes;
- }
-
- public void setOutcomes(List outcomes) {
- this.outcomes = outcomes;
- }
}
\ No newline at end of file