Skip to content

Commit

Permalink
Merge pull request sakaiproject#1481 from plukasew/SAK-30154
Browse files Browse the repository at this point in the history
SAK-30154: Improve awkward animations for assignments allow resubmission and send feedback panels
  • Loading branch information
bjones86 committed Jan 4, 2016
2 parents 9dedfb9 + 1052b46 commit 804b475
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,6 @@ public class AssignmentAction extends PagedResourceActionII
private static final String ALLPURPOSE_RETRACT_MIN = "allPurpose_retractMin";
private static final String ALLPURPOSE_TO_DELETE = "allPurpose.toDelete";

private static final String SHOW_ALLOW_RESUBMISSION = "show_allow_resubmission";

private static final String SHOW_SEND_FEEDBACK = "show_send_feedback";

private static final String RETURNED_FEEDBACK = "feedback_returned_to_selected_users";

private static final String OW_FEEDBACK = "feedback_overwritten";
Expand Down Expand Up @@ -2048,11 +2044,6 @@ protected String build_student_preview_submission_context(VelocityPortlet portle
// put the resubmit information into context
assignment_resubmission_option_into_context(context, state);

if(state.getAttribute(SHOW_SEND_FEEDBACK) != null)
{
context.put("showSendFeedback", Boolean.TRUE);
state.removeAttribute(SHOW_SEND_FEEDBACK);
}
if (state.getAttribute(SAVED_FEEDBACK) != null)
{
context.put("savedFeedback", Boolean.TRUE);
Expand Down Expand Up @@ -4234,11 +4225,6 @@ protected String build_instructor_grade_assignment_context(VelocityPortlet portl
}
}

// whether to show the resubmission choice
if (state.getAttribute(SHOW_ALLOW_RESUBMISSION) != null)
{
context.put("showAllowResubmission", Boolean.TRUE);
}
// put the re-submission info into context
assignment_resubmission_option_into_state(assignment, null, state);
putTimePropertiesInContext(context, state, "Resubmit", ALLOW_RESUBMIT_CLOSEMONTH, ALLOW_RESUBMIT_CLOSEDAY, ALLOW_RESUBMIT_CLOSEYEAR, ALLOW_RESUBMIT_CLOSEHOUR, ALLOW_RESUBMIT_CLOSEMIN);
Expand Down Expand Up @@ -10875,8 +10861,6 @@ public void doGrade_assignment(RunData data)

// clean state attribute
state.removeAttribute(USER_SUBMISSIONS);
state.removeAttribute(SHOW_ALLOW_RESUBMISSION);
state.removeAttribute(SHOW_SEND_FEEDBACK);
state.removeAttribute(SAVED_FEEDBACK);
state.removeAttribute(OW_FEEDBACK);
state.removeAttribute(RETURNED_FEEDBACK);
Expand Down Expand Up @@ -16877,9 +16861,7 @@ public void doSave_resubmission_option(RunData data)
}
}
}

// make sure the options are exposed in UI
state.setAttribute(SHOW_ALLOW_RESUBMISSION, Boolean.TRUE);

}

public void doSave_send_feedback(RunData data) {
Expand Down Expand Up @@ -16936,8 +16918,6 @@ public void doSave_send_feedback(RunData data) {
}
}

// make sure the options are exposed in UI
state.setAttribute(SHOW_SEND_FEEDBACK, Boolean.TRUE);
}


Expand Down
66 changes: 33 additions & 33 deletions assignment/assignment-tool/tool/src/webapp/js/assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,43 +820,43 @@ ASN.doTagsListAction = function( formID, value, providerID )
form.providerId.value = providerID;
};

ASN.showAllowResubmission = function()
ASN.toggleAllowResubmissionPanel = function()
{
document.getElementById('allowResubmission_shown').style.display="inline";
document.getElementById('allowResubmission_hidden').style.display="none";
$('#allowResubmission_shownInner').addClass('highLightBlock').fadeIn(2000,function(){
$(this).removeClass('highLightBlock');
});
document.getElementById('allowResToggle').value="checked";
ASN.resizeFrame('grow');
};

ASN.hideAllowResubmission = function()
{
$('#allowResubmission_shownInner').fadeOut('fast', function() {
document.getElementById('allowResubmission_shown').style.display="none";
document.getElementById('allowResubmission_hidden').style.display="inline";
document.getElementById('allowResToggle').value="";
});
};
var panel = document.getElementById("allowResubmissionPanelContent");
$(panel).slideToggle(200);
var expandImg = document.getElementById("expandAllowResub");
var collapseImg = document.getElementById("collapseAllowResub");
ASN.swapDisplay(expandImg, collapseImg);

var allow = document.getElementById("allowResToggle");
if (allow.value === "checked")
{
allow.value = "";
}
else
{
allow.value = "checked";
}
}

ASN.showSendFeedback = function()
ASN.toggleSendFeedbackPanel = function()
{
document.getElementById('sendFeedback_shown').style.display="inline";
document.getElementById('sendFeedback_hidden').style.display="none";
$('#sendFeedback_shownInner').addClass('highLightBlock').fadeIn(2000,function(){
$(this).removeClass('highLightBlock');
});
ASN.resizeFrame('grow');
};

ASN.hideSendFeedback = function()
var panel = document.getElementById("sendFeedbackPanelContent");
$(panel).slideToggle(200);
var expandImg = document.getElementById("expandSendFeedback");
var collapseImg = document.getElementById("collapseSendFeedback");
ASN.swapDisplay(expandImg, collapseImg);
var showLabel = document.getElementById("showSendFeedbackLabel");
var hideLabel = document.getElementById("hideSendFeedbackLabel");
ASN.swapDisplay(showLabel, hideLabel);
}

ASN.swapDisplay = function(elem1, elem2)
{
$('#sendFeedback_shownInner').fadeOut('fast', function() {
document.getElementById('sendFeedback_shown').style.display="none";
document.getElementById('sendFeedback_hidden').style.display="inline";
});
};
var tmpDisplay = elem1.style.display;
elem1.style.display = elem2.style.display;
elem2.style.display = tmpDisplay;
}

ASN.toggleIsGroupSubmission = function(checked){
if (checked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
$(document).ready(function(){
ASN.setupToggleAreas('toggleAnchor', 'toggledContent', false, 'fast');

$('#submissionList input:checkbox').click(function(){
if ( $("#submissionList input:checked").length ===0){
ASN.hideAllowResubmission()
ASN.hideSendFeedback()
$('#submissionList input:checkbox').click(function()
{
var feedbackPanel = document.getElementById("sendFeedbackPanelContent");
var resubPanel = document.getElementById("allowResubmissionPanelContent");
var checkedCount = $("#submissionList input:checked").length;

if ( (checkedCount === 0 && feedbackPanel.style.display !== "none")
|| (checkedCount !== 0 && feedbackPanel.style.display === "none") )
{
ASN.toggleSendFeedbackPanel();
}
else{
ASN.showAllowResubmission()
ASN.showSendFeedback()

if ( (checkedCount === 0 && resubPanel.style.display !== "none")
|| (checkedCount !== 0 && resubPanel.style.display === "none") )
{
ASN.toggleAllowResubmissionPanel();
}
});

Expand Down Expand Up @@ -282,19 +290,15 @@
</ul>
</div>
#end
<div id="sendFeedback_hidden" #if (!$!showSendFeedback && $!value_SubmissionType != 4) style="display:block" #else style="display:none" #end>
<p class="discTria">
<a href="javascript:void(0)" onclick="ASN.showSendFeedback();">
<img src="#imageLink("sakai/expand.gif")" alt="$tlang.getString("sendFeedback.show")" border="0" width="13" height="13" align="top" />
$tlang.getString("sendFeedback.show")
</a>
</p>
</div>
<div id="sendFeedback_shown" #if ($!showSendFeedback && $!value_SubmissionType != 4) style="display:block" #else style="display:none"#end>

#if ($!value_SubmissionType != 4)
<div id="sendFeedbackPanel">
<p class="discTria">
<a href="javascript:void(0)" onclick="ASN.hideSendFeedback();">
<img src="#imageLink("sakai/collapse.gif")" alt="$tlang.getString("sendFeedback.hide")" border="0" width="13" height="13" align="top" />
$tlang.getString("sendFeedback.hide")
<a href="javascript:void(0)" onclick="ASN.toggleSendFeedbackPanel();">
<img id="expandSendFeedback" src="#imageLink("sakai/expand.gif")" alt="$tlang.getString("sendFeedback.show")" border="0" width="13" height="13" align="top" />
<img id="collapseSendFeedback" style="display: none;" src="#imageLink("sakai/collapse.gif")" alt="$tlang.getString("sendFeedback.hide")" border="0" width="13" height="13" align="top" />
<span id="showSendFeedbackLabel">$tlang.getString("sendFeedback.show")</span>
<span id="hideSendFeedbackLabel" style="display: none;">$tlang.getString("sendFeedback.hide")</span>
</a>
</p>
#if ($!savedFeedback)
Expand All @@ -313,7 +317,7 @@
$!tlang.getString("sendFeedback.returned")
</div>
#end
<div id="sendFeedback_shownInner" style="display:none">
<div id="sendFeedbackPanelContent" style="display:none;">
<p class="instruction">
$tlang.getString("sendFeedback.instruction"):
</p>
Expand All @@ -328,39 +332,27 @@
</div>
</div>
</div>
<div id="allowResubmission_hidden" #if (!$!showAllowResubmission && $!value_SubmissionType != 4)style="display:block"#else style="display:none"#end>
<input type="hidden" name = "allowResToggle" id = "allowResToggle" value="checked" />
<input type="hidden" name = "allowResToggle" id = "allowResToggle" value="" />
<div id="allowResubmissionPanel">
<p class="discTria">
<a href="javascript:void(0)" onclick="ASN.showAllowResubmission();">
<img src="#imageLink("sakai/expand.gif")" alt="$tlang.getString("allowResubmission.show")" border="0" width="13" height="13" align="top" />
<a href="javascript:void(0)" onclick="ASN.toggleAllowResubmissionPanel();">
<img id="expandAllowResub" src="#imageLink("sakai/expand.gif")" alt="$tlang.getString("allowResubmission.show")" border="0" width="13" height="13" align="top" />
<img id="collapseAllowResub" style="display: none;" src="#imageLink("sakai/collapse.gif")" alt="$tlang.getString("allowResubmission.hide")" border="0" width="13" height="13" align="top" />
#if ($assignment.isGroup())
$tlang.getString("allowResubmission.groups.label")
#else
$tlang.getString("allowResubmission.label")
#end
</a>
</p>
</div>
<div id="allowResubmission_shown" #if ($!showAllowResubmission && $!value_SubmissionType != 4)style="display:block"#else style="display:none"#end>
<p class="discTria">
<a href="javascript:void(0)" onclick="ASN.hideAllowResubmission();">
<img src="#imageLink("sakai/collapse.gif")" alt="$tlang.getString("allowResubmission.hide")" border="0" width="13" height="13" align="top" />
#if ($assignment.isGroup())
$tlang.getString("allowResubmission.groups.label")
#else
$tlang.getString("allowResubmission.label")
#end
</a>
</p>
<div id="allowResubmission_shownInner" style="display:none">
<div id="allowResubmissionPanelContent" style="display:none; overflow: hidden;">
<p class="instruction">
#if ($assignment.isGroup())
$tlang.getString("allowResubmission.groups.instruction")
#else
$tlang.getString("allowResubmission.instruction")
#end
</p>
##show it only for those assignments not of type non-electronic submission
<p class="shorttext" id="allowResubmitNumber">
<label for="allowResubmitNumber">
$tlang.getString("allow.resubmit.number")
Expand Down Expand Up @@ -403,8 +395,9 @@
<input type="submit" class="active" onclick="SPNR.disableControlsAndSpin( this, escapeList );" name="eventSubmit_doSave_resubmission_option" value="$tlang.getString("update")" accesskey="s" />
</div>
</p>
</div>
</div> <!-- allowResubmissionPanelContent -->
</div>
#end
#if($disableGrade)
<div class="highlight">$tlang.getFormattedMessage("peerassessment.cantgradewithdate", $assignment.getPeerAssessmentPeriod().toStringLocalFull())</div>
#end
Expand Down

0 comments on commit 804b475

Please sign in to comment.