Skip to content

Commit

Permalink
WIP: address some of the TIITODOs (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjones86 committed Oct 11, 2017
1 parent c8aec71 commit 99b91ad
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ public class AssignmentSubmission {
@Column(name = "GROUP_ID")
private String groupId;

@Column(name = "EXTERNAL_GRADE_DIFF")
private Boolean externalGradeDifferent = Boolean.FALSE;

@ElementCollection
@MapKeyColumn(name = "NAME")
@Column(name = "VALUE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.sakaiproject.contentreview.advisors;

import java.util.Date;
import org.sakaiproject.site.api.Site;

public interface ContentReviewSiteAdvisor {
Expand All @@ -32,8 +33,8 @@ public interface ContentReviewSiteAdvisor {
* @param assignmentCreationDate
* @return
*/
// @Deprecated
// public boolean siteCanUseLTIReviewServiceForAssignment(Site site, Date assignmentCreationDate);
@Deprecated
public boolean siteCanUseLTIReviewServiceForAssignment(Site site, Date assignmentCreationDate);

public boolean siteCanUseLTIDirectSubmission(Site site);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class ContentReviewItem {
private String siteId;
private String taskId;
private String externalId;
private String submissionId;
private Date dateQueued;
private Date dateSubmitted;
private Date dateReportReceived;
Expand All @@ -48,10 +49,10 @@ public class ContentReviewItem {
private Integer version;

public ContentReviewItem(String contentId, Integer providerId) {
this(contentId, null, null, null, new Date(), ContentReviewConstants.CONTENT_REVIEW_NOT_SUBMITTED_CODE, providerId);
this(contentId, null, null, null, new Date(), ContentReviewConstants.CONTENT_REVIEW_NOT_SUBMITTED_CODE, providerId, null);
}

public ContentReviewItem(String contentId, String userId, String siteId, String taskId, Date dateQueued, Long status, Integer providerId) {
public ContentReviewItem(String contentId, String userId, String siteId, String taskId, Date dateQueued, Long status, Integer providerId, String submissionId) {
this.contentId = contentId;
this.userId = userId;
this.siteId = siteId;
Expand All @@ -60,5 +61,6 @@ public ContentReviewItem(String contentId, String userId, String siteId, String
this.status = status;
this.providerId = providerId;
this.nextRetryTime = new Date();
this.submissionId = submissionId;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class TurnitinConstants

public static final String KEY_FILE_TYPE_PREFIX = "file.type";

// TIITODO: double check if these are still accurate
// Define Turnitin's acceptable file extensions and MIME types, order of these arrays DOES matter
public static final String[] DEFAULT_ACCEPTABLE_FILE_EXTENSIONS = new String[] {
".doc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.sakaiproject.contentreview.turnitin;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -68,7 +67,7 @@ public void setTurnitinReviewServiceImpl(TurnitinReviewServiceImpl turnitinRevie
this.turnitinReviewServiceImpl = turnitinReviewServiceImpl;
}

// TIITODO: fix this
// TIITODO: fix this (BLOCKED BY DECISION TO SUPPORT LEGACY API)
/*private ContentReviewSiteAdvisor contentReviewSiteAdvisor;
public void setContentReviewSiteAdvisor(ContentReviewSiteAdvisor contentReviewSiteAdvisor) {
this.contentReviewSiteAdvisor = contentReviewSiteAdvisor;
Expand Down Expand Up @@ -452,7 +451,8 @@ public String makeLockID(ContentReviewRosterSyncItem item) {
return item.getClass().getCanonicalName() + item.getId();
}

// TIITODO: do we still need to support locking like this with the current Hibernate?
// TIITODO: (BLOCKED BY DECISION TO SUPPORT LEGACY API)
// do we still need to support locking like this with the current Hibernate?
/*private boolean obtainLock(ContentReviewRosterSyncItem item) {
Boolean lock = dao.obtainLock(makeLockID(item), serverConfigurationService.getServerId(), LOCK_PERIOD);
return (lock != null) ? lock : false;
Expand All @@ -471,7 +471,7 @@ public void processSyncQueue() {

log.info("Running Turnitin Roster Sync");

// TIITODO: implement below with TiiContentReviewRosterSyncDao
// TIITODO: implement below with TiiContentReviewRosterSyncDao (BLOCKED BY DECISION TO SUPPORT LEGACY API)

/*Restriction notStarted = new Restriction("status", ContentReviewRosterSyncItem.NOT_STARTED_STATUS, Restriction.EQUALS);
Restriction failed = new Restriction("status", ContentReviewRosterSyncItem.FAILED_STATUS, Restriction.EQUALS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,29 @@ public boolean siteCanUseReviewService(Site site) {

public boolean siteCanUseLTIReviewService(Site site) {
for(ContentReviewSiteAdvisor advisor: advisors) {
// TIITODO: fix this
/*if (advisor.siteCanUseLTIReviewService(site)) {
if (advisor.siteCanUseLTIReviewService(site)) {
return true;
}*/
return true;
}
return true;
}
return false;
}

public boolean siteCanUseLTIReviewServiceForAssignment(Site site, Date asnCreationDate) {
for(ContentReviewSiteAdvisor advisor: advisors) {
// TIITODO: fix this
/*if (advisor.siteCanUseLTIReviewServiceForAssignment(site, asnCreationDate)) {
if (advisor.siteCanUseLTIReviewServiceForAssignment(site, asnCreationDate)) {
return true;
}*/
return true;
}
return true;
}
return false;
}

public boolean siteCanUseLTIDirectSubmission(Site site) {
for(ContentReviewSiteAdvisor advisor: advisors) {
// TIITODO: fix this
/*if (advisor.siteCanUseLTIDirectSubmission(site)) {
if (advisor.siteCanUseLTIDirectSubmission(site)) {
return true;
}*/
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,48 @@
import org.sakaiproject.entity.api.ResourceProperties;
import org.sakaiproject.site.api.Site;

public class SitePropertyAdvisor implements ContentReviewSiteAdvisor {

public class SitePropertyAdvisor implements ContentReviewSiteAdvisor
{
private String siteProperty;
public void setSiteProperty(String p){
public void setSiteProperty(String p)
{
siteProperty = p;
}

private String siteLTIProperty;
public void setSiteLTIProperty(String p){
public void setSiteLTIProperty(String p)
{
siteLTIProperty = p;
}

private String siteDirectSubmissionProperty;
public void setSiteDirectSubmissionProperty(String p){
public void setSiteDirectSubmissionProperty(String p)
{
siteDirectSubmissionProperty = p;
}

public boolean siteCanUseReviewService(Site site) {
ResourceProperties properties = site.getProperties();

public boolean siteCanUseReviewService(Site site)
{
ResourceProperties properties = site.getProperties();
String prop = properties.getProperty(siteProperty);
return Boolean.valueOf(prop).booleanValue();
return Boolean.valueOf(prop);
}

public boolean siteCanUseLTIReviewService(Site site) {
ResourceProperties properties = site.getProperties();

public boolean siteCanUseLTIReviewService(Site site)
{
ResourceProperties properties = site.getProperties();
String prop = properties.getProperty(siteLTIProperty);
return Boolean.valueOf(prop).booleanValue();
return Boolean.valueOf(prop);
}

public boolean siteCanUseLTIReviewServiceForAssignment(Site site, Date assignmentCreationDate)
{
return siteCanUseLTIReviewService(site);
}

public boolean siteCanUseLTIDirectSubmission(Site site){
ResourceProperties properties = site.getProperties();
ResourceProperties properties = site.getProperties();
String prop = properties.getProperty(siteDirectSubmissionProperty);
return Boolean.valueOf(prop).booleanValue();
return Boolean.valueOf(prop);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TiiContentReviewRosterSyncDao extends HibernateCommonDao<ContentRev
{
public Optional<ContentReviewRosterSyncItem> findByStatusAndSite(int status, String siteId)
{
// TIITODO: implement this
// TIITODO: implement this (BLOCKED BY DECISION TO SUPPORT LEGACY API)

return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import org.sakaiproject.tool.api.SessionManager;

/**
* TIITODO: is this class necessary? If we're the only institution using some flavour of the LTI integration,
* and this class is only responsible for migrating things from an older variant of the LTI integration to the updated
* variant, then this who process should be irrelevant.
*
* Migrates the original LTI XML settings from the assignments table into the new activity config table.
* Also moves the external value from the content resource binary entity back into the contentreviewitem table.
* You need to run this ONLY if you have previously deployed the LTI integration prior to the introduction of TII-219 and TII-221.
Expand All @@ -31,7 +35,7 @@ public void execute(JobExecutionContext arg0) throws JobExecutionException {
Session sakaiSession = sessionManager.getCurrentSession();
sakaiSession.setUserId("admin");
sakaiSession.setUserEid("admin");
// TIITODO: uncomment and fix the line below
// TIITODO: uncomment and fix the line below (BLOCKED BY DECISION, see class comments above)
//contentReviewService.migrateLtiXml();

}
Expand Down
Loading

0 comments on commit 99b91ad

Please sign in to comment.