Skip to content

Commit

Permalink
Merge branch 'master' into feature/ssid_coursemology_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
huyuxin0429 authored Jan 15, 2024
2 parents 2adf1c5 + 8bcd107 commit fbf3a72
Show file tree
Hide file tree
Showing 88 changed files with 2,708 additions and 797 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ jobs:
bundle exec rails db:migrate RAILS_ENV=test
bundle exec rails db:seed
- name: Install wkhtmltopdf
run: |
sudo apt-get update
sudo apt-get install -y wkhtmltopdf
- name: Install chrome
id: setup-chrome
uses: browser-actions/setup-chrome@v1
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
.yarn-integrity
*.yml
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ruby:2.6.6

# install java & set path
RUN apt-get update
RUN apt-get -y install -y sudo

RUN apt-get install -y openjdk-11-jdk
RUN sudo update-alternatives --config java

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
RUN export JAVA_HOME
RUN javac -version

# install ant
RUN apt update
RUN apt -y install ant
# RUN ant -version # Causes issues with docker build

# install antlr
WORKDIR /usr/local/lib
RUN mkdir -p /usr/java/lib
RUN wget http://www.antlr.org/download/antlr-4.8-complete.jar -P /usr/local/lib
RUN echo '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.8-complete.jar' > /usr/bin/antlr4
RUN chmod +x /usr/bin/antlr4
RUN echo '#!/bin/bash\njava org.antlr.v4.gui.TestRig' > /usr/bin/grun
RUN chmod +x /usr/bin/grun
ENV CLASSPATH .:/usr/local/lib/antlr-4.8-complete.jar:$CLASSPATH
WORKDIR /

# install mysql client
RUN apt update
RUN apt-get install default-mysql-client -y

# install rails dependencies
RUN apt-get clean all
RUN apt-get update -qq
RUN apt-get install -y build-essential libpq-dev \
curl gnupg2 apt-utils default-libmysqlclient-dev git libcurl3-dev cmake \
libssl-dev pkg-config openssl imagemagick file nodejs yarn

RUN mkdir /ssid
WORKDIR /ssid

# Adding gems
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN gem install bundler -v 2.4.18
RUN bundle install

COPY . /ssid

# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ gem 'omniauth'
gem 'omniauth-google-oauth2'
gem "omniauth-rails_csrf_protection"

gem 'passenger'
gem 'passenger'
gem 'pdfkit'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ GEM
passenger (6.0.18)
rack
rake (>= 0.8.1)
pdfkit (0.8.7.3)
popper_js (2.9.3)
prettier_print (1.2.1)
pronto (0.11.1)
Expand Down Expand Up @@ -388,6 +389,7 @@ DEPENDENCIES
omniauth-google-oauth2
omniauth-rails_csrf_protection
passenger
pdfkit
prettier_print
pronto
pronto-eslint
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SSID works with lexers based on [ANTLR4 Grammars](https://github.com/antlr/gramm

## Setup and Configuration

Before following the below instructions, please ensure that you have met all the prerequesties listed
Before following the below instructions, please ensure that you have met all the prerequesties listed below. Alternatively, you can also setup the application via docker by clicking on the docker setup documentation all the way below.

1. Clone SSID's source code onto your computer
<pre>git clone https://github.com/WING-NUS/SSID.git</pre>
Expand Down Expand Up @@ -67,9 +67,11 @@ Before following the below instructions, please ensure that you have met all the
</pre>

## Site Map
- [Setting up using Docker] (doc/docker.md)
- [Adding support for new language in SSID](doc/add_support_for_new_language.md)
- [Deploying SSID app on a Linux/Unix production server](doc/deploying_rails_on_linux.md)
- [Guide for semestral clearing of courses and submissions](doc/semestral_clearing_guide.md)
- [Setting product update announcement](doc/set_product_update_message)
- [User Guide](doc/SSID_User%20Guide_V2.pdf)

## Contact
Expand Down
1 change: 1 addition & 0 deletions app/assets/images/SSID_Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/add-course-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/add-users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/add_circle_outline_blue_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/images/avatar-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/assets/images/chart-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/check_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/confirm-plagiarism-prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/create-assignment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/create-groupings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/gradient-divider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/assets/images/integration-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/assets/images/lightning-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/mark-as-suspicious-prompt.png
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.
2 changes: 1 addition & 1 deletion app/assets/images/person_add_blue_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/plus-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/print-report-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/remove-plagiarism.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/remove-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/ssid_cover_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/student-history-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/update-course-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/user-removal-confirmation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/view-course-users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/view-submissions-prompt.png
Binary file added app/assets/images/view-visuals.png
50 changes: 50 additions & 0 deletions app/assets/javascripts/submission_obfuscation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(function () {
let SubmissionObfuscation = {};

// Retrieve the "obfuscate" parameter from the URL
let urlParams = new URLSearchParams(window.location.search);
window.shouldNotObfuscate = (urlParams.get('obfuscate') === 'false');

SubmissionObfuscation.maskStudentName = function () {

// Check if the global flag for obfuscation is false; if so, return without obfuscating
if (window.shouldNotObfuscate) {
return;
}

// Masking inside all h4 elements with id "submission_similarities_for_students" to get the student pairings
let h4Element = document.querySelector('h4[class="submission_similarities_for_students"]');
if (h4Element) {
let match = h4Element.innerHTML.match(/for Students .*? and (.*?) \(\d+\.\d+%\)/);
if (match && match[1] && match[1] !== '******') {
let student2Name = match[1];
h4Element.innerHTML = h4Element.innerHTML.replace(new RegExp("and\\s" + student2Name, "g"), "and ******");
}
}

// Masking h5 elements with the class 'submission2_by_student2'
let h5Elements = document.querySelectorAll('h5.submission2_by_student2');

h5Elements.forEach(h5Element => {
// Adjusted regex to capture student names like Student-02 or x-v6551_q1
h5Element.innerHTML = h5Element.innerHTML.replace(/Submission by [\w-]+[_\w]*/, 'Submission by ******');
});

// Masking inside table header with class "student2_submission" in every table
let tables = document.querySelectorAll('table');
tables.forEach(table => {
let thirdColumnHeader = table.querySelector('th.student2_submission');
if (thirdColumnHeader) {
// Adjusted regex to capture student names like Student-02 or x-v6551_q1
let match = thirdColumnHeader.innerHTML.match(/Submission by ([\w-]+[_\w]*)/);
if (match && match[1] && match[1] !== '******') {
thirdColumnHeader.innerHTML = thirdColumnHeader.innerHTML.replace(match[1], '******');
}
}
});
};

// Expose SubmissionObfuscation to the global context
window.SubmissionObfuscation = SubmissionObfuscation;

}).call(this);
143 changes: 83 additions & 60 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,92 @@
*/
// Custom bootstrap variables must be set or imported *before* bootstrap.
@import "bootstrap_custom";
// @import "announcements";
// @import "assignments";
// @import "courses.css";
// @import "scaffolds.css";
// @import "sessions.css";
// @import "site.css";
// @import "submission_cluster_groups.css";
// Other component specific styles (uncomment as necessary)
// @import "announcements";
// @import "assignments";
// @import "courses";
// @import "scaffolds";
// @import "sessions";
// @import "site";
// @import "submission_cluster_groups";
// @import "submission_clusters";
// @import "submission_logs";
// @import "submission_similarities";
// @import "users";

// @import "submission_clusters";
// @import "submission_logs.css";
// @import "submission_similarities.css";
// @import "users.css";

/*flash*/
.alert-error {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
text-align: left;
// ---------------------------------------------------------------------------
// 2. Application-Wide Variables
// ---------------------------------------------------------------------------

// Defining common color variables for reuse throughout the application
$color-error: #b94a48;
$color-success: #468847;
$background-error: #f2dede;
$background-success: #dff0d8;
$primary-color: #3b76f6;
$secondary-color: #64748B;
$signup-hover-bg: #2563eb;
$signup-hover-color: white;

// ---------------------------------------------------------------------------
// 3. Component-Specific Styles
// ---------------------------------------------------------------------------

// Alerts - Different variations for feedback messages
.alert-error, .alert-alert {
background-color: $background-error;
border-color: lighten($background-error, 5%);
color: $color-error;
text-align: left;
}

.alert-alert {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
text-align: left;
.alert-success, .alert-notice {
background-color: $background-success;
border-color: lighten($background-success, 5%);
color: $color-success;
text-align: left;
}

.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
text-align: left;

// Buttons - Primary actions and form submissions
.btn-signup {
@extend .btn-primary;
background-color: $primary-color;
height: 3rem;
color: white;

&:hover {
background-color: $signup-hover-bg;
color: $signup-hover-color;
}

&:active {
border-style: outset;
}
}

.alert-notice {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
text-align: left;
.btn-login {
background-color: transparent;
height: 3rem;
color: $secondary-color;
padding: 1rem;
}

// ---------------------------------------------------------------------------
// 4. Helper Classes and Utilities
// ---------------------------------------------------------------------------

// [Add helper classes and utility styles here, such as text utilities, spacing, or visibility helpers]

// ---------------------------------------------------------------------------
// 5. Responsive Adjustments
// ---------------------------------------------------------------------------

// Media queries for responsive breakpoints and adaptive styling
@media (max-width: 768px) {

.btn-signup {
@extend .btn-primary;
background-color: #003d7c !important;
height: 3rem;
color: white;
}

.btn-signup:hover {
background-color: white !important;
color: #003d7c !important;
}

.btn-signup:active {
border-style: outset !important;
}

.btn-login {
background-color: transparent;
height: 3rem;
color: #003d7c;
padding: 1rem;
}

// background-color: transparent; color: #003d7c; height: 3rem; padding: 1rem

// [Add other responsive adjustments here]
}

// Additional notes or comments can be added below as required for ongoing development documentation.

5 changes: 3 additions & 2 deletions app/assets/stylesheets/scaffolds.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with SSID. If not, see <http://www.gnu.org/licenses/>.
@import url("http://fonts.googleapis.com/css?family=Inter:400,300,500,600,700");
@import "bootstrap/functions";
@import "bootstrap/variables";
@import "bootstrap/mixins";
Expand All @@ -22,7 +23,7 @@
body {
background-color: #fff;
color: var(--bs-body-color);
font-family: var(--bs-font-sans-serif);
font-family: 'Inter', sans-serif;
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
Expand All @@ -35,7 +36,7 @@ body {
}

p, ol, ul, li, td {
font-family: var(--bs-font-sans-serif);
font-family: 'Inter', sans-serif;
font-size: 0.9375rem;
}

Expand Down
Loading

0 comments on commit fbf3a72

Please sign in to comment.