## Include other javascript specific to this page #javascript("/sakai-assignment-tool/js/studentViewSubmission.js")
## submission times #set($timeReturned=false) #set($timeReturned=$submission.TimeReturned) #set($timeSubmitted=false) #set($timeSubmitted=$submission.TimeSubmitted) #set($submitted=false) #set($submitted=$submission.getSubmitted()) #set($returned=false) #set($returned=$submission.getReturned()) #set($closeTime = false) #set($closeTime = $assignment.CloseTime) #set($allowResubmitNumber="0") #set($allowResubmitNumber = $submission.getProperties().getProperty("allow_resubmit_number")) #if(!$!allowResubmitNumber.equals("0")) #set($allowResubmitCloseTimeString=$submission.getProperties().getProperty("allow_resubmit_closeTime")) #if($!allowResubmitCloseTimeString) #set($allowResubmitCloseTime=$!TimeService.newTime($!LongObject.parseLong($!allowResubmitCloseTimeString))) #end #end #if ($!submission && $!allowResubmitNumber.equals("0")) ##override the close time setting for assignment by submission's individual setting #set($closeTime = $submission.CloseTime) #end #set ($submissionType = $assignment.getContent().getTypeOfSubmission()) #if ($allowSubmit && !$submission && $!closeTime && $currentTime.after($closeTime) )
$tlang.getString("stuviewsubm.theclodat")
#end #if ($!canSubmit) #if ($alertMessage)
$tlang.getString("gen.alert") $alertMessage
#end #if ($!submission && $timeSubmitted) ## if there is a submitted submission ## get the properies #if ($!allowAddAssignment)

$tlang.getString("viewexampleassign")

#else

#if(!$submitted) ## draft submission ## $tlang.getString("viewassign") ## no need to show status if this is for an non-electronic submission type of assignment #if (!$!nonElectronicType) ## ## - $tlang.getString("gen.inpro") ## #end #end #if ($!timeReturned && $!timeSubmitted && $!timeReturned.after($!timeSubmitted)) $validator.escapeHtml($assignment.getTitle()) - $tlang.getString("resubmit") #end

#end #if ($returned) #if ($!timeSubmitted && $!timeReturned && $!timeReturned.after($!timeSubmitted))

$tlang.getString("stuviewsubm.asshasbee4") $submission.TimeReturned.toStringLocalFull(). $tlang.getString("stuviewsubm.plesub")

#else

$tlang.getString("stuviewsubm.asshasbee3") $submission.TimeSubmitted.toStringLocalFull(). #if ($!timeSubmitted && $!timeSubmitted.after($assignment.DueTime)) $tlang.getString("gen.late") #end

#end #elseif ($submission.getGraded() && ($submission.getGradeReleased() || $returned)) $tlang.getString("stuviewsubm.asshasbee2") #elseif (!$submission.getSubmitted()) $submission.getStatus() #else

$tlang.getString("gen.hasbee") $submission.TimeSubmitted.toStringLocalFull()

#if ($!timeSubmitted && $!timeSubmitted.after($assignment.DueTime)) $tlang.getString("gen.late") #end #end #else #if ($!allowAddAssignment)

$tlang.getString("subexampleassign")

#else

$tlang.getString("gen.assig") ## no need to show status if this is for an non-electronic submission type of assignment #if (!$!nonElectronicType) - $tlang.getString("gen.inpro") #end

#end ## TEXT_ONLY_ASSIGNMENT_SUBMISSION = 1; ## ATTACHMENT_ONLY_ASSIGNMENT_SUBMISSION = 2; ## TEXT_AND_ATTACHMENT_ASSIGNMENT_SUBMISSION = 3; ## NON_ELECTRONIC_ASSIGNMENT_SUBMISSION = 4; ## SINGLE_ATTACHMENT_SUBMISSION = 5

#if (($submissionType==1) || ($submissionType==3)) $tlang.getString("stuviewsubm.asshasnot") #elseif ($submissionType==2) $tlang.getString("stuviewsubm.assattonly") #end #if($assignment.getAllowPeerAssessment())

#if($assignment.getPeerAssessmentAnonEval()) $tlang.getString("stuviewsubm.peerreviewanon") #else $tlang.getString("stuviewsubm.peerreview") #end
#end

#end #end ##

$tlang.getString("gen.assdet")

$tlang.getString("gen.title")
#assignmentTitleIcon($assignment) $validator.escapeHtml($assignment.getTitle()) #set ($deleted = false) #set ($deleted = $assignment.getProperties().getProperty($assignment.getProperties().getNamePropAssignmentDeleted())) #if ($!deleted.equalsIgnoreCase("true")) (Assignment has been deleted) #end
$tlang.getString("gen.due")
#set($allowUpdateAssignment=$!service.allowUpdateAssignment($assignment.Reference))
#if ($assignment.getContent().getHideDueDate() != "true" || $!allowUpdateAssignment) $!assignment.dueTime.toStringLocalFull() #end
##resubmit number #if ($submissionType != 4)
$tlang.getString("allow.resubmit.number")
#if ($!resubmitNumber) $resubmitNumber #else 0 #end
## resubmit close time #if($!resubmitNumber && !$!resubmitNumber.equals("0") )
$tlang.getString("allow.resubmit.closeTime")
$resubmitCloseTime
#end #end ## no need to show status if this is for an non-electronic submission type of assignment #if (!$!nonElectronicType)
$tlang.getString("gen.status")
#if ($!submission) #if ($submitted && $!timeSubmitted) #if ($returned) #if ($!timeReturned && $!timeSubmitted && $!timeReturned.after($!timeSubmitted)) $tlang.getString("gen.retu") $submission.TimeReturned.toStringLocalFull() #else $tlang.getString("gen.resub") $submission.TimeSubmitted.toStringLocalFull() #if ($!timeSubmitted && $!timeSubmitted.after($assignment.DueTime)) $tlang.getString("gen.late") #end #end #elseif ($submission.getGraded() && $submission.getGradeReleased()) #if ($!withGrade) $tlang.getString("grad3") #else $tlang.getString("gen.commented") #end #else $tlang.getString("gen.subm4") $submission.timeSubmitted.toStringLocalFull() #if ($!timeSubmitted && $!timeSubmitted.after($assignment.DueTime)) $tlang.getString("gen.late2") #end #end #else $tlang.getString("gen.inpro") #end #else $tlang.getString("gen.notsta") #end
#end #if ($withGrade) #set ($gradeScale = $assignment.getContent().getTypeOfGradeString()) #if ($submission.getGraded() && $submission.getGradeReleased())
$tlang.getString("gen.gra")
#if ($assignment.getContent().TypeOfGrade != 1) #if($!override)$override#else$submission.GradeDisplay#end #else $tlang.getString("gen.nograd") #end #if ($gradeTypeTable.get($assignment.getContent().getTypeOfGrade()) == $!tlang.getString("points")) ($tlang.getString("grade.max") $assignment.getContent().getMaxGradePointDisplay()) #end #if($scoringComponentEnabled) #parse ("/vm/assignment/chef_assignments_scoring_agent.vm") #end
$tlang.getString("gen.grasca")
$gradeScale #if ($gradeTypeTable.get($assignment.getContent().getTypeOfGrade()) == $!tlang.getString("points")) ($tlang.getString("grade.max") $assignment.getContent().getMaxGradePointDisplay()) #end #if($scoringComponentEnabled) #parse ("/vm/assignment/chef_assignments_scoring_agent.vm") #end
#end #end ##show alert when assignment is modified and the modified date is after its open date #set($newAssignment="false") #set($newAssignment=$assignment.getProperties().getProperty("newAssignment")) #if ($assignment.getTimeLastModified().after($assignment.getOpenTime()) && !$!newAssignment.equalsIgnoreCase("true"))
$tlang.getString("gen.modbyins")
$assignment.getTimeLastModified().toStringLocalFull()
#end #if($!submitted && $!timeSubmitted && $allowReviewService && $assignment.getContent().AllowReviewService && $assignment.getContent().AllowStudentViewReport)
$reviewServiceName $tlang.getString("review.report")
#set($reviewResults=$submission.ContentReviewResults) #if ($reviewResults.size() >= 3)
$reviewResults.size() $tlang.getString("review.reports")
#end
#end #if ($!submission && $!submission.getSubmissionLog().size() > 0)
$tlang.getString("gen.history")
#foreach ($entry in $submission.getSubmissionLog()) $entry
#end
#end

$tlang.getString("gen.instr")

#if ($!assignment.getContent().getInstructions().length()>0)
$validator.escapeHtmlFormattedText($!assignment.getContent().getInstructions())
#end ## assignment attachment #set ($size = 0) #set ($props = false) #foreach ($attachment in $assignment.getContent().getAttachments()) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size > 0)

$tlang.getString("gen.addres2")

##end #end ## model answer #if($allowViewModelAnswer)

$validator.escapeHtml($!assignmentModelAnswerItem.getText())

#set ($mAttachments = $!assignmentModelAnswerItem.getAttachmentObjectSet())
#end #if ($!allowReadAssignmentNoteItem)
$validator.escapeHtml($!assignmentNoteItem.getNote())
#end ##all purpose #if ($!allowViewAllPurposeItem)

$validator.escapeHtml($!assignmentAllPurposeItem.getTitle())

$validator.escapeHtml($!assignmentAllPurposeItem.getText())

#set ($aAttachments = $!assignmentAllPurposeItem.getAttachmentObjectSet())
#end #if ($taggable) #parse ("/vm/assignment/chef_assignments_tags_list.vm") #end
#if ($returned)

$tlang.getString("gen.resubmission")

#else

$tlang.getString("gen.submission")

#end ## show special instruction if this is for an non-electronic submission type of assignment #if ($!nonElectronicType)

$tlang.getString("nonelec_instruction")

## show feedbacks if any #if ($returned && $!timeReturned) #if (($!submission.FeedbackComment) && ($submission.FeedbackComment.trim().length()>0)) #if ($submissionType==2)

$tlang.getString("gen.addinst2")

#else

$tlang.getString("gen.addinst")

#end
$validator.escapeHtmlFormattedText($submission.FeedbackComment)
#else #end ## for returned (not resubmitted ) submission, show the instructor feedback #if ($!prevFeedbackComment && $!prevFeedbackComment.trim().length() > 0)

expandcollapse $tlang.getString("gradingsub.prefee2")

$cheffeedbackhelper.showPrevFeedback($cheffeedbackhelper.escapeAssignmentFeedback($!prevFeedbackComment))
#end #set ($size = 0) #set ($props = false) #set ($feedbackAttachments = $submission.FeedbackAttachments) #set ($size = 0) #set ($props = false) #foreach ($attachment in $feedbackAttachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size == 0) ##$tlang.getString("gen.noatt") #else

$tlang.getString("gen.addinstatts")

#end #end ##just show a simple done button for non-electronic submission type
#else
#if ($!canSubmit) ## if a draft submission or the submission has been returned and has not yet submitted ## 1- text only; 2-attachment only; 3-text and attachment #set ( $submissionType = $assignment.getContent().getTypeOfSubmission()) #if ($!assignment.isGroup())

$tlang.getString("group.select.represent")

#if ($!groups) #set ($size = 0) #set ($listDisplay="block") #set($aoGroup = $!site.getGroup($!originalGroup)) #if ($aoGroup) #end #foreach ($group in $!groups) #set ($size = $size + 1) #end #if ($size == 0) #end
#if ($!group_size.equals("1")) #set($selected=true) #else #set($selected=false) #set($aGroup = $!site.getGroup($!selectedGroup)) #if ($!group.Id == $!aGroup.Id) #set($selected = true) #end #end ##mozilla does not resize table children dynamically , so set here #set($gusers = $assignmentService.getSortedGroupUsers($group)) #foreach ($user in $gusers) $user.getDisplayName() ##$!userDirectoryService.getUser($user).getDisplayName() #if ($velocityCount < $gusers.size()),#end #end #set($description = $group.Description)
$validator.escapeHtml($!description)
$tlang.getString("group.must.member")
#else $tlang.getString("group.must.member") #end #end ## We are allowing the instructor to submit as long as assignment is not non-electronic and not deleted #if (!$submissionType != 4 && !$!deleted.equalsIgnoreCase("true") && $!allowAddAssignment && $!allowSubmitByInstructor && $!student)

$tlang.getString("submitforstudent")

$student.getDisplayName()

#end #if (($submissionType==1) || ($submissionType==3)) #if ($!deleted.equalsIgnoreCase("true"))

$tlang.getString("gen.yousub")

##if the assignment has been deleted, disable the action button $validator.escapeHtmlFormattedText($!value_submission_text) #else

$tlang.getString("assignmenttext")

#if ($returned) $tlang.getString("stuviewsubm.entbelo") #else #if ($submissionType==1) $tlang.getString("gen.theassall6") #elseif ($submissionType==3) $tlang.getString("gen.theassall4") #end #end #if ($plagiarismNote)

$reviewIndicator $plagiarismNote #if ($plagiarismFileTypes) $plagiarismFileTypes #end

#end

#chef_setupformattedtextarea($name_submission_text)
## feedback text #set($feedbackText = false) #set($feedbackText = $submission.FeedbackText) #if ($!feedbackText && $feedbackText.length()>0) #if ($!prevFeedbackText)

$tlang.getString("gen.orisub3")

#else

$tlang.getString("gen.orisub2")

#end
$cheffeedbackhelper.escapeAssignmentFeedback($feedbackText)
#end ## for returned submission, show the instructor commented text as well #if ($!prevFeedbackText)

expandcollapse$tlang.getString("gradingsub.prefeetex3")

$cheffeedbackhelper.showPrevFeedback($cheffeedbackhelper.escapeAssignmentFeedback($!prevFeedbackText))
#end #*#else ## for resubmitted submission, show the input disabled
$tlang.getString("gen.yousub")
$validator.escapeHtmlFormattedText($!value_submission_text) #end #end*# #end #else #set ($unsubmittableInline = true) #end #set ($size = 0) #set ($props = false) #foreach ($attachment in $attachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if (($submissionType==2) || ($submissionType==3) || ($submissionType==5)) #if ($submissionType==2 && !$unsubmittableInline)

#if (($submitted && !$returned) || ($returned && $!timeReturned && $!timeSubmitted && $!timeReturned.before($!timeSubmitted)) || ($!closeTime && $currentTime.after($closeTime))) ## for submitted not yet returned submission; or returned by resubmitted submission; or after close date $tlang.getString("stuviewsubm.youatt") #else $tlang.getString("stuviewsubm.theassall2") #end

#end #if (($submissionType == 2) || ($submissionType == 5)) #if ($plagiarismNote)

$reviewIndicator $plagiarismNote #if ($plagiarismFileTypes) $plagiarismFileTypes #end

#end #if ($unsubmittableInline && ""!="$!value_submission_text")

$tlang.getString("gen.orisub")

$tlang.getString("stuviewsubm.typesubhaschanged.inline")

$validator.escapeHtmlFormattedText($!value_submission_text)
#end #end #end #if (($submissionType==2) || ($submissionType==3) || ($submissionType==5 && $size < 2))

#if ($submissionType == 5) $tlang.getString("gen.att.single") #else $tlang.getString("gen.att") #end

#if ($size == 0)

#if ($submissionType == 5) $tlang.getString("gen.noatt.single") #else $tlang.getString("gen.noatt") #end

#else #foreach ($attachment in $attachments) #set ($props = false) #set ($props = $attachment.Properties) #if ($!props) #end #end
#if ($props.getBooleanProperty($props.NamePropIsCollection)) $tlang.getString( #else $tlang.getString( #end $validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName)) #propertyDetails($props)
#end #if (($submissionType==2) || ($submissionType==3)) #end ## for single file upload case #if ($submissionType==5 && $attachments && $attachments.size() == 0)
## add browse resources button here #set($howManySubAttsLinks=$tlang.getString("stuviewsubm.attfromserverlabel.singular"))
#end
#elseif ($submissionType == 5) ## attachments > 1, but the assignment type is single uploaded file only

#if ($submissionType == 5) $tlang.getString("gen.att.single") #else $tlang.getString("gen.att") #end

$tlang.getString("stuviewsubm.typesubhaschanged.singleUploadedFileOnly")

#foreach ($attachment in $attachments) #set ($props = false) #set ($props = $attachment.Properties) #if ($!props)
#attachmentDetails()
#end #end
#set($attachment = $newSingleUploadedFile) #if (!$attachment) #if ($newSingleAttachmentList && !$newSingleAttachmentList.isEmpty()) #set($attachment = $newSingleAttachmentList.get(0)) #end #end #set($props = false) #set($props = $attachment.Properties) #if ($props) #attachmentDetails() $tlang.getString("stuviewsubm.removeatt") $validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName))
#else $tlang.getString("stuviewsubm.uploadnew") #end
#else ## this is where we show any previous attachments when the submission type doesn't allow them #if ($size != 0)

#if ($submissionType == 5) $tlang.getString("gen.stuatt.single") #else $tlang.getString("gen.stuatt") #end

$tlang.getString("stuviewsubm.typesubhaschanged.attach")

#foreach ($attachment in $attachments) #set ($props = false) #set ($props = $attachment.Properties) #if ($!props) #end #end
#if ($props.getBooleanProperty($props.NamePropIsCollection)) $tlang.getString( #else $tlang.getString( #end $validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName)) #propertyDetails($props)
#end #end #if ($returned && $!timeReturned && ($!timeSubmitted && $!timeReturned && $!timeReturned.after($!timeSubmitted) || !$!timeSubmitted)) #if (($!submission.FeedbackComment) && ($submission.FeedbackComment.trim().length()>0)) #if ($submissionType==2)

$tlang.getString("gen.addinst2")

#else

$tlang.getString("gen.addinst")

#end
$validator.escapeHtmlFormattedText($submission.FeedbackComment)
#else #end ## for returned (not resubmitted ) submission, show the instructor feedback #if ($!prevFeedbackComment && $!prevFeedbackComment.trim().length() > 0)

expandcollapse $tlang.getString("gradingsub.prefee2")

$cheffeedbackhelper.showPrevFeedback($cheffeedbackhelper.escapeAssignmentFeedback($!prevFeedbackComment))
#end #set ($size = 0) #set ($props = false) #set ($feedbackAttachments = $submission.FeedbackAttachments) #set ($size = 0) #set ($props = false) #foreach ($attachment in $feedbackAttachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size == 0) ##$tlang.getString("gen.noatt") #else

$tlang.getString("gen.addinstatts")

#end ## show previous grading/feedback attachments if any #if ($!prevFeedbackAttachments && $prevFeedbackAttachments.size()>0) ## show previous grading/feedback attachments if any

expandcollapse $tlang.getString("gradingsub.prefeedbackAttachments")

#set ($size = 0) #set ($props = false) #foreach ($attachment in $!prevFeedbackAttachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size == 0)

#if ($submissionType == 5) $tlang.getString("gen.noatt.single") #else $tlang.getString("gen.noatt") #end

#else #end
#end #end #if ($withGrade) #set ($previousGrades = $!submission.Properties.getProperty($!submission.Properties.getNamePropSubmissionScaledPreviousGrades())) #if ($!previousGrades.length() == 0 ) #set ($previousGrades = $!submission.Properties.getProperty($!submission.Properties.getNamePropSubmissionPreviousGrades())) #end #if ($!previousGrades.length() > 0 )

expandcollapse $tlang.getString("gradingsub.pregra")

$!previousGrades
#end #end #if ($!assignment.getContent().HonorPledge!=1)


$tlang.getString("gen.youmus")

#end
#else class="act"> #if ($submitted && $!timeSubmitted) #set($name=$tlang.getString("resubmit")) #else #set($name=$tlang.getString("gen.subm3")) #end ## for single file upload case, no need for preview or save draft #if ($submissionType!=5) #end #if ($!linkInvoked) #else #end #if ($submitted && ($submissionType == 2 || $submissionType == 5) && !$!new_attachments) $tlang.getString("stuviewsubm.modifytoresubmit") #elseif ($submissionType == 5) $tlang.getString("stuviewsubm.reminder") #else $tlang.getString("stuviewsubm.submitreminder") #end #end
#else #if ($submission.getGradeReleased() && $!submission.FeedbackText && ($submission.FeedbackText.length()>0)) #set ($text = $submission.FeedbackText) #if ($!text)

$tlang.getString("gen.orisub2")

$cheffeedbackhelper.escapeAssignmentFeedback($text)
#end #elseif ($!submission.submittedText && ($submission.SubmittedText.length()>0)) #set ($text = $submission.SubmittedText) #if ($!text)
$cheffeedbackhelper.escapeAssignmentFeedback($text)
#end #end ## for returned submission, show the instructor comment as well #if ($!prevFeedbackText)
$tlang.getString("gradingsub.prefeetex")
$cheffeedbackhelper.showPrevFeedback($cheffeedbackhelper.escapeAssignmentFeedback($!prevFeedbackText))
#end ## submitted attachment #set ($submittedAttachments = $submission.SubmittedAttachments) #set ($size = 0) #set ($props = false) #foreach ($attachment in $submittedAttachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size == 0) #if ($submissionType == 5) $tlang.getString("gen.noatt.single") #else $tlang.getString("gen.noatt") #end #else
#if ($submissionType == 5) $tlang.getString("gen.stuatt.single") #else $tlang.getString("gen.stuatt") #end
#end #if ($withGrade && $submission.getGraded() && $submission.getGradeReleased()) #if ($submission.getGradeReleased() &&($!submission.FeedbackComment) && ($submission.FeedbackComment.trim().length()>0))
$tlang.getString("gen.addinst")
$validator.escapeHtmlFormattedText($submission.FeedbackComment)
#else #end ## for returned submission, show the instructor feedback #if ($!prevFeedbackComment && $!prevFeedbackComment.trim().length() > 0)
$tlang.getString("gradingsub.prefee")
$cheffeedbackhelper.showPrevFeedback($cheffeedbackhelper.escapeAssignmentFeedback($!prevFeedbackComment))
#end #set ($size = 0) #set ($props = false) #set ($feedbackAttachments = $submission.FeedbackAttachments) #set ($size = 0) #set ($props = false) #foreach ($attachment in $feedbackAttachments) #set ($props = $attachment.Properties) #if ($!props) #set ($size = $size + 1) #end #end #if ($size == 0) ##$tlang.getString("gen.noatt") #else
$tlang.getString("gen.addinst")
#end #end #if ($withGrade) #set ($previousGrades = $!submission.Properties.getProperty($!submission.Properties.getNamePropSubmissionScaledPreviousGrades())) #if ($!previousGrades.length() == 0 ) #set ($previousGrades = $!submission.Properties.getProperty($!submission.Properties.getNamePropSubmissionPreviousGrades())) #end #if ($!previousGrades.length() > 0 )

expandcollapse $tlang.getString("gradingsub.pregra")

$!previousGrades.length()$!previousGrades
#end #end #if ($!linkInvoked) #else

#end #end
#end