Index: assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentContent.java =================================================================== --- assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentContent.java (revision 97352) +++ assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentContent.java (working copy) @@ -185,4 +185,28 @@ * @return boolean - Is this AssignmentContent used by an Assignment. */ public boolean inUse(); + + public String getSubmitReviewRepo(); + + public void setSubmitReviewRepo(String m_submitReviewRepo); + + public String getGenerateOriginalityReport(); + + public void setGenerateOriginalityReport(String m_generateOriginalityReport); + + public boolean isCheckTurnitin(); + + public void setCheckTurnitin(boolean m_checkTurnitin); + + public boolean isCheckInternet(); + + public void setCheckInternet(boolean m_checkInternet); + + public boolean isCheckPublications(); + + public void setCheckPublications(boolean m_checkPublications); + + public boolean isCheckInstitution(); + + public void setCheckInstitution(boolean m_checkInstitution); } Index: assignment-bundles/resources/assignment.properties =================================================================== --- assignment-bundles/resources/assignment.properties (revision 97352) +++ assignment-bundles/resources/assignment.properties (working copy) @@ -610,6 +610,19 @@ review.use = Use {0} review.allow = Allow students to view report review.report = Turnitin Report +review.submit.papers.repository=Submit papers to the following repository: +review.submit.papers.repository.none=None +review.submit.papers.repository.standard=Standard Paper Repository +review.submit.papers.repository.institution=Institution Paper Repository +review.originality.reports=Generate originality reports: +review.originality.reports.immediately=Immediately +review.originality.reports.due=On Due Date +review.originality.check=Check originality against: +review.originality.check.turnitin=Turnitin paper repository +review.originality.check.internet=Current and archived internet +review.originality.check.pub=Periodicals, journals, and publications +review.originality.check.institution=Institution-specific repository + gen.sorbyreview = Sort by review gen.rev = TurnItIn review.notavail = Not available yet @@ -753,4 +766,14 @@ ## the url used by download all process download_url_reminder = You have chosen to download student submissions. If you encountered a problem downloading all submissions, follow this link: Complete the Download. allPurpose_save = Save -allPurpose_cancel = Cancel \ No newline at end of file +allPurpose_cancel = Cancel + +content_review.error.SUBMISSION_ERROR_RETRY_CODE = An error occurred submitting this attachment to the originality checking service. The system will automatically try to re-submit this attachment. +content_review.error.SUBMISSION_ERROR_NO_RETRY_CODE = An error occurred while submitting this attachment to the originality checking service. +content_review.error.SUBMISSION_ERROR_USER_DETAILS_CODE = An error occurred while submitting this attachment to the originality checking service. The user details are incomplete or invalid. +content_review.error.REPORT_ERROR_RETRY_CODE = An error occurred while retrieving the originality report for this attachment. The system will automatically try to re-retrieve the report. +content_review.error.REPORT_ERROR_NO_RETRY_CODE = An error occurred while retrieving the originality report for this attachment. The report cannot be retrieved. +content_review.error.SUBMISSION_ERROR_RETRY_EXCEEDED_CODE = All attempts to submit this attachment for originality review failed. Limit on submission attempts reached. +content_review.error = An unknown error occurred. The originality review for this attachment is not available. +content_review.error.createAssignment=The assignment was saved, but Turnitin information was unable to be updated. Please try saving again. +content_review.note=

NOTE, If using Turnitin:
  1. Set this assignment to "Attachments only."
  2. Tell students:
    1. Submit only one attachment.
    2. Only use file types: Word, PDF, HTML, RTF, or plain text.
    3. Always include file extension.
\ No newline at end of file Index: assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java =================================================================== --- assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java (revision 97352) +++ assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java (working copy) @@ -30,9 +30,11 @@ import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.text.Collator; +import java.text.DateFormat; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -116,6 +118,7 @@ import org.sakaiproject.exception.InUseException; import org.sakaiproject.exception.PermissionException; import org.sakaiproject.exception.ServerOverloadException; +import org.sakaiproject.id.cover.IdManager; import org.sakaiproject.javax.PagingPosition; import org.sakaiproject.service.gradebook.shared.AssignmentHasIllegalPointsException; import org.sakaiproject.service.gradebook.shared.CategoryDefinition; @@ -171,6 +174,21 @@ private static final String NEW_ASSIGNMENT_USE_REVIEW_SERVICE = "new_assignment_use_review_service"; private static final String NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW = "new_assignment_allow_student_view"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO = "submit_papers_to"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE = "0"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD = "1"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION = "2"; + // When to generate reports + // although the service allows for a value of "1" --> Generate report immediately but overwrite until due date, + // this doesn't make sense for assignment2. We limit the UI to 0 - Immediately + // or 2 - On Due Date + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO = "report_gen_speed"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY = "0"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE = "2"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN = "s_paper_check"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET = "internet_check"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB = "journal_check"; + private static final String NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION = "institution_check"; @@ -1713,7 +1731,19 @@ context.put("name_UseReviewService", NEW_ASSIGNMENT_USE_REVIEW_SERVICE); context.put("name_AllowStudentView", NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO", NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE", NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD", NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION", NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO", NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY", NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE", NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN", NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET", NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB", NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB); + context.put("name_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION", NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION); + context.put("name_title", NEW_ASSIGNMENT_TITLE); context.put("name_order", NEW_ASSIGNMENT_ORDER); @@ -1775,8 +1805,33 @@ // Keep the use review service setting context.put("value_UseReviewService", state.getAttribute(NEW_ASSIGNMENT_USE_REVIEW_SERVICE)); - context.put("value_AllowStudentView", state.getAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW)); + context.put("value_AllowStudentView", state.getAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW) == null ? Boolean.toString(ServerConfigurationService.getBoolean("turnitin.allowStudentView.default", false)) : state.getAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW)); + List subOptions = getSubmissionRepositoryOptions(); + String submitRadio = ServerConfigurationService.getString("turnitin.repository.setting.value",null) == null ? NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE : ServerConfigurationService.getString("turnitin.repository.setting.value"); + if(state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO) != null && subOptions.contains(state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO))) + submitRadio = state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO).toString(); + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO", submitRadio); + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT", subOptions); + + List reportGenOptions = getReportGenOptions(); + String reportRadio = ServerConfigurationService.getString("turnitin.report_gen_speed.setting.value", null) == null ? NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY : ServerConfigurationService.getString("turnitin.report_gen_speed.setting.value"); + if(state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO) != null && reportGenOptions.contains(state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO))) + reportRadio = state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO).toString(); + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO", reportRadio); + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT", reportGenOptions); + + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN", ServerConfigurationService.getBoolean("turnitin.option.s_paper_check", true)); + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET", ServerConfigurationService.getBoolean("turnitin.option.internet_check", true)); + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB", ServerConfigurationService.getBoolean("turnitin.option.journal_check", true)); + context.put("show_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION", ServerConfigurationService.getBoolean("turnitin.option.institution_check", true)); + + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN", (state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN) == null) ? Boolean.toString(ServerConfigurationService.getBoolean("turnitin.option.s_paper_check.default", ServerConfigurationService.getBoolean("turnitin.option.s_paper_check", true) ? true : false)) : state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN)); + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET", state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET) == null ? Boolean.toString(ServerConfigurationService.getBoolean("turnitin.option.internet_check.default", ServerConfigurationService.getBoolean("turnitin.option.internet_check", true) ? true : false)) : state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET)); + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB", state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB) == null ? Boolean.toString(ServerConfigurationService.getBoolean("turnitin.option.journal_check.default", ServerConfigurationService.getBoolean("turnitin.option.journal_check", true) ? true : false)) : state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB)); + context.put("value_NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION", state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION) == null ? Boolean.toString(ServerConfigurationService.getBoolean("turnitin.option.institution_check.default", ServerConfigurationService.getBoolean("turnitin.option.institution_check", true) ? true : false)) : state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION)); + + // don't show the choice when there is no Schedule tool yet if (state.getAttribute(CALENDAR) != null) context.put("value_CheckAddDueDate", state.getAttribute(ResourceProperties.NEW_ASSIGNMENT_CHECK_ADD_DUE_DATE)); @@ -4529,6 +4584,37 @@ else b = Boolean.TRUE.toString(); state.setAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW, b); + //set submit options + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO); + if(r == null || (!NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD.equals(r) && !NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION.equals(r))) + r = NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE; + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO, r); + //set originality report options + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO); + if(r == null || !NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE.equals(r)) + r = NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY; + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO, r); + //set check repository options: + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN); + if (r == null) b = Boolean.FALSE.toString(); + else b = Boolean.TRUE.toString(); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN, b); + + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET); + if (r == null) b = Boolean.FALSE.toString(); + else b = Boolean.TRUE.toString(); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET, b); + + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB); + if (r == null) b = Boolean.FALSE.toString(); + else b = Boolean.TRUE.toString(); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB, b); + + r = params.getString(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION); + if (r == null) b = Boolean.FALSE.toString(); + else b = Boolean.TRUE.toString(); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION, b); + // treat the new assignment description as formatted text boolean checkForFormattingErrors = true; // instructor is creating a new assignment - so check for errors String description = processFormattedTextFromBrowser(state, params.getCleanString(NEW_ASSIGNMENT_DESCRIPTION), @@ -5306,6 +5392,13 @@ boolean allowStudentViewReport = "true".equalsIgnoreCase((String) state.getAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW)); + String submitReviewRepo = (String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO); + String generateOriginalityReport = (String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO); + boolean checkTurnitin = "true".equalsIgnoreCase((String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN)); + boolean checkInternet = "true".equalsIgnoreCase((String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET)); + boolean checkPublications = "true".equalsIgnoreCase((String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB)); + boolean checkInstitution = "true".equalsIgnoreCase((String) state.getAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION)); + // the attachments List attachments = (List) state.getAttribute(NEW_ASSIGNMENT_ATTACHMENT); @@ -5345,7 +5438,7 @@ Time oldDueTime = a.getDueTime(); // commit the changes to AssignmentContent object - commitAssignmentContentEdit(state, ac, title, submissionType,useReviewService,allowStudentViewReport, gradeType, gradePoints, description, checkAddHonorPledge, attachments); + commitAssignmentContentEdit(state, ac, title, submissionType,useReviewService,allowStudentViewReport, gradeType, gradePoints, description, checkAddHonorPledge, attachments, submitReviewRepo, generateOriginalityReport, checkTurnitin, checkInternet, checkPublications, checkInstitution, openTime, dueTime, closeTime); // set the Assignment Properties object ResourcePropertiesEdit aPropertiesEdit = a.getPropertiesEdit(); @@ -6278,7 +6371,7 @@ } } - private void commitAssignmentContentEdit(SessionState state, AssignmentContentEdit ac, String title, int submissionType,boolean useReviewService, boolean allowStudentViewReport, int gradeType, String gradePoints, String description, String checkAddHonorPledge, List attachments) + private void commitAssignmentContentEdit(SessionState state, AssignmentContentEdit ac, String title, int submissionType,boolean useReviewService, boolean allowStudentViewReport, int gradeType, String gradePoints, String description, String checkAddHonorPledge, List attachments, String submitReviewRepo, String generateOriginalityReport, boolean checkTurnitin, boolean checkInternet, boolean checkPublications, boolean checkInstitution, Time openTime, Time dueTime, Time closeTime) { ac.setTitle(title); ac.setInstructions(description); @@ -6286,6 +6379,12 @@ ac.setTypeOfSubmission(submissionType); ac.setAllowReviewService(useReviewService); ac.setAllowStudentViewReport(allowStudentViewReport); + ac.setSubmitReviewRepo(submitReviewRepo); + ac.setGenerateOriginalityReport(generateOriginalityReport); + ac.setCheckInstitution(checkInstitution); + ac.setCheckInternet(checkInternet); + ac.setCheckPublications(checkPublications); + ac.setCheckTurnitin(checkTurnitin); ac.setTypeOfGrade(gradeType); if (gradeType == 3) { @@ -6325,11 +6424,42 @@ } } state.setAttribute(ATTACHMENTS_MODIFIED, Boolean.valueOf(false)); - + // commit the changes AssignmentService.commitEdit(ac); + + if(ac.getAllowReviewService()){ + createTIIAssignment(ac, openTime, dueTime, closeTime, state); + } + } + public void createTIIAssignment(AssignmentContentEdit assign, Time openTime, Time dueTime, Time closeTime, SessionState state) { + Map opts = new HashMap(); + + opts.put("submit_papers_to", assign.getSubmitReviewRepo()); + opts.put("report_gen_speed", assign.getGenerateOriginalityReport()); + opts.put("institution_check", assign.isCheckInstitution() ? "1" : "0"); + opts.put("internet_check", assign.isCheckInternet() ? "1" : "0"); + opts.put("journal_check", assign.isCheckPublications() ? "1" : "0"); + opts.put("s_paper_check", assign.isCheckTurnitin() ? "1" : "0"); + opts.put("s_view_report", assign.getAllowStudentViewReport() ? "1" : "0"); + opts.put("late_accept_flag", "1"); + + SimpleDateFormat dform = ((SimpleDateFormat) DateFormat.getDateInstance()); + dform.applyPattern("yyyy-MM-dd HH:mm:ss"); + opts.put("dtstart", dform.format(openTime.getTime())); + opts.put("dtdue", dform.format(dueTime.getTime())); + //opts.put("dtpost", dform.format(closeTime.getTime())); + try { + contentReviewService.createAssignment(assign.getContext(), assign.getReference(), opts); + } catch (Exception e) { + M_log.error(e); + state.setAttribute("alertMessage", rb.getString("content_review.error.createAssignment")); + } + } + + /** * reorderAssignments */ @@ -6692,6 +6822,15 @@ //set whether students can view the review service results state.setAttribute(NEW_ASSIGNMENT_ALLOW_STUDENT_VIEW, Boolean.valueOf(a.getContent().getAllowStudentViewReport()).toString()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_RADIO, a.getContent().getSubmitReviewRepo()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_RADIO, a.getContent().getGenerateOriginalityReport()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_TURNITIN, Boolean.valueOf(a.getContent().isCheckTurnitin()).toString()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INTERNET, Boolean.valueOf(a.getContent().isCheckInternet()).toString()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_PUB, Boolean.valueOf(a.getContent().isCheckPublications()).toString()); + state.setAttribute(NEW_ASSIGNMENT_REVIEW_SERVICE_CHECK_INSTITUTION, Boolean.valueOf(a.getContent().isCheckInstitution()).toString()); + + + state.setAttribute(NEW_ASSIGNMENT_GROUPS, a.getGroups()); // get all supplement item info into state @@ -6708,6 +6847,54 @@ } // doEdit_Assignment + public List getSubmissionRepositoryOptions() { + List submissionRepoSettings = new ArrayList(); + String[] propertyValues = ServerConfigurationService.getStrings("turnitin.repository.setting"); + if (propertyValues != null && propertyValues.length > 0) { + for (int i=0; i < propertyValues.length; i++) { + String propertyVal = propertyValues[i]; + if (propertyVal.equals(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE) || + propertyVal.equals(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION) || + propertyVal.equals(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD)) { + submissionRepoSettings.add(propertyVal); + } + } + } + + // if there are still no valid settings in the list at this point, use the default + if (submissionRepoSettings.isEmpty()) { + // add all three + submissionRepoSettings.add(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_NONE); + submissionRepoSettings.add(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_INSITUTION); + submissionRepoSettings.add(NEW_ASSIGNMENT_REVIEW_SERVICE_SUBMIT_STANDARD); + } + + return submissionRepoSettings; + } + + public List getReportGenOptions() { + List reportGenSettings = new ArrayList(); + String[] propertyValues = ServerConfigurationService.getStrings("turnitin.report_gen_speed.setting"); + if (propertyValues != null && propertyValues.length > 0) { + for (int i=0; i < propertyValues.length; i++) { + String propertyVal = propertyValues[i]; + if (propertyVal.equals(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE) || + propertyVal.equals(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY)) { + reportGenSettings.add(propertyVal); + } + } + } + + // if there are still no valid settings in the list at this point, use the default + if (reportGenSettings.isEmpty()) { + // add all three + reportGenSettings.add(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_DUE); + reportGenSettings.add(NEW_ASSIGNMENT_REVIEW_SERVICE_REPORT_IMMEDIATELY); + } + + return reportGenSettings; + } + /** * put all assignment supplement item info into state * @param state Index: assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm =================================================================== --- assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm (revision 97352) +++ assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm (working copy) @@ -90,6 +90,15 @@ } *# --> + + function toggleReviewServiceOptions(checked){ + var section = document.getElementById("reviewServiceOptions"); + if(checked){ + section.style.display="block"; + }else{ + section.style.display="none"; + } + }