Student
*/
@@ -148,7 +153,11 @@ private Student gatherStudentInformation() {
setValueIfNotEmpty(lastName, student::setLastName);
setValueIfNotEmpty(nickName, student::setNickName);
- askQuestionAndSetValue("What is your email address (doesn't have to be PSU)?", student::setEmail);
+ askQuestionAndSetValue("What is your email address (must be @pdx.edu)?", student::setEmail);
+ if (!hasPdxDotEduEmail(student)) {
+ printErrorMessageAndExit("** Your email address must be @pdx.edu");
+ }
+
askQuestionAndSetValue("What is your major?", student::setMajor);
askEnrolledSectionQuestion(student);
diff --git a/grader/src/test/java/edu/pdx/cs/joy/grader/SummaryReportTest.java b/grader/src/test/java/edu/pdx/cs/joy/grader/SummaryReportTest.java
index a270e0a363..311ba72ba5 100644
--- a/grader/src/test/java/edu/pdx/cs/joy/grader/SummaryReportTest.java
+++ b/grader/src/test/java/edu/pdx/cs/joy/grader/SummaryReportTest.java
@@ -245,4 +245,36 @@ private static File getStudentReportFile(File directory, Student student) {
return new File(sectionDirectory, SummaryReport.getReportFileName(student.getId()));
}
+ @Test
+ void missingGradeIsClearInReport(@TempDir File tempDirectory) throws IOException {
+ GradeBook gradeBook = new GradeBook("test");
+
+ String assignmentName = "Assignment";
+ Assignment assignment = gradeBook.addAssignment(new Assignment(assignmentName, 10.0));
+ Assignment assignment2 = gradeBook.addAssignment(new Assignment("Assignment 2", 10.0));
+
+ Student studentWithMissingGrade =
+ gradeBook.addStudent(new Student("studentWithMissingGrade"))
+ .setLastName("studentWithMissingGrade")
+ .setEnrolledSection(Student.Section.UNDERGRADUATE)
+ .setGrade(assignment, Grade.NO_GRADE)
+ .setGrade(assignment2, 10.0);
+
+ Student studentWithGrade =
+ gradeBook.addStudent(new Student("studentWithGrade"))
+ .setLastName("studentWithGrade")
+ .setEnrolledSection(Student.Section.UNDERGRADUATE)
+ .setGrade(assignment, 10.0)
+ .setGrade(assignment2, 10.0);
+
+ SummaryReport.dumpReports(gradeBook.getStudentIds(), gradeBook, tempDirectory, false);
+
+ File studentWithMissingGradeReportFile = getStudentReportFile(tempDirectory, studentWithMissingGrade);
+ assertThat(studentWithMissingGradeReportFile.exists(), equalTo(true));
+
+ String studentWithSomeNonZeroGradesReport = readTextFromFile(studentWithMissingGradeReportFile);
+ assertThat(studentWithSomeNonZeroGradesReport, not(containsString(String.valueOf(Grade.NO_GRADE))));
+ assertThat(studentWithSomeNonZeroGradesReport, containsString("NOT GRADED"));
+ }
+
}
diff --git a/grader/src/test/java/edu/pdx/cs/joy/grader/SurveyTest.java b/grader/src/test/java/edu/pdx/cs/joy/grader/SurveyTest.java
index bbf0b6a149..5bab981cad 100644
--- a/grader/src/test/java/edu/pdx/cs/joy/grader/SurveyTest.java
+++ b/grader/src/test/java/edu/pdx/cs/joy/grader/SurveyTest.java
@@ -7,7 +7,6 @@
import org.junit.jupiter.api.io.TempDir;
import java.io.*;
-import java.nio.file.Files;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
@@ -58,7 +57,7 @@ void longMessageIsBrokenInto80CharacterLines() {
@Test
void validEmailAddressIsValid() {
- String address = "whitlock@cs.pdx.edu";
+ String address = "whitlocd@pdx.edu";
assertThat(Survey.isEmailAddress(address), equalTo(true));
}
@@ -86,7 +85,7 @@ void successfulSurveyWritesStudentXmlFile(@TempDir File tempDir) throws IOExcept
String lastName = "Last name";
String nickName = "Nick name";
String loginId = "LoginId";
- String email = "email@email.com";
+ String email = "email@pdx.edu";
String major = "Major";
String section = "u";
String recordGitHubUserName = "y";
@@ -164,4 +163,19 @@ String getTextThatWasOutput() {
return captured.toString();
}
}
+
+ @Test
+ void emailAddressIsPdxDotEdu() {
+ Student student = new Student("id");
+ student.setEmail("student@pdx.edu");
+ assertThat(Survey.hasPdxDotEduEmail(student), equalTo(true));
+ }
+
+ @Test
+ void emailAddressIsNotPdxDotEdu() {
+ Student student = new Student("id");
+ student.setEmail("student@gmail.com");
+ assertThat(Survey.hasPdxDotEduEmail(student), equalTo(false));
+ }
+
}
diff --git a/mvnw b/mvnw
index 41c0f0c23d..19529ddf8c 100755
--- a/mvnw
+++ b/mvnw
@@ -19,292 +19,241 @@
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
-# Maven Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
+# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# JAVA_HOME - location of a JDK home dir, required when download maven via java source
+# MVNW_REPOURL - repo url base for downloading maven distribution
+# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
+# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
+set -euf
+[ "${MVNW_VERBOSE-}" != debug ] || set -x
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
+# OS specific support.
+native_path() { printf %s\\n "$1"; }
+case "$(uname)" in
+CYGWIN* | MINGW*)
+ [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
+ native_path() { cygpath --path --windows "$1"; }
+ ;;
+esac
-fi
+# set JAVACMD and JAVACCMD
+set_java_home() {
+ # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
+ if [ -n "${JAVA_HOME-}" ]; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ]; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ JAVACCMD="$JAVA_HOME/jre/sh/javac"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ JAVACCMD="$JAVA_HOME/bin/javac"
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
+ if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
+ echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
+ return 1
fi
fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
+ else
+ JAVACMD="$(
+ 'set' +e
+ 'unset' -f command 2>/dev/null
+ 'command' -v java
+ )" || :
+ JAVACCMD="$(
+ 'set' +e
+ 'unset' -f command 2>/dev/null
+ 'command' -v javac
+ )" || :
+
+ if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
+ echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
+ return 1
+ fi
fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
+}
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
+# hash string like Java String::hashCode
+hash_string() {
+ str="${1:-}" h=0
+ while [ -n "$str" ]; do
+ char="${str%"${str#?}"}"
+ h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
+ str="${str#?}"
done
+ printf %x\\n $h
+}
- saveddir=`pwd`
+verbose() { :; }
+[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
- M2_HOME=`dirname "$PRG"`/..
+die() {
+ printf %s\\n "$1" >&2
+ exit 1
+}
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
+trim() {
+ # MWRAPPER-139:
+ # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
+ # Needed for removing poorly interpreted newline sequences when running in more
+ # exotic environments such as mingw bash on Windows.
+ printf "%s" "${1}" | tr -d '[:space:]'
+}
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
+# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
+while IFS="=" read -r key value; do
+ case "${key-}" in
+ distributionUrl) distributionUrl=$(trim "${value-}") ;;
+ distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
+ esac
+done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+
+case "${distributionUrl##*/}" in
+maven-mvnd-*bin.*)
+ MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
+ case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
+ *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
+ :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
+ :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
+ :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
+ *)
+ echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
+ distributionPlatform=linux-amd64
+ ;;
+ esac
+ distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
+ ;;
+maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
+*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
+esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
+# apply MVNW_REPOURL and calculate MAVEN_HOME
+# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-Contains the application classes for the Airline project.
+ \ No newline at end of file diff --git a/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html b/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html new file mode 100644 index 0000000000..63197885a4 --- /dev/null +++ b/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + +Contains the test classes for the Airline project.
+ \ No newline at end of file diff --git a/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-airline.xml b/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-airline.xml index 8f2ddbcab0..def4063065 100644 --- a/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-airline.xml +++ b/projects-parent/archetypes-parent/airline-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-airline.xml @@ -5,7 +5,7 @@ + PUBLIC "-//Joy of Coding at PSU//DTD Airline//EN" "airline.dtd">Contains the application classes for the Appointment Book project.
+ \ No newline at end of file diff --git a/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html b/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html new file mode 100644 index 0000000000..9777aff71c --- /dev/null +++ b/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/javadoc/edu/pdx/cs410J/__artifactId__/package.html @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + +Contains the test classes for the Appointment Book project.
+ \ No newline at end of file diff --git a/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-apptbook.xml b/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-apptbook.xml index 404d940220..5d6df1bce0 100644 --- a/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-apptbook.xml +++ b/projects-parent/archetypes-parent/apptbook-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/invalid-apptbook.xml @@ -4,14 +4,14 @@ + PUBLIC "-//Joy of Coding at PSU//DTD Appointment Book//EN" "apptbook.dtd">