Skip to content

Commit

Permalink
LSNBLDR-517; phase 2 of LEAP reimplementation
Browse files Browse the repository at this point in the history
  • Loading branch information
clhedrick committed Jul 21, 2015
1 parent f94ce2f commit d8a4a48
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,12 @@ public static String toggleGrouped(String itemId, String csrfToken) {
return null;
}

String grouped = item.getAttribute("groupedWithAbove");
String grouped = item.getAttribute("groupedWithBelow");
if ("true".equals(grouped)) {
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
grouped = "false";
} else {
item.setAttribute("groupedWithAbove", "true");
item.setAttribute("groupedWithBelow", "true");
grouped = "true";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public enum Status {
private boolean required;
private boolean subrequirement;
private boolean prerequisite;
private boolean breakabove;
private boolean breakbelow;
private boolean newWindow;
private String dropDown;
private String points;
Expand Down Expand Up @@ -790,8 +790,8 @@ public void setPrerequisite(boolean prerequisite) {
this.prerequisite = prerequisite;
}

public void setBreakabove(boolean breakabove) {
this.breakabove = breakabove;
public void setBreakbelow(boolean breakbelow) {
this.breakbelow = breakbelow;
}

public void setNewWindow(boolean newWindow) {
Expand Down Expand Up @@ -1069,10 +1069,10 @@ else if (filterSpec.equalsIgnoreCase("none"))

item.setHtml(html);
item.setPrerequisite(this.prerequisite);
if (this.breakabove)
item.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
item.setAttribute("groupedWithBelow", "true");
else
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
setItemGroups(item, selectedGroups);
update(item);
} else {
Expand Down Expand Up @@ -2614,10 +2614,10 @@ public String editItem() {
i.setName(name);
i.setDescription(description);
i.setRequired(required);
if (this.breakabove)
i.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
i.setAttribute("groupedWithBelow", "true");
else
i.removeAttribute("groupedWithAbove");
i.removeAttribute("groupedWithBelow");

i.setPrerequisite(prerequisite);
i.setSubrequirement(subrequirement);
Expand Down Expand Up @@ -2882,10 +2882,10 @@ public String addForum() {
i.setSakaiId(selectedEntity);
i.setName(selectedObject.getTitle());
}
if (this.breakabove)
i.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
i.setAttribute("groupedWithBelow", "true");
else
i.removeAttribute("groupedWithAbove");
i.removeAttribute("groupedWithBelow");

// reset assignment-specific stuff
i.setDescription("");
Expand Down Expand Up @@ -2962,10 +2962,10 @@ public String addAssignment() {
// i.setDescription("(" + messageLocator.getMessage("simplepage.due") + " " + df.format(selectedObject.getDueDate()) + ")");
// else
// i.setDescription(null);
if (this.breakabove)
i.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
i.setAttribute("groupedWithBelow", "true");
else
i.removeAttribute("groupedWithAbove");
i.removeAttribute("groupedWithBelow");
update(i);
}
} else {
Expand Down Expand Up @@ -3617,10 +3617,10 @@ public String addQuiz() {
}
// reset quiz-specific stuff
i.setDescription("");
if (this.breakabove)
i.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
i.setAttribute("groupedWithBelow", "true");
else
i.removeAttribute("groupedWithAbove");
i.removeAttribute("groupedWithBelow");
update(i);
}
} else // no, add new item
Expand Down Expand Up @@ -3727,10 +3727,10 @@ public String editMultimedia() {
i.setDescription(description);
i.setHtml(mimetype);
i.setPrerequisite(this.prerequisite);
if (this.breakabove)
i.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
i.setAttribute("groupedWithBelow", "true");
else
i.removeAttribute("groupedWithAbove");
i.removeAttribute("groupedWithBelow");
update(i);
setItemGroups(i, selectedGroups);
return "success";
Expand Down Expand Up @@ -5800,10 +5800,10 @@ public SecurityAdvice isAllowed(String userId, String function, String reference
// remember who added it, for permission checks
item.setAttribute("addedby", getCurrentUserId());

if (this.breakabove)
item.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
item.setAttribute("groupedWithBelow", "true");
else
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
item.setPrerequisite(this.prerequisite);

if (mimeType != null) {
Expand Down Expand Up @@ -6004,10 +6004,10 @@ public SecurityAdvice isAllowed(String userId, String function, String reference
item.setHeight(height);
item.setWidth(width);
item.setDescription(description);
if (this.breakabove)
item.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
item.setAttribute("groupedWithBelow", "true");
else
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
item.setPrerequisite(this.prerequisite);

update(item);
Expand Down Expand Up @@ -6086,10 +6086,10 @@ public void updateMovie() {
item.setHeight(height);
item.setWidth(width);
item.setDescription(description);
if (this.breakabove)
item.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
item.setAttribute("groupedWithBelow", "true");
else
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
item.setPrerequisite(prerequisite);
item.setHtml(mimetype);
update(item);
Expand Down Expand Up @@ -6206,10 +6206,10 @@ public String updateComments() {
comment.setAnonymous(anonymous);
setItemGroups(comment, selectedGroups);
comment.setRequired(required);
if (this.breakabove)
comment.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
comment.setAttribute("groupedWithBelow", "true");
else
comment.removeAttribute("groupedWithAbove");
comment.removeAttribute("groupedWithBelow");
comment.setPrerequisite(prerequisite);

if(maxPoints == null || maxPoints.equals("")) {
Expand Down Expand Up @@ -6644,10 +6644,10 @@ public String updateQuestion() {
item.setGradebookPoints(pointsInt);
else
item.setGradebookPoints(null);
if (this.breakabove)
item.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
item.setAttribute("groupedWithBelow", "true");
else
item.removeAttribute("groupedWithAbove");
item.removeAttribute("groupedWithBelow");
item.setPrerequisite(prerequisite);

update(item);
Expand Down Expand Up @@ -6810,10 +6810,10 @@ public String updateStudent() {
page.setShowComments(comments);
page.setForcedCommentsAnonymous(forcedAnon);
page.setRequired(required);
if (this.breakabove)
page.setAttribute("groupedWithAbove", "true");
if (this.breakbelow)
page.setAttribute("groupedWithBelow", "true");
else
page.removeAttribute("groupedWithAbove");
page.removeAttribute("groupedWithBelow");
page.setPrerequisite(prerequisite);
page.setGroupOwned(groupOwned);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void fillComponents(UIContainer tofill, ViewParameters viewparams, Compon
}

isPrerequisite = i.isPrerequisite();
hasBreak = "true".equals(i.getAttribute("groupedWithAbove"));
hasBreak = "true".equals(i.getAttribute("groupedWithBelow"));
}

if (simplePageBean.canEditPage()) {
Expand All @@ -155,7 +155,7 @@ public void fillComponents(UIContainer tofill, ViewParameters viewparams, Compon
richTextEvolver.evolveTextInput(instructions);

UIOutput.make(form, "break-block");
UIBoundBoolean.make(form, "question-break", "#{simplePageBean.breakabove}",hasBreak);
UIBoundBoolean.make(form, "question-break", "#{simplePageBean.breakbelow}",hasBreak);

if (page.getOwner() == null) {
// these options don't apply on student pages
Expand Down
Loading

0 comments on commit d8a4a48

Please sign in to comment.