Skip to content

Commit

Permalink
Merge branch 'develop' into feature/reimplement-quiz-image-upload-2
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-christl committed Aug 4, 2023
2 parents 8e80cb0 + bf85a5d commit 17318e8
Show file tree
Hide file tree
Showing 192 changed files with 5,350 additions and 2,032 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ jobs:
java-version: '${{ env.java }}'
cache: 'gradle'
- name: Java Tests
run: ./gradlew --console=plain test jacocoTestReport -x webapp jacocoTestCoverageVerification | tee tests.log
run: set -o pipefail && ./gradlew --console=plain test jacocoTestReport -x webapp jacocoTestCoverageVerification | tee tests.log
- name: Print failed tests
if: failure()
run: cat tests.log | grep "Test >.* FAILED" || [[ $? == 1 ]]
- name: "Codacy: Report coverage"
uses: codacy/codacy-coverage-reporter-action@master
with:
Expand Down
5 changes: 4 additions & 1 deletion docker/cypress-E2E-tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ services:
artemis-app:
condition: service_healthy
environment:
CYPRESS_DB_TYPE: "MySQL"
SORRY_CYPRESS_PROJECT_ID: "artemis-mysql"
command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:record:mysql"
command: >
sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && npm run cypress:record:mysql &
sleep 60 && cd /app/artemis/src/test/cypress && npm run cypress:record:mysql"
networks:
artemis:
Expand Down
5 changes: 4 additions & 1 deletion docker/cypress-E2E-tests-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ services:
artemis-app:
condition: service_healthy
environment:
CYPRESS_DB_TYPE: "Postgres"
SORRY_CYPRESS_PROJECT_ID: "artemis-postgres"
command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:record:postgres"
command: >
sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && npm run cypress:record:postgres &
sleep 60 && cd /app/artemis/src/test/cypress && npm run cypress:record:postgres"
networks:
artemis:
Expand Down
122 changes: 114 additions & 8 deletions docs/user/mobile-applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ Server Selection
After installation, users have to first decide which Artemis server they want to connect to. Per default, the user can choose between the following instances:

* TUM: https://artemis.cit.tum.de
* Codeablity: https://artemis.codeability.uibk.ac.at
* CodeAbility: https://artemis.codeability.uibk.ac.at
* KIT: https://artemis.praktomat.cs.kit.edu

Furthermore, users have the option to select a custom instance. To do this, scroll down the list of servers to the bottom. Then, select "custom instance":

|server-selection-overview|
|server-selection-overview-android|

Then, enter the URL of the server as you would enter it into the browser:

|custom-server-entered|
|custom-server-entered-android|

The "Set custom instance" button will be enabled if the client could connect successfully to Artemis.

Expand All @@ -93,13 +93,119 @@ Problems

Please report any issues on the `GitHub repository <https://github.com/ls1intum/artemis-android/issues>`_.

.. |server-selection-overview| image:: native-applications/android/server_selection_overview.png
iOS Application
---------------

The iOS application supports the following features:

#. Login:
#. Select predefined and custom Artemis servers
#. Login with username + password

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/35200?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Video tutorial of the Login on TUM-Live.
</iframe>

#. View your courses:
#. Register in new courses
#. View courses you have already registered for

#. View the exercises of your courses:
#. View exercise details and problem statement
#. View submission feedback

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/35217?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Video tutorial of the Exercise features on TUM-Live.
</iframe>

#. View the lectures of your courses:
#. View lecture details and learning units
#. View and open attachments

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/35218?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Video tutorial of the Lecture features on TUM-Live.
</iframe>

#. Communicate via Messages:
#. Create new posts
#. Write replies
#. Add emoji reactions
#. Create new conversations
#. Edit conversation settings

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/35219?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Video tutorial of the Messaging features on TUM-Live.
</iframe>

#. Receive push notifications:
#. Optionally opt in and out of push notifications
#. Choose which notifications you want to receive as push notifications
#. In-App notification center

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/35216?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Video tutorial of the Push Notification features on TUM-Live.
</iframe>

Installation
^^^^^^^^^^^^

The iOS application is currently only available in beta state and can be downloaded over `TestFlight <https://testflight.apple.com/join/WTwsKbjr>`_. Make sure to follow the steps described by TestFlight to install the application.

Server Selection
^^^^^^^^^^^^^^^^

After installation, users have to first decide which Artemis server they want to connect to. Per default, the user can choose between the following instances:

* TUM: https://artemis.cit.tum.de
* CodeAbility: https://artemis.codeability.uibk.ac.at
* KIT: https://artemis.praktomat.cs.kit.edu
* Hochschule Munich: https://artemis.cs.hm.edu/

Furthermore, users have the option to select a custom instance. To do this, scroll down the list of servers to the bottom. Under "Custom Instance" enter the URL of the server as you would enter it into the browser:

|custom-server-entered-ios|

By pressing the "Select" button the app checks if it can connect successfully to the given Artemis instance.

Push Notifications
^^^^^^^^^^^^^^^^^^

Users may receive push notifications on their iOS devices. When first logging in to an Artemis instance, users will be asked if they want to receive push notifications on that device.

.. image:: native-applications/iOS/initial_login_notification_configuration.png
:width: 300

When logged in, users can navigate to the notification settings:

.. image:: native-applications/iOS/settings_push.png
:width: 300

In this screen, users can choose which notification types they want to receive.

.. image:: native-applications/iOS/settings_push_detail.png
:width: 300

Problems
^^^^^^^^

Please report any issues on the `GitHub repository <https://github.com/ls1intum/artemis-ios/issues>`_.

.. |server-selection-overview-android| image:: native-applications/android/server_selection_overview.png
:width: 300

.. |custom-server-entered| image:: native-applications/android/custom_server_entered.png
.. |custom-server-entered-android| image:: native-applications/android/custom_server_entered.png
:width: 300

iOS Application
---------------
.. |custom-server-entered-ios| image:: native-applications/iOS/custom-server-entered-ios.PNG
:width: 300

Coming soon.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode;
import de.tum.in.www1.artemis.domain.enumeration.IncludedInOverallScore;
import de.tum.in.www1.artemis.domain.view.QuizView;
import de.tum.in.www1.artemis.web.rest.util.StringUtil;

@MappedSuperclass
public abstract class BaseExercise extends DomainObject {
Expand Down Expand Up @@ -247,6 +248,6 @@ public String getSanitizedExerciseTitle() {
if (title == null) {
return "exercise";
}
return title.replaceAll("\\s+", "_").replaceAll("[\\\\/:*?#+%$§\"<>|]", "");
return StringUtil.sanitizeStringForFileName(title);
}
}
28 changes: 9 additions & 19 deletions src/main/java/de/tum/in/www1/artemis/domain/DataExport.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,36 @@

/**
* A data export for user data
* We use the creation_date of the AbstractAuditingEntity as the date when the export was requested
**/
@Entity
@Table(name = "data_export")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class DataExport extends DomainObject {
public class DataExport extends AbstractAuditingEntity {

@Enumerated(EnumType.ORDINAL)
private DataExportState dataExportState;

@Column(name = "request_date")
private ZonedDateTime requestDate;

@Column(name = "creation_date")
private ZonedDateTime creationDate;
@Column(name = "creation_finished_date")
private ZonedDateTime creationFinishedDate;

@Column(name = "download_date")
private ZonedDateTime downloadDate;

@ManyToOne
@JoinColumn(name = "student_id")
@JoinColumn(name = "user_id")
private User user;

@Column(name = "file_path")
private String filePath;

public ZonedDateTime getRequestDate() {
return requestDate;
}

public void setRequestDate(ZonedDateTime requestDate) {
this.requestDate = requestDate;
}

public ZonedDateTime getCreationDate() {
return creationDate;
public ZonedDateTime getCreationFinishedDate() {
return creationFinishedDate;
}

public void setCreationDate(ZonedDateTime creationDate) {
this.creationDate = creationDate;
public void setCreationFinishedDate(ZonedDateTime creationDate) {
this.creationFinishedDate = creationDate;
}

public ZonedDateTime getDownloadDate() {
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/de/tum/in/www1/artemis/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ public class User extends AbstractAuditingEntity implements Participant {
@JsonIgnore
private Set<PushNotificationDeviceConfiguration> pushNotificationDeviceConfigurations = new HashSet<>();

@OneToMany(mappedBy = "user", cascade = CascadeType.REMOVE, orphanRemoval = true, fetch = FetchType.LAZY)
@JsonIgnore
private Set<DataExport> dataExports = new HashSet<>();

public String getLogin() {
return login;
}
Expand Down Expand Up @@ -452,12 +448,4 @@ public Set<PushNotificationDeviceConfiguration> getPushNotificationDeviceConfigu
public void setPushNotificationDeviceConfigurations(Set<PushNotificationDeviceConfiguration> pushNotificationDeviceConfigurations) {
this.pushNotificationDeviceConfigurations = pushNotificationDeviceConfigurations;
}

public Set<DataExport> getDataExports() {
return dataExports;
}

public void setDataExports(Set<DataExport> dataExports) {
this.dataExports = dataExports;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

/**
* An enum representing the state of a data export, which is used to determine which actions are currently available.
* The order of the enum values is important as the enum is mapped to a number representing the enum value starting with 0
*/
public enum DataExportState {

REQUESTED, IN_CREATION, EMAIL_SENT, DOWNLOADED, DOWNLOADED_DELETED, DELETED;
REQUESTED, IN_CREATION, EMAIL_SENT, DOWNLOADED, DOWNLOADED_DELETED, DELETED, FAILED;

public boolean isDownloadable() {
return this == DOWNLOADED || this == EMAIL_SENT;
}

public boolean hasBeenDownloaded() {
return this == DOWNLOADED || this == DOWNLOADED_DELETED;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public enum NotificationType {
TUTORIAL_GROUP_DEREGISTRATION_STUDENT, TUTORIAL_GROUP_REGISTRATION_TUTOR, TUTORIAL_GROUP_MULTIPLE_REGISTRATION_TUTOR, TUTORIAL_GROUP_DEREGISTRATION_TUTOR,
TUTORIAL_GROUP_DELETED, TUTORIAL_GROUP_UPDATED, TUTORIAL_GROUP_ASSIGNED, TUTORIAL_GROUP_UNASSIGNED, CONVERSATION_NEW_MESSAGE, CONVERSATION_NEW_REPLY_MESSAGE,
CONVERSATION_CREATE_ONE_TO_ONE_CHAT, CONVERSATION_CREATE_GROUP_CHAT, CONVERSATION_ADD_USER_GROUP_CHAT, CONVERSATION_ADD_USER_CHANNEL, CONVERSATION_REMOVE_USER_GROUP_CHAT,
CONVERSATION_REMOVE_USER_CHANNEL, CONVERSATION_DELETE_CHANNEL,
CONVERSATION_REMOVE_USER_CHANNEL, CONVERSATION_DELETE_CHANNEL, DATA_EXPORT_CREATED, DATA_EXPORT_FAILED
}
7 changes: 7 additions & 0 deletions src/main/java/de/tum/in/www1/artemis/domain/exam/Exam.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import de.tum.in.www1.artemis.domain.Course;
import de.tum.in.www1.artemis.domain.DomainObject;
import de.tum.in.www1.artemis.domain.User;
import de.tum.in.www1.artemis.web.rest.util.StringUtil;

@Entity
@Table(name = "exam")
Expand Down Expand Up @@ -473,6 +474,12 @@ public void setChannelName(String channelNameTransient) {
this.channelNameTransient = channelNameTransient;
}

@JsonIgnore
public String getSanitizedExamTitle() {
// exam titles are non-nullable
return StringUtil.sanitizeStringForFileName(this.title);
}

/**
* Columns for which we allow a pageable search. For example see {@see de.tum.in.www1.artemis.service.TextExerciseService#getAllOnPageWithSize(PageableSearchDTO, User)}}
* method. This ensures, that we can't search in columns that don't exist, or we do not want to be searchable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public class NotificationConstants {

public static final String FILE_SUBMISSION_SUCCESSFUL_TITLE = "artemisApp.singleUserNotification.title.fileSubmissionSuccessful";

public static final String DATA_EXPORT_CREATED_TITLE = "artemisApp.singleUserNotification.title.dataExportCreated";

public static final String DATA_EXPORT_FAILED_TITLE = "artemisApp.singleUserNotification.title.dataExportFailed";

public static final String COURSE_ARCHIVE_STARTED_TITLE = "artemisApp.groupNotification.title.courseArchiveStarted";

public static final String COURSE_ARCHIVE_FINISHED_TITLE = "artemisApp.groupNotification.title.courseArchiveFinished";
Expand Down Expand Up @@ -123,6 +127,10 @@ public class NotificationConstants {

public static final String FILE_SUBMISSION_SUCCESSFUL_TEXT = "artemisApp.singleUserNotification.text.fileSubmissionSuccessful";

public static final String DATA_EXPORT_CREATED_TEXT = "artemisApp.singleUserNotification.text.dataExportCreated";

public static final String DATA_EXPORT_FAILED_TEXT = "artemisApp.singleUserNotification.text.dataExportFailed";

public static final String COURSE_ARCHIVE_STARTED_TEXT = "artemisApp.groupNotification.text.courseArchiveStarted";

public static final String COURSE_ARCHIVE_FINISHED_WITH_ERRORS_TEXT = "artemisApp.groupNotification.text.courseArchiveFinishedWithErrors";
Expand Down Expand Up @@ -227,7 +235,8 @@ public class NotificationConstants {
.put(CONVERSATION_CREATE_ONE_TO_ONE_CHAT, CONVERSATION_CREATE_ONE_TO_ONE_CHAT_TITLE).put(CONVERSATION_CREATE_GROUP_CHAT, CONVERSATION_CREATE_GROUP_CHAT_TITLE)
.put(CONVERSATION_ADD_USER_CHANNEL, CONVERSATION_ADD_USER_CHANNEL_TITLE).put(CONVERSATION_ADD_USER_GROUP_CHAT, CONVERSATION_ADD_USER_GROUP_CHAT_TITLE)
.put(CONVERSATION_REMOVE_USER_GROUP_CHAT, CONVERSATION_REMOVE_USER_GROUP_CHAT_TITLE).put(CONVERSATION_REMOVE_USER_CHANNEL, CONVERSATION_REMOVE_USER_CHANNEL_TITLE)
.put(CONVERSATION_DELETE_CHANNEL, CONVERSATION_DELETE_CHANNEL_TITLE).build();
.put(CONVERSATION_DELETE_CHANNEL, CONVERSATION_DELETE_CHANNEL_TITLE).put(DATA_EXPORT_CREATED, DATA_EXPORT_CREATED_TITLE)
.put(DATA_EXPORT_FAILED, DATA_EXPORT_FAILED_TITLE).build();

/**
* Finds the corresponding NotificationType for the provided notification title
Expand Down
Loading

0 comments on commit 17318e8

Please sign in to comment.