Skip to content

Commit

Permalink
SAK-33337 Assignments display the correct order of assignments (sakai…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Sep 11, 2017
1 parent edf3e00 commit 48c1fca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11782,7 +11782,7 @@ protected int sizeResources(SessionState state) {
String mode = (String) state.getAttribute(STATE_MODE);
String contextString = (String) state.getAttribute(STATE_CONTEXT_STRING);
// all the resources for paging
Collection returnResources = new ArrayList();
List returnResources = new ArrayList();
boolean hasOneAnon = false;

boolean allowAddAssignment = assignmentService.allowAddAssignment(contextString);
Expand All @@ -11795,7 +11795,7 @@ protected int sizeResources(SessionState state) {

if (allowAddAssignment && view.equals(MODE_LIST_ASSIGNMENTS)) {
// read all Assignments
returnResources = assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING));
returnResources.addAll(assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING)));
} else if (allowAddAssignment && view.equals(MODE_STUDENT_VIEW)
|| (!allowAddAssignment && assignmentService.allowAddSubmission((String) state.getAttribute(STATE_CONTEXT_STRING)))) {
// in the student list view of assignments
Expand All @@ -11818,12 +11818,12 @@ && getSubmission(a.getId(), (User) state.getAttribute(STATE_USER), "sizeResource
}
} else {
// read all Assignments
returnResources = assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING));
returnResources.addAll(assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING)));
}

state.setAttribute(HAS_MULTIPLE_ASSIGNMENTS, returnResources.size() > 1);
} else if (MODE_INSTRUCTOR_REORDER_ASSIGNMENT.equals(mode)) {
returnResources = assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING));
returnResources.addAll(assignmentService.getAssignmentsForContext((String) state.getAttribute(STATE_CONTEXT_STRING)));
} else if (MODE_INSTRUCTOR_REPORT_SUBMISSIONS.equals(mode)) {
initViewSubmissionListOption(state);
String allOrOneGroup = (String) state.getAttribute(VIEW_SUBMISSION_LIST_OPTION);
Expand Down Expand Up @@ -11997,7 +11997,7 @@ && getSubmission(a.getId(), (User) state.getAttribute(STATE_USER), "sizeResource
}

try {
Collections.sort(new ArrayList(returnResources), ac);
Collections.sort(returnResources, ac);
} catch (Exception e) {
// log exception during sorting for helping debugging
log.warn(this + ":sizeResources mode=" + mode + " sort=" + sort + " ascending=" + ascending + " " + e.getStackTrace());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@
<input type="text" size="3" value="$count" id="index$count"/>
<input type="hidden" size="3" id="holder$count" value="$count" tabindex="-2"/>
</span>
<span class="title col-md-6 col-sm-6 col-xs-12" title="$validator.escapeHtml($!assignment.getTitle())">
#if ($!assignment.draft)
<span class="title col-md-6 col-sm-6 col-xs-12" title="$validator.escapeHtml($!assignment.Title)">
#if ($!assignment.Draft)
<em class="highlight" style="font-style:normal">$tlang.getString("gen.dra2")</em>
#end
$validator.escapeHtml($validator.limit($!assignment.getTitle(), 45))
$validator.escapeHtml($validator.limit($!assignment.Title, 45))
</span>
<span class="col-md-3 col-sm-3 col-xs-12">
$!assignment.openTime.toStringLocalFull()
$!assignment.OpenDate.toString()
</span>
<span class="col-md-3 col-sm-3 col-xs-12">
$!assignment.dueTime.toStringLocalFull()
$!assignment.DueDate.toString()
<select name="position_$validator.escapeUrl("$assignment.id")" class="selectSet">
#foreach($i in [1..$assignmentsize])
<option value="$i"#if("$i" == "$count") selected="selected"#end>$i</option>
Expand Down

0 comments on commit 48c1fca

Please sign in to comment.