Skip to content

Commit

Permalink
Merge branch 'master' into SAK-37749
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff authored Dec 12, 2024
2 parents f379f83 + 1e038f4 commit f8b0718
Show file tree
Hide file tree
Showing 1,112 changed files with 22,974 additions and 30,464 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: JDK 11
- name: JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: temurin
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
maven-version: 3.9.9
- name: Search for bad unicode translations
run: |
find . -name \*.properties -exec grep '\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]' {} \; &> grep.txt
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ jobs:
sakai-deploy:
runs-on: ubuntu-22.04
env:
JAVA_OPTS: "-Dhttp.agent=Sakai -Xms2512m -Xmx2512m -Dsakai.cookieName=SAKAIID -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dsakai.demo=true -Djava.awt.headless=true --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --illegal-access=permit -Dsakai.demo=true"

JAVA_OPTS: "-Dhttp.agent=Sakai -Xms2512m -Xmx2512m -Dsakai.cookieName=SAKAIID -Dsakai.demo=true"
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: JDK 11
- name: JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: temurin
cache: maven
- name: Build with Maven
Expand All @@ -32,15 +31,17 @@ jobs:
export TOMCAT_DIR=$PWD/tomcat
mkdir $TOMCAT_DIR
cd $TOMCAT_DIR
curl -s -o tomcat.tar.gz https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.96/bin/apache-tomcat-9.0.96.tar.gz
curl -s -o tomcat.tar.gz https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.98/bin/apache-tomcat-9.0.98.tar.gz
tar --strip-components=1 -xzf tomcat.tar.gz
git clone https://github.com/sakaiproject/nightly-config.git sakai
cp sakai/setenv.sh bin/setenv.sh
cp sakai/cypress.properties sakai/sakai.properties
sed -i 's:<Context>:<Context><JarScanner><JarScanFilter defaultPluggabilityScan="false" /></JarScanner>:g' conf/context.xml
cp -f sakai/context.xml conf/context.xml
cp -f sakai/catalina.properties conf/catalina.properties
sed -i 's:<Service name="Catalina">:<Service name="Catalina"><Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" />:g' conf/server.xml
mysql -u root -proot -e "create database sakai";
cd ..
mvn --batch-mode -DskipTests install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR
mvn --batch-mode -DskipTests -Denforcer.skip -Dmaven.source.skip install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR
cd $TOMCAT_DIR
bin/catalina.sh start
sleep 500s
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
- name: Check number of MySQL statements
if: always()
run: |
export QUERIES=$(grep ProtocolLoggingProxy.info tomcat/logs/catalina.out|grep -v ROLLBACK|grep -v COMMIT | wc -l)
export QUERIES=$(grep StandardClient.debug tomcat/logs/catalina.out|grep -v ROLLBACK|grep -v COMMIT | wc -l)
echo "::notice title={MySQL Queries}::$QUERIES"
- name: Upload Tomcat log for review
if: always()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: JDK 11
- name: JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: temurin
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
maven-version: 3.9.9
- name: Build with Maven
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dmaven.wagon.http.retryHandler.count=2 -Dmaven.wagon.http.pool=true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ If you can't find your "at institution.edu" on the Apereo signup page then send
## Community supported versions
These versions are actively supported by the community.

Sakai 23.2 ([release](http://source.sakaiproject.org/release/23.2/) | [fixes](https://confluence.sakaiproject.org/display/DOC/23.2+Fixes+by+tool) | [notes](https://confluence.sakaiproject.org/display/DOC/Sakai+23+Release+Notes))
Sakai 23.3 ([release](http://source.sakaiproject.org/release/23.3/) | [fixes](https://confluence.sakaiproject.org/display/DOC/23.3+Fixes+by+tool) | [notes](https://confluence.sakaiproject.org/display/DOC/Sakai+23+Release+Notes))

Sakai 22.5 ([release](http://source.sakaiproject.org/release/22.5/) | [fixes](https://confluence.sakaiproject.org/display/DOC/22.5+Fixes+by+tool) | [notes](https://confluence.sakaiproject.org/display/DOC/Sakai+22+Release+Notes))

Expand All @@ -92,7 +92,7 @@ For full history of supported releases please see our [release information on co

## Under Development

[Sakai 23.3](https://confluence.sakaiproject.org/display/REL/Sakai+23+Straw+person) is the current development release of Sakai 23. It is expected to release Q3 2024.
[Sakai 23.4](https://confluence.sakaiproject.org/display/REL/Sakai+23+Straw+person) is the current development release of Sakai 23. It is expected to release Q1 2025.

[Sakai 22.6](https://confluence.sakaiproject.org/display/REL/Sakai+22+Straw+person) is the current development release of Sakai 22. It is expected to release Q4 2024.

Expand Down
3 changes: 1 addition & 2 deletions admin-tools/src/webapp/vm/memory/chef_memory.vm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</div>
#end
#if ($status)
<button data-bs-toggle="collapse" data-target="#status">Status</button>
<div id="status" class="collapse">
<div id="status" class="p-3 border rounded">
$formattedText.escapeHtml($status)
</div>
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
$formattedText.escapeHtml($ann_item.Header.subject) <span class="skip">$formattedText.escapeHtml($ann_item.Header.subject)</span></a>
#end
</td>
<td headers="author" class="hidden-xs">
<td headers="author" class="d-none d-sm-table-cell">
$formattedText.escapeHtml($ann_item.AuthorDisplayName)
</td>
#if ($toolId.equals("sakai.announcements"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public String getDeepLinkWithPermissions(String context, String assignmentId, bo
public boolean isTimeSheetEnabled(String siteId);

/**
* The the name of the content review service being used e.g. Turnitin
* The name of the content review service being used e.g. Turnitin
* @return A String containing the name of the content review service
*/
public String getContentReviewServiceName();
Expand All @@ -891,4 +891,9 @@ public String getDeepLinkWithPermissions(String context, String assignmentId, bo
public boolean allowAddTags(String context);

public FormattedText getFormattedText();

/**
* Returns true if the submission contains instructor feedback, whether as comment text (inline) or attachments.
*/
public boolean doesSubmissionHaveInstructorFeedback(AssignmentSubmission submission);
}
2 changes: 1 addition & 1 deletion assignment/api/src/resources/assignment_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ youmustrubric=Aquesta tasca \u00E9s autoavaluable. Pots autoavaluar la teva tasc
youhavetorubric=Aquesta tasca \u00fas autoavaluable. Has d'autoavaluar la teva tasca amb la r\u00FAbrica abans d'enviar-la. Has de completar sencera la r\u00FAbrica per fer l'enviament.
youhavetorubricone=Aquesta tasca \u00fas autoavaluable. Has d'autoavaluar la teva tasca amb la r\u00FAbrica abans d'enviar-la. Has de completar almenys un criteri de la r\u00FAbrica per fer l'enviament.
studentrubric=Aquesta tasca \u00E9s autoavaluable. Pots revisar l'autoavaluaci\u00F3 de l'estudiant abans de puntuar la tasca.
autoevaluation=Autoevaluaci\u00f3:
autoevaluation=Autoavaluaci\u00f3:
instructor_grading=Correcci\u00f3 del profesor:
reviewrubric=Aquesta tasca \u00E9s autoavaluable. Pot revisar la autoavaluaci\u00F3 abans d'enviar-la.
reviewrubricreport=Aquesta \u00E9s la teva autoavaluaci\u00F3.
Expand Down
12 changes: 6 additions & 6 deletions assignment/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,16 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-api</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-util</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-util</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-common</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-common</artifactId>
<version>${sakai.version}</version>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.authz.api.SecurityAdvisor;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.basiclti.util.SakaiBLTIUtil;
import org.sakaiproject.lti.util.SakaiLTIUtil;
import org.sakaiproject.calendar.api.Calendar;
import org.sakaiproject.calendar.api.CalendarEvent;
import org.sakaiproject.calendar.api.CalendarService;
Expand Down Expand Up @@ -2031,10 +2031,10 @@ private AssignmentConstants.SubmissionStatus getGradersCanonicalSubmissionStatus
} else if (submission.getGraded()) {
if (StringUtils.isNotBlank(submission.getGrade())) {
return SubmissionStatus.GRADED;
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
}
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
}
} else {
Expand All @@ -2043,10 +2043,10 @@ private AssignmentConstants.SubmissionStatus getGradersCanonicalSubmissionStatus
} else if (submission.getGraded()) {
if (StringUtils.isNotBlank(submission.getGrade())) {
return SubmissionStatus.GRADED;
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
}
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
} else {
return SubmissionStatus.NO_SUBMISSION;
Expand All @@ -2061,17 +2061,21 @@ private AssignmentConstants.SubmissionStatus getGradersCanonicalSubmissionStatus
// grade saved but not release yet, show this to graders
if (StringUtils.isNotBlank(submission.getGrade())) {
return SubmissionStatus.GRADED;
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
}
}
} else if (StringUtils.isNotBlank(submission.getFeedbackComment())) {
} else if (doesSubmissionHaveInstructorFeedback(submission)) {
return SubmissionStatus.COMMENTED;
}
}
return SubmissionStatus.UNGRADED;
}

public boolean doesSubmissionHaveInstructorFeedback(AssignmentSubmission submission) {
return StringUtils.isNotBlank(submission.getFeedbackComment()) || CollectionUtils.isNotEmpty(submission.getFeedbackAttachments());
}

private AssignmentConstants.SubmissionStatus getSubmittersCanonicalSubmissionStatus(AssignmentSubmission submission) {
if (submission == null) return SubmissionStatus.NOT_STARTED;

Expand Down Expand Up @@ -4253,7 +4257,7 @@ public Map<String, String> transferCopyEntities(String fromContext, String toCon
// If there is a LTI launch associated with this copy it over
if ( oAssignment.getContentId() != null ) {
Long contentKey = oAssignment.getContentId().longValue();
Object retval = SakaiBLTIUtil.copyLTIContent(contentKey, toContext, fromContext);
Object retval = SakaiLTIUtil.copyLTIContent(contentKey, toContext, fromContext);
if ( retval instanceof Long ) {
nAssignment.setContentId(((Long) retval).intValue());
// If something went wrong, we can't be an LTI submission in the new site
Expand Down
12 changes: 6 additions & 6 deletions assignment/tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@
<artifactId>sakai-velocity-tool</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-api</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-common</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.basiclti</groupId>
<artifactId>basiclti-util</artifactId>
<groupId>org.sakaiproject.lti</groupId>
<artifactId>lti-util</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ private Map<String, Object> submissionToMap(Set<String> activeSubmitters, Assign
if ( content != null ) {
String contentItem = StringUtils.trimToEmpty((String) content.get(LTIService.LTI_CONTENTITEM));
// Instead of parsing, the JSON we just look for a simple existance of the submission review entry
// Delegate the complex understanding of the launch to SakaiBLTIUtil
// Delegate the complex understanding of the launch to SakaiLTIUtil
// TODO: Eventually, Sakai's LTIService will implement a submissionReview checkbox and we should check for that here
boolean submissionReviewAvailable = contentItem.indexOf("\"submissionReview\"") > 0;

Expand Down Expand Up @@ -757,7 +757,9 @@ private Map<String, Object> submissionToMap(Set<String> activeSubmitters, Assign
log.info("There was an attachment on submission {} that was invalid", as.getId());
return null;
}
}).collect(Collectors.toList());
})
.filter(Objects::nonNull)
.collect(Collectors.toList());

if (!submittedAttachments.isEmpty()) {
submission.put("submittedAttachments", submittedAttachments);
Expand Down Expand Up @@ -803,7 +805,7 @@ private Map<String, Object> submissionToMap(Set<String> activeSubmitters, Assign
&& assignmentService.isPeerAssessmentClosed(assignment)) {
List<PeerAssessmentItem> reviews = assignmentPeerAssessmentService.getPeerAssessmentItems(as.getId(), assignment.getScaleFactor());
if (reviews != null) {
List<PeerAssessmentItem> completedReviews = new ArrayList<>();
List<SimplePeerAssessmentItem> completedReviews = new ArrayList<>();
for (PeerAssessmentItem review : reviews) {
if (!review.getRemoved() && (review.getScore() != null || (StringUtils.isNotBlank(review.getComment())))) {
//only show peer reviews that have either a score or a comment saved
Expand Down Expand Up @@ -839,13 +841,12 @@ private Map<String, Object> submissionToMap(Set<String> activeSubmitters, Assign
log.warn("Exception while creating reference: {}", e.toString());
}
}
if (!attachmentRefList.isEmpty())
review.setAttachmentRefList(attachmentRefList);
if (!attachmentRefList.isEmpty()) review.setAttachmentRefList(attachmentRefList);
}
completedReviews.add(review);
completedReviews.add(new SimplePeerAssessmentItem(review));
}
}
if (completedReviews.size() > 0) {
if (!completedReviews.isEmpty()) {
submission.put("peerReviews", completedReviews);
}
}
Expand Down Expand Up @@ -1098,7 +1099,7 @@ public ActionReturn getGradableForSite(EntityView view , Map<String, Object> par
ltiSubmissionLaunch = "/access/lti/site/" + siteId + "/content:" + contentKey + "?for_user=" + submitter.get("id");

// Instead of parsing, the JSON we just look for a simple existance of the submission review entry
// Delegate the complex understanding of the launch to SakaiBLTIUtil
// Delegate the complex understanding of the launch to SakaiLTIUtil
if ( contentItem.indexOf("\"submissionReview\"") > 0 ) {
ltiSubmissionLaunch = ltiSubmissionLaunch + "&message_type=content_review";
}
Expand Down Expand Up @@ -2216,4 +2217,39 @@ public SimpleGroup(Group g) {
this.users = g.getUsers();
}
}

@Getter
public class SimplePeerAssessmentItem {

private String assessorUserId;
private String submissionId;
private String assignmentId;
private Integer score;
private String scoreDisplay;
private String comment;
private Boolean removed;
private Boolean submitted;
private List<String> attachmentUrlList;
private String assessorDisplayName;
private Integer scaledFactor;
private boolean draft;

public SimplePeerAssessmentItem(PeerAssessmentItem item) {
this.assessorUserId = item.getId().getAssessorUserId();
this.submissionId = item.getId().getSubmissionId();
this.assignmentId = item.getAssignmentId();
this.score = item.getScore();
this.scoreDisplay = item.getScoreDisplay();
this.comment = item.getComment();
this.removed = item.getRemoved();
this.submitted = item.getSubmitted();
this.assessorDisplayName = item.getAssessorDisplayName();
this.scaledFactor = item.getScaledFactor();
this.draft = item.isDraft();

this.attachmentUrlList = item.getAttachmentRefList().stream()
.map(Reference::getUrl)
.collect(Collectors.toList());
}
}
}
Loading

0 comments on commit f8b0718

Please sign in to comment.